Back to Docling

CLI reference

docs/reference/cli.md

2.118.016.1 KB
Original Source

CLI reference

This page documents Docling's command line tools. It is generated by scripts/render_cli_reference.py from the live Typer apps — do not edit by hand.

docling

Convert documents to a unified representation, locally with convert or through a docling-serve service with convert-remote.

Usage

text
docling [OPTIONS] COMMAND [ARGS]...

Subcommands

CommandDescription
docling convert
docling convert-remoteConvert via a remote docling-serve service (see docling convert-remote --help).

docling convert

Usage

text
docling convert [OPTIONS] source

Arguments

NameTypeRequiredDescription
sourcetextyesPDF files to convert. Can be local file / directory paths or URL.

Options

NameTypeDefaultDescription
--fromtext (repeatable)Input formats to accept. Use 'odf' for odt, ods, and odp. Defaults to all supported formats.
--tomd, json, yaml, html, html_split_page, text, doctags, vtt, doclang, dclx, chunks (repeatable)Specify output formats. Defaults to Markdown.
--chunks-typehybrid, hierarchicalhybridChunker type for '--to chunks'.
--chunks-max-tokensintegerMax tokens per chunk. Defaults to the tokenizer's own limit.
--chunks-tokenizertextsentence-transformers/all-MiniLM-L6-v2HuggingFace tokenizer model name/path. Used only with --chunks-type hybrid.
--show-layout / --no-show-layoutflagfalseIf enabled, the page images will show the bounding-boxes of the items.
--headerstextSpecify http request headers used when fetching url input sources in the form of a JSON string
--html-image-headerstextSpecify http request headers used when fetching HTML and EPUB image resources in the form of a JSON string
--image-export-modeplaceholder, embedded, referencedembeddedImage export mode for image-capable document outputs (JSON, YAML, HTML, HTML split-page, and Markdown). Text, DocTags, and WebVTT outputs do not export images. With placeholder, only the position of the image is marked in the output. In embedded mode, the image is embedded as base64 encoded string. In referenced mode, the image is exported in PNG format and referenced from the main exported document.
--html-image-fetchnone, local, remote, allnoneFetch image resources referenced by HTML and EPUB inputs. Choose none, local, remote, or all.
--pipelinelegacy, standard, vlm, asrstandardChoose the pipeline to process PDF or image files.
--vlm-modeltextgranite_doclingChoose the VLM preset to use with PDF or image files. Available presets: smoldocling, granite_docling, deepseek_ocr, granite_vision, pixtral, got_ocr, phi4, qwen, nanonets_ocr2, gemma_12b, gemma_27b, dolphin, glm_ocr, lightonocr, falcon_ocr, chandra_ocr2, dots_ocr, dots_mocr
--asr-modelwhisper_tiny, whisper_small, whisper_medium, whisper_base, whisper_large, whisper_turbo, whisper_tiny_mlx, whisper_small_mlx, whisper_medium_mlx, whisper_base_mlx, whisper_large_mlx, whisper_turbo_mlx, whisper_tiny_native, whisper_small_native, whisper_medium_native, whisper_base_native, whisper_large_native, whisper_turbo_native, whisper_tiny_en_native, whisper_base_en_native, whisper_small_en_native, whisper_medium_en_native, whisper_distil_small_en_native, whisper_distil_medium_en_native, whisper_distil_large_v3_native, whisper_distil_large_v3_5_native, whisper_tiny_s2t, whisper_tiny_en_s2t, whisper_base_s2t, whisper_base_en_s2t, whisper_small_s2t, whisper_small_en_s2t, whisper_distil_small_en_s2t, whisper_medium_s2t, whisper_medium_en_s2t, whisper_distil_medium_en_s2t, whisper_large_v3_s2t, whisper_distil_large_v3_s2t, whisper_distil_large_v3_5_s2t, whisper_large_v3_turbo_s2twhisper_tinyChoose the ASR model to use with audio/video files.
--video-sampling-modefixed, scenefixedframe sampling mode.
--video-frame-intervalfloat10.0Seconds between frames in fixed interval mode.
--video-cuts-per-minutefloat0.0Target cuts per minute in scene mode (overrides prominence).
--video-prominencefloat0.0Scene change prominence threshold. 0 = auto (adapts sensitivity to video motion; recommended). Set a fixed value (e.g. 0.01) only to override.
--video-diarization / --no-video-diarizationflagfalseEnable speaker diarization (who said what). Requires resemblyzer.
--ocr / --no-ocrflagtrueIf enabled, the bitmap content will be processed using OCR.
--force-ocr / --no-force-ocrflagfalseDEPRECATED: use --ocr-mode full_page instead. Replace any existing text with OCR generated text over the full content.
--ocr-modefull_page, layout_regions, pdf_aware_layout_regions, defaultdefaultWhich document regions are fed to the OCR engine.
--tables / --no-tablesflagtrueIf enabled, the table structure model will be used to extract table information.
--ocr-enginetextautoThe OCR engine to use. When --allow-external-plugins is not set, the available values are: auto, easyocr, kserve_v2_ocr, nemotron-ocr, ocrmac, rapidocr, tesserocr, tesseract. Use the option --show-external-plugins to see the options allowed with external plugins.
--ocr-langtextProvide a comma-separated list of languages used by the OCR engine. Note that each OCR engine has different values for the language names.
--psmintegerPage Segmentation Mode for the OCR engine (0-13).
--pdf-backendpypdfium2, docling_parse, threaded_docling_parse, dlparse_v1, dlparse_v2, dlparse_v4docling_parseThe PDF backend to use.
--pdf-passwordtextPassword for protected PDF documents
--table-modefast, accurateaccurateThe mode to use in the table structure model.
--enrich-code / --no-enrich-codeflagfalseEnable the code enrichment model in the pipeline.
--enrich-formula / --no-enrich-formulaflagfalseEnable the formula enrichment model in the pipeline.
--enrich-picture-classes / --no-enrich-picture-classesflagfalseEnable the picture classification enrichment model in the pipeline.
--enrich-picture-description / --no-enrich-picture-descriptionflagfalseEnable the picture description model in the pipeline.
--enrich-chart-extraction / --no-enrich-chart-extractionflagfalseEnable chart data extraction from bar, pie, and line charts.
--artifacts-pathpathIf provided, the location of the model artifacts.
--enable-remote-services / --no-enable-remote-servicesflagfalseMust be enabled when using models connecting to remote services.
--allow-external-plugins / --no-allow-external-pluginsflagfalseMust be enabled for loading modules from third-party plugins.
--show-external-plugins / --no-show-external-pluginsflagfalseList the third-party plugins which are available when the option --allow-external-plugins is set.
--abort-on-error / --no-abort-on-errorflagfalseIf enabled, the processing will be aborted when the first error is encountered.
--outputpath.Output directory where results are saved.
--verbose / -vinteger0Set the verbosity level. -v for info logging, -vv for debug logging.
--quiet / -qflagfalseSuppress the per-file progress log emitted at default verbosity, restoring fully silent output (warnings and errors only). Has no effect when -v/--verbose is given.
--debug-visualize-cells / --no-debug-visualize-cellsflagfalseEnable debug output which visualizes the PDF cells
--debug-visualize-ocr / --no-debug-visualize-ocrflagfalseEnable debug output which visualizes the OCR cells
--debug-visualize-layout / --no-debug-visualize-layoutflagfalseEnable debug output which visualizes the layout clusters
--debug-visualize-tables / --no-debug-visualize-tablesflagfalseEnable debug output which visualizes the table cells
--versionflagShow version information.
--document-timeoutfloatThe timeout for processing each document, in seconds.
--num-threadsinteger4Number of threads
--release-native-memory-every-n-pagesinteger128Release native parser memory after every N decoded pages when using the threaded docling-parse backend.
--deviceauto, cpu, cuda, mps, xpuautoAccelerator device
--logoflagDocling logo
--page-batch-sizeinteger4Number of pages processed in one batch. Default: 4
--profiling / --no-profilingflagfalseIf enabled, it summarizes profiling details for all conversion stages.
--save-profiling / --no-save-profilingflagfalseIf enabled, it saves the profiling summaries to json.

docling convert-remote

Convert documents through a remote docling-serve service instead of locally.

Sources may be local files, local directories (walked and filtered by --from), or http(s) URLs. Results are written to --output in the formats given by --to, identical to docling convert. Only options the service honors are exposed here; local-execution flags (device, threads, pdf-backend internals, debug visualizers) do not apply to remote conversion and are intentionally absent.

Usage

text
docling convert-remote [OPTIONS] source

Arguments

NameTypeRequiredDescription
sourcetextyesDocuments to convert: local file/directory paths or http(s) URLs.

Options

NameTypeDefaultDescription
--service-urltextBase URL of the docling-serve service (required; falls back to DOCLING_SERVICE_URL or a .env file).
--api-keytextAPI key for the service (optional; falls back to DOCLING_SERVICE_API_KEY or a .env file; omit if unauthenticated).
--fromdocx, doc, pptx, ppt, html, image, pdf, asciidoc, md, csv, xlsx, xls, odt, ods, odp, xml_uspto, xml_jats, xml_xbrl, xml_doclang, dclx, mets_gbs, json_docling, audio, video, vtt, latex, email, epub, boxnote (repeatable)Input formats to accept; filters directories and is sent as the server allow-list. Defaults to all supported formats.
--tomd, json, yaml, html, html_split_page, text, doctags, vtt, doclang, dclx, chunks (repeatable)Output formats to produce and write locally. Defaults to Markdown.
--chunks-typehybrid, hierarchicalhybridChunker type for '--to chunks'.
--chunks-max-tokensintegerMax tokens per chunk. Defaults to the tokenizer's own limit.
--chunks-tokenizertextsentence-transformers/all-MiniLM-L6-v2HuggingFace tokenizer model name/path. Used only with --chunks-type hybrid.
--ocr / --no-ocrflagtrueIf enabled, the service processes bitmap content using OCR.
--force-ocr / --no-force-ocrflagfalseReplace any existing text with OCR-generated text over the full content.
--tables / --no-tablesflagtrueIf enabled, the service extracts table structure.
--pipelinelegacy, standard, vlm, asrstandardPipeline the service uses to process PDF or image files.
--ocr-langtextComma-separated list of OCR languages (engine-specific names).
--enrich-code / --no-enrich-codeflagfalseEnable the service's code enrichment model.
--enrich-formula / --no-enrich-formulaflagfalseEnable the service's formula enrichment model.
--enrich-picture-classes / --no-enrich-picture-classesflagfalseEnable the service's picture classification model.
--enrich-picture-description / --no-enrich-picture-descriptionflagfalseEnable the service's picture description model.
--enrich-chart-extraction / --no-enrich-chart-extractionflagfalseEnable the service's chart data extraction.
--image-export-modeplaceholder, embedded, referencedImage export mode for image-capable outputs (JSON, YAML, HTML, Markdown): embedded, placeholder, or referenced. If unset, the service default applies.
--page-rangetextOnly convert a range of pages, e.g. 1-4 (page numbers start at 1).
--document-timeoutfloatServer-side timeout for processing each document, in seconds.
--abort-on-error / --no-abort-on-errorflagfalseIf enabled, the service aborts the batch on the first error.
--max-concurrencyinteger8Maximum number of documents converted concurrently against the service.
--timeoutfloat300.0Client-side timeout waiting for each job to finish, in seconds.
--watcherwebsocket, pollingwebsocketHow the client tracks job status: websocket (default) or polling.
--outputpath.Output directory where results are saved.
--verbose / -vinteger0Set the verbosity level. -v for info logging, -vv for debug logging.

docling-tools

Usage

text
docling-tools [OPTIONS] COMMAND [ARGS]...

Subcommands

CommandDescription
docling-tools models

docling-tools models

Usage

text
docling-tools models [OPTIONS] COMMAND [ARGS]...

Subcommands

CommandDescription
docling-tools models download
docling-tools models download-hf-repo

docling-tools models download

Usage

text
docling-tools models download [OPTIONS] [MODELS]:[layout|tableformer|tableformerv2|code_formula|picture_classifier|smolvlm|granitedocling|granitedocling_mlx|smoldocling|smoldocling_mlx|granite_vision|granite_chart_extraction|granite_chart_extraction_v4|rapidocr|easyocr|nemotron_ocr_v2]...

Arguments

NameTypeRequiredDescription
MODELSlayout, tableformer, tableformerv2, code_formula, picture_classifier, smolvlm, granitedocling, granitedocling_mlx, smoldocling, smoldocling_mlx, granite_vision, granite_chart_extraction, granite_chart_extraction_v4, rapidocr, easyocr, nemotron_ocr_v2noModels to download (default behavior: a predefined set of models will be downloaded).

Options

NameTypeDefaultDescription
-o / --output-dirpath/Users/nli/.cache/docling/modelsThe directory where to download the models.
--force / --no-forceflagfalseIf true, the download will be forced.
--allflagfalseIf true, all available models will be downloaded (mutually exclusive with passing specific models).
-q / --quietflagfalseNo extra output is generated, the CLI prints only the directory with the cached models.
--easyocr-langtext (repeatable)EasyOCR language code to prefetch. Repeat for multiple languages.
--rapidocr-backend-langtext (repeatable)RapidOCR checkpoint set to prefetch, as '<backend>:<lang>' (e.g. 'onnxruntime:th'). Repeat for multiple. Replaces the default set.

docling-tools models download-hf-repo

Usage

text
docling-tools models download-hf-repo [OPTIONS] MODELS...

Arguments

NameTypeRequiredDescription
MODELStextyesSpecific models to download from HuggingFace identified by their repo id. For example: docling-project/docling-models .

Options

NameTypeDefaultDescription
-o / --output-dirpath/Users/nli/.cache/docling/modelsThe directory where to download the models.
--force / --no-forceflagfalseIf true, the download will be forced.
-q / --quietflagfalseNo extra output is generated, the CLI prints only the directory with the cached models.