Research CommonsResearch Commons
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-vlm

Walk a whole directory

docparser parse-all --workspace ./project --no-vlm

This 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 50

Higher-fidelity PDF

Pick a backend, OCR scanned pages, and extract tables:

docparser parse paper.pdf --pdf-backend docling --ocr auto --pdf-tables --no-vlm

See 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-mini

Version

docparser version

Common flags

FlagPurpose
--workspace <dir>Root for the data/raw + data/parsed + data/assets + .cache layout.
--no-vlmDisable 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-tablesEmit real table blocks via pdfplumber.
--vlm-provider <name>openrouter / openai / gemini / local / transformers.
--vlm-model <model>Override the captioning model.

Next