docparser/CLI
CLI
Drive docparser from the terminal — parse single files or whole directories, pick PDF backends, and enable VLM captioning.
Installing rc-docparser puts a docparser command on your PATH. It mirrors
the library API: parse a single file, walk a directory, and toggle the same
backends, OCR, table extraction, and captioning options.
Parse a single file
docparser parse paper.pdf --workspace ./out --no-vlmWalk a whole directory
docparser parse-all --workspace ./project --no-vlmThis is the CLI equivalent of run_all — it parses everything supported under
the workspace's data/raw/.
Enable VLM captioning
Captioning requires an API key (here, OpenRouter), read from the environment or
a .env file:
export OPENROUTER_API_KEY=sk-or-v1-...
docparser parse-all --workspace ./project --max-images 50Higher-fidelity PDF
Pick a backend, OCR scanned pages, and extract tables:
docparser parse paper.pdf --pdf-backend docling --ocr auto --pdf-tables --no-vlmSee PDF backends & OCR for what each backend and OCR mode does.
Caption with a different provider
docparser parse-all --workspace ./project --vlm-provider openai --vlm-model gpt-4o-miniVersion
docparser versionCommon flags
| Flag | Purpose |
|---|---|
--workspace <dir> | Root for the data/raw + data/parsed + data/assets + .cache layout. |
--no-vlm | Disable figure captioning. |
--max-images <n> | Cap how many images get captioned. |
--pdf-backend <name> | builtin / pymupdf4llm / docling / marker. |
--ocr <mode> | off / auto / force for scanned PDFs. |
--pdf-tables | Emit real table blocks via pdfplumber. |
--vlm-provider <name> | openrouter / openai / gemini / local / transformers. |
--vlm-model <model> | Override the captioning model. |
Next
- See per-format behavior in Supported formats.
- Configure providers and defaults in Configuration.