Reference · command line
Docling CLI: The Commands and Flags That Actually Matter
The Docling command line is small enough to learn in ten minutes and large enough that half the flags are irrelevant to your job. Here is the working subset, plus the ones that change output quality.
Updated 2026-10-26 · 3 min read
The short version
- –Current releases use subcommands:
docling convert,docling convert-remote,docling options. - –Output format is selected with
--to:md(default),json,html,text,doctags,chunks,latex,dclxand more. - –
--table-mode fastis the single biggest speed lever on table-heavy documents, at a real accuracy cost. - –
--ocr-option KEY=VALUEis how you reach engine-specific settings without touching Python. - –Run
docling convert --helpafter every upgrade — the flag surface does change between releases.
The command surface
Two binaries ship with the package: docling for conversion, and docling-tools for model management. Most people only ever need the first.
docling [OPTIONS] COMMAND [ARGS]...
docling convert [OPTIONS] source # local file, folder or URL
docling convert-remote [OPTIONS] # convert via a docling-serve endpoint
docling options STAGE [ENGINE] # inspect ocr | layout | table-structure settings
docling-tools [OPTIONS] COMMAND [ARGS]...
docling-tools models download
docling-tools models download-hf-repoOlder versions accepted docling file.pdf --to md without the convert subcommand. If a tutorial does not match your install, check docling --help before assuming the tutorial is wrong — the CLI moved to subcommands.
docling convert: the flags worth memorising
| Flag | Values | Why you care |
|---|---|---|
--to | md json yaml html html_split_page text doctags vtt doclang dclx chunks latex | Output format. Defaults to Markdown. Repeatable. |
--from | pdf docx pptx xlsx html md csv epub … (odf for odt/ods/odp) | Restrict accepted input formats. Defaults to all. |
--ocr-engine | auto easyocr kserve_v2_ocr nemotron-ocr ocrmac rapidocr tesserocr tesseract | Pick the recognizer instead of trusting auto. |
--ocr-lang | native codes (deu, ch) or iso: tags (iso:de, iso:zh-Hant) | Language packs. Empty string lets each engine use its own default. |
--ocr-option | KEY=VALUE, repeatable | Engine-specific settings, e.g. model_size=tiny. |
--no-ocr | — | Turn OCR off. Digital PDFs only. |
--table-mode | fast | accurate (default) | TableFormer speed/quality trade-off. |
--pipeline | legacy standard native vlm asr | Which pipeline to run. standard is the default. |
--device | auto cpu cuda mps xpu | Force a device when auto picks the wrong one. |
--num-threads | integer, default 4 | Inference threads. More is not always faster. |
--output | directory, default . | Where results are written. |
--output-file | path | Exact output path; requires one input and one format. |
Recipes
# fast tables: much quicker, measurably less precise on merged cells
docling convert statement.pdf --to md --table-mode fast
# CPU only, six threads
docling convert scan.pdf --to md --device cpu --num-threads 6
# Apple Silicon
docling convert scan.pdf --to md --device mps
# scanned PDF that keeps coming out empty
docling convert scan.pdf --to md --force-ocr --ocr-engine rapidocr --ocr-lang en
# VLM pipeline
docling convert paper.pdf --to md --pipeline vlm --vlm-model granite_doclingdocling options: what is my pipeline actually doing?
The options subcommand prints the settings for a stage — OCR, layout or table structure — optionally filtered to one engine. It is the fastest way to answer "what defaults am I running with?" and to confirm that an engine you installed is really selectable:
docling options ocr
docling options ocr rapidocr
docling options table-structure
docling options layoutdocling-tools: model management
docling-tools models download pre-fetches model artifacts so a container start or an air-gapped run does not depend on a live network. Pair it with an artifacts path so runtime looks in the right place.
Which models you need follows from the pipeline: standard conversion needs the layout and table-structure models plus whatever OCR engine you chose; --pipeline vlm needs the VLM of your choice instead. Downloading everything is a reasonable choice for a CI image and a waste for a laptop.
Reading the exit and the output
The CLI writes files rather than streaming content, so a successful run is quiet. Two habits prevent most confusion:
- Always set
--outputwhen scripting. Default output lands in the working directory and it is easy to read a stale file from the previous run. - Check the output size first. A 200-page scan producing a 3 KB Markdown file means the pipeline found almost nothing — usually OCR off or no engine installed, not a corrupt PDF.
- If you need per-table data rather than one Markdown blob, use
--to jsonand read the table structures, or go through Python as in the Docling to Excel guide.
Frequently asked questions
What is the basic Docling command?+
docling convert <source> for Markdown. Add --to json for structure, --to chunks for retrieval, and --output to control where files land.
How do I make Docling faster?+
Try --table-mode fast first, then --num-threads matching your physical cores, then --device to force the GPU. The accurate table model dominates runtime on table-heavy documents.
How do I get JSON instead of Markdown?+
Add --to json (you can repeat --to to emit several formats in one run). The JSON is the DoclingDocument structure, including tables and their cells.
Does the docling command work on URLs?+
Yes — pass the URL as the source and Docling fetches it. For remote conversion through a docling-serve instance, use docling convert-remote instead.
Why did my flags get ignored?+
Usually a version mismatch: the CLI moved to subcommands and some flags were renamed between releases. Run docling convert --help and compare against the tutorial you are following.
Try it online
Run the same pipeline in the browser — no install, no uploads stored.
Try it in the browserKeep reading
- Install Docling
Extras and platforms
- Python API
When the CLI is not enough
- OCR engines
Values for --ocr-engine
- docling-serve
convert-remote and the REST API
- Chunking for RAG
What --to chunks produces
- Docling to Excel
Tables into a spreadsheet