Search every option#
Type a word (/ focuses the box) or filter by group. Defaults shown are the CLI's own; values in code are the accepted choices.
Syntax#
docling convert [OPTIONS] SOURCE
docling SOURCE [OPTIONS] # same thing: convert is the default command
docling options {ocr|layout|table-structure} [ENGINE]
docling --versionSOURCE may be a file path, a folder (walked recursively and filtered by --from) or an http(s) URL. Output files are named after the input and written to --output (default: the current folder).
Tested recipes#
Each of these ran on Docling 2.148.0. Swap the file names for yours.
Formats and output
docling convert report.pdf --to md --to json --output out/docling convert ./inbox --from pdf --to md --output ./outdocling convert report.pdf --to md --output-file report.mddocling convert report.pdf --page-range 1-10docling convert report.pdf --to md --image-export-mode referenced --output out/docling convert report.pdf --to html_split_page --show-layoutOCR
docling convert report.pdf --no-ocrdocling convert scan.pdf --ocr-mode full_pagedocling convert contract.pdf --replace-broken-text-layerdocling convert scan.pdf --ocr-engine tesseract --ocr-lang deu,engdocling convert scan.pdf --ocr-engine rapidocr --ocr-option backend=torch --ocr-lang iso:jaTables, enrichment and models
docling convert report.pdf --table-mode fastdocling convert report.pdf --heading-hierarchydocling convert paper.pdf --enrich-formula --enrich-codedocling convert report.pdf --pipeline vlm --vlm-model granite_doclingdocling convert meeting.mp3 --pipeline asr --asr-model whisper_turbo --to md --to vttRAG and automation
docling convert report.pdf --to chunks --chunks-max-tokens 512 --output chunks/docling convert ./inbox --to json --quiet --fail-on partial --output ./outdocling convert report.pdf --profilingThe options command#
Engines have more settings than dedicated flags. docling options lists the engines of a pipeline stage and the keys each accepts; pass those keys with the matching --*-option KEY=VALUE flag. Values are parsed as JSON when possible (0.6, false, ["en","de"]).
docling options ocr # auto easyocr kserve_v2_ocr nemotron-ocr ocrmac rapidocr tesserocr tesseract
docling options layout # layout_object_detection docling_layout_default docling_experimental_table_crops_layout
docling options table-structure # docling_tableformer docling_tableformer_v2 granite_vision_table
docling options ocr rapidocr # keys: mode, lang, scale, backend, model_size, text_score, …docling convert scan.pdf --ocr-engine rapidocr --ocr-option backend=torch --ocr-option model_size=tiny --ocr-option text_score=0.6Exit codes#
--fail-on | Exit code 1 when… |
|---|---|
failure (default) | any document fails |
partial | any document fails or is only partially converted |
never | never — always exits 0 |
By default a folder conversion continues after a failed file; add --abort-on-error to stop at the first one.
Deprecated and renamed flags#
If a command from an older tutorial misbehaves, check this table first.
| Old | Use in 2.148.0 | Why |
|---|---|---|
--force-ocr | --ocr-mode full_page | Marked DEPRECATED in the CLI help |
--psm N | --ocr-option psm=N | Marked DEPRECATED; engine settings moved to --ocr-option |
--ocr-lang chinese / english (RapidOCR) | --ocr-lang ch / en, or iso:zh-Hans | Old spellings still resolve, with a warning |
Remote conversion#
With the service-client extra installed, the CLI gains docling convert-remote, which sends documents to a docling-serve server and writes the results locally. It needs no PyTorch — the environment was 258 MB in our test.
pip install "docling-slim[service-client]"
export DOCLING_SERVICE_URL=http://localhost:5001
export DOCLING_SERVICE_API_KEY=... # only if the server requires one
docling convert-remote report.pdf --to md --output out/Environment variables#
| Variable | Effect |
|---|---|
DOCLING_ARTIFACTS_PATH | Folder with pre-downloaded models (same as --artifacts-path) |
DOCLING_SERVICE_URL, DOCLING_SERVICE_API_KEY | Server and key for convert-remote |
OMP_NUM_THREADS | Caps threads used by the underlying math libraries |
Frequently asked questions
What is the basic Docling command?
docling convert file.pdf converts a PDF to Markdown in the current folder. Add --to json, --to html or other --to values for more formats, and --output DIR to choose where files go.
How do I disable OCR in the Docling CLI?
Add --no-ocr. It is the right choice for PDFs that already contain text and was 3.6 times faster in our benchmark.
How do I convert a whole folder with Docling?
Pass the folder as SOURCE: docling convert ./inbox --to md --output ./out. Add --from pdf to only pick up PDFs and --abort-on-error to stop at the first failure.
How do I see the options for one OCR engine?
Run docling options ocr ENGINE, for example docling options ocr rapidocr. It prints every KEY you can pass with --ocr-option KEY=VALUE, with type and default.
What does docling convert return as exit code?
By default it exits with 1 if any document fails. --fail-on partial also fails on partially converted documents, and --fail-on never always exits 0.