Skip to content

Add firecrawl.parse command (local document upload) - #5

Merged
rakshith48 merged 1 commit into
mainfrom
feat/parse-command
Jun 16, 2026
Merged

rakshith48 merged 1 commit into
mainfrom
feat/parse-command

Conversation

@rakshith48

Copy link
Copy Markdown
Collaborator

Adds a firecrawl.parse command.run capability backed by POST /v2/parse, for parsing local / non-public documents (PDF, DOCX, XLSX, HTML, …).

What's different from the other commands

/v2/parse is multipart/form-data, not JSON. So:

  • The plugin reads a local file path from disk and uploads the bytes as the file part.
  • options (scrape-style formats etc.) is sent as a plain text field — sending it as a Blob makes it a file part and the server rejects it (Unexpected field).
  • api() generalized to pass a FormData body through untouched (no forced JSON Content-Type), JSON callers unchanged.
agent-browser plugin run firecrawl firecrawl.parse --payload '{"file":"./report.pdf","options":{"formats":["markdown"]}}'

Verification

  • node --test 14/14 (incl. multipart-upload + missing-file cases; mock asserts the file bytes + options ride in the multipart body).
  • Live against the real API: parsed a local HTML file → markdown (with and without options).
  • Via agent-browser plugin run firecrawl firecrawl.parse end-to-end.
  • Regression: JSON scrape + browser.provider open/close still work after the api() change; 0 leaked sessions.

🤖 Generated with Claude Code

New command.run capability `firecrawl.parse` -> POST /v2/parse. Unlike the
JSON endpoints, parse is multipart/form-data: the plugin reads a local `file`
path and uploads it with optional `options` (sent as a text field, not a file
part). api() generalized to pass FormData through without forcing a JSON
Content-Type. +2 hermetic tests (multipart upload, missing-file error).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rakshith48
rakshith48 merged commit 0c0a2cc into main Jun 16, 2026
3 checks passed
@rakshith48
rakshith48 deleted the feat/parse-command branch June 16, 2026 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant