Document parsing CLI for agents and CI
openparser parse sync ./doc.pdf. Switch OCR models, poll jobs, and extract JSON from a shell agents already know. SDKs mirror the same surface for Node and Python.
Install CLI and SDKs
Global CLI for agents and CI. SDK packages for application code. All three speak the same API surface.
npm i -g @openparser/cli
Global openparser binary for parse, jobs, models, and extract subcommands. Named auth profiles store API keys outside your repo.
npm install @openparser/sdk
TypeScript SDK with the same methods as the CLI: parse sync and async, job polling, model discovery, and schema extraction.
pip install openparser
Python client for notebooks, ETL, and agent frameworks. Identical request and response shapes as Node.
CLI parse commands
The CLI calls the same /parse and /extract routes as the SDKs. Sync for quick files, async for large PDFs, batch for folders.
/parserequestcurl https://api.openparser.dev/parse \
-H "Authorization: Bearer op_live_…" \
-H "Idempotency-Key: $(uuidgen)" \
-F 'request={"ocr_model":"paddleocr-vl-1.6","output_format":"openparser@1"};type=application/json' \
-F "file=@statement.pdf"{
"output_format": "openparser@1",
"document_id": "doc_3f9a2c",
"page_count": 1,
"markdown": "## Payment Authorization\n| Item | Amount |\n| --- | --- |\n| Total | $4,318.20 |",
"blocks": [
{
"index": 0,
"page_number": 1,
"kind": "text",
"text": "## Payment Authorization"
},
{
"index": 1,
"page_number": 1,
"kind": "table",
"table_html": "<table><tr><th>Item</th><th>Amount</th></tr><tr><td>Total</td><td>$4,318.20</td></tr></table>",
"bbox": {
"left": 14,
"top": 53,
"right": 146,
"bottom": 123
},
"confidence": 0.98
}
],
"regions": [],
"contents": [],
"chunks": []
}CLI and SDK parity
Agents can shell out to openparser. Applications import the SDK. Both hit the same hosted API with the same ocr_model and output_format fields.
Agent-friendly CLI
Structured stdout and JSON flags fit tool-calling loops. Parse a file, pipe markdown, or dump the full OpenParser document graph for the next agent step.
Named auth profiles
Store API keys with openparser auth login. Profiles live under ~/.config/openparser. Switch staging and prod with --profile or OPENPARSER_PROFILE.
Model discovery
openparser models ocr lists hosted engines with retail prices before you enqueue work. Same catalog as GETÂ /models/ocr.
Parity with SDKs
Every CLI subcommand maps to an SDK method. Move from a shell prototype to typed application code without relearning the API.
Sync, async, and batch
Parse one file synchronously, queue a large PDF, or submit a batch directory. Poll jobs with the same ids the REST API returns.
Typed JSON stdout
Emit markdown or the full ParsedDocument JSON. Extraction results include grounding citations tied to block ids from the parse.
Hosted parsing rates
Install the CLI or SDKs at no charge. Hosted parsing bills per page; open-weight hosted models start at $1 per 1,000 pages with $10 free credits.
- CLI and SDKs are free to install
- Hosted parsing metered per page
- Open-weight hosted from $1 / 1,000 pages
- $10 credits at signup
- Same page prices as the REST API
CLI and SDK FAQ
Install paths, agent workflows, model flags, and where the client guides live.
How do I install the OpenParser CLI?
Run npm i -g @openparser/cli. Authenticate with openparser auth login or set OPENPARSER_API_KEY. Named profiles live under ~/.config/openparser.
Does the CLI match the REST API?
Yes. Subcommands call the same /parse, /jobs, /extract, and /models/ocr routes. Request fields like ocr_model and output_format are identical.
Can agents use the CLI instead of the SDK?
Yes. The CLI is designed for tool-calling agents that already run shell commands. Use --json for machine-readable ParsedDocument output.
Is there a Python client?
pip install openparser installs the Python SDK with the same API surface as @openparser/sdk for Node. Both return the same OpenParser documents.
How do I switch OCR models from the CLI?
Pass --ocr-model or set ocr_model in the request JSON for parse commands. Run openparser models ocr to list available ids and retail prices.
Does the CLI work in CI?
Yes. Store an API key in a CI secret, configure a named profile, and run openparser parse async or batch in pipelines. Poll jobs until complete before downstream steps.
Run openparser parse from the shell
Run npm i -g @openparser/cli, openparser auth login, then openparser parse sync ./doc.pdf. Use @openparser/sdk or the Python client for in-process types.