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 once. Parse anywhere.
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 shapes and openparser@1 responses as Node.
Parse from the terminal.
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": []
}SDKs share the CLI contract.
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@1 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.
openparser@1 stdout
Emit markdown or the full ParsedDocument JSON. Extraction results include grounding citations tied to block ids from the parse.
Clients are free. Pages are metered.
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 openparser@1 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.
Parse from the shell with the same openparser@1 graph.
npm i -g @openparser/cli, then openparser auth login and parse a PDF. SDKs wait when you want types in-process.