@openparser/cli
v1.0.2
Published
Parse and extract documents from your terminal, CI jobs, or agent tools.
Maintainers
Readme
@openparser/cli
Parse and extract documents from your terminal, CI jobs, or agent tools.
Install
npm i -g @openparser/cli
openparser auth loginSet OPENPARSER_API_KEY in CI. Use openparser auth login --profile staging
and openparser auth use staging to manage named profiles.
Commands
| Command | Purpose |
| --------------------------------------------- | ------------------------------------------------------------ |
| openparser status | Verify API connectivity and profile context. |
| openparser auth | Profile management. |
| openparser models | OCR and LLM model catalogs. |
| openparser parse | Synchronous, async, and batch parse admission. |
| openparser extract | Schema-constrained extraction, batch, and schema suggestion. |
| openparser jobs | List jobs, fetch status, results, and source bytes. |
| openparser files | Upload and reuse pooled files. |
| openparser pipelines | Saved extraction pipelines. |
Regenerate the command reference under docs/ with:
bun run --cwd packages/openparser-cli generateStream conventions
- stdout carries data payloads (JSON results, file bytes, human tables).
- stderr carries status lines (
✓,✗, hints). Use--jsonwhen scripting. --quiet/-qsilences non-error status output on stderr.
Examples
openparser status --json
openparser models ocr
openparser parse sync ./invoice.pdf --json | jq .
openparser parse batch --request ./parse-batch.json ./a.pdf ./b.pdf
openparser extract sync ./invoice.pdf --schema ./invoice.schema.json
openparser extract suggest-schema --parse-job-id opj_...
openparser extract batch --request ./extract-batch.json
openparser jobs list --status succeeded --limit 10
openparser files upload ./contract.pdfEnvironment variables
| Variable | Purpose |
| --------------------- | --------------------------------------------------------------------------------- |
| OPENPARSER_API_KEY | Bypass profiles for CI. When set, the CLI ignores the saved API key and base URL. |
| OPENPARSER_BASE_URL | Override the API origin (default https://api.openparser.dev). |
| OPENPARSER_PROFILE | One-shell profile switch. Persistent equivalent: openparser auth use <name>. |
Resolution precedence: command-line flags > env vars > active profile > defaults.
