Meet the Docling team at IBM TechXchange 2026 · Atlanta, GA · October 26–29, 2026See our sessions
DoclingDocling for IBM watsonx
Guides

Command Line

Convert files, folders and URLs with Docling for IBM watsonx from the terminal using docling convert-remote

docling convert-remote sends documents to Docling for IBM watsonx and writes the results next to you, in the same formats as a local docling convert. Nothing runs on your machine except the upload and the download, so you need no GPU and no models.

It is the simplest way to convert a folder of files from a shell script, and it is what the Agent Skills integration teaches an AI assistant to use.

Install

Install the lightweight client. It includes the docling command and does not download any models:

pip install docling-client

These packages also provide the same command and are valid alternatives:

PackageWhen to use it
docling-clientRecommended. Only what is needed to talk to the service
docling-slim[service-client]The same client, when you want to choose the extras yourself
doclingYou also want to convert documents locally, on your own machine

To keep the command out of your project environment, install it as a tool: uv tool install docling-client or pipx install docling-client.

Set your credentials

The command reads the Service URL and API key from, in order of precedence:

  1. the flags --service-url and --api-key
  2. the environment variables DOCLING_SERVICE_URL and DOCLING_SERVICE_API_KEY
  3. a .env file in the current working directory

The simplest setup is a .env file in the folder you work from:

.env
DOCLING_SERVICE_URL=https://your-service-url
DOCLING_SERVICE_API_KEY=your-api-key

Add .env to your .gitignore. Never commit an API key.

Convert documents

# One local file, Markdown written to ./report.md
docling convert-remote report.pdf

# A URL, written to ./out
docling convert-remote --output ./out https://arxiv.org/pdf/2408.09869

# Several sources at once
docling convert-remote report.pdf minutes.docx handbook.epub

# A whole folder (walked recursively), only PDF and DOCX files
docling convert-remote --from pdf --from docx --output ./out ./inbox

Each source produces one file per requested format, named after the source: report.md, report.dclx, and so on. URLs are passed to the service as they are, and are not downloaded locally first.

Markdown and DocLang together

Markdown is easy to read. DocLang keeps the full structure: sections, tables down to the cell, reading order and page positions. Ask for both in one call:

docling convert-remote --to md --to dclx --output ./out report.pdf

Open out/report.dclx in the DocLang Viewer, or query it from the terminal with dclq:

pip install dclq
dclq outline ./out/report.dclx
dclq show ./out/report.dclx '/heading[2]' --section

See Explore with DocLang for more.

Options

All options are flags on docling convert-remote. Run docling convert-remote --help for the full list.

Inputs and outputs

FlagEffect
--to FORMATOutput format. Repeat for several. md (default), json, html, text, doclang (DocLang XML, .dclg.xml), dclx (DocLang archive)
--from FORMATInput formats to accept, for example pdf, docx, pptx, xlsx, html, epub, image. Repeat for several. Filters the files found in folders. Defaults to all supported formats
--output DIRFolder for the results. Default: the current folder
--page-range 1-4Convert only these pages (numbering starts at 1)
--image-export-mode MODEHow images appear in Markdown, HTML and JSON: placeholder, embedded or referenced

Conversion

FlagEffect
--no-ocrSkip OCR. Use it for born-digital PDFs where the text is already embedded
--force-ocrReplace any embedded text with OCR text. Use it for scans with a bad text layer
--ocr-lang LANGSComma-separated OCR languages, for example en,de
--no-tablesSkip table structure recognition. Faster, but tables become plain text

Pictures

FlagEffect
--enrich-picture-classesClassify each picture (chart, diagram, photo, logo, …). Off by default

Client behaviour

FlagEffect
--max-concurrency NHow many documents are converted at the same time
--timeout SECONDSHow long to wait for each document. Default: 300
--document-timeout SECONDSProcessing time limit for each document on the service
--abort-on-errorStop at the first failed document
--watcher pollingTrack progress by polling the status endpoint. The default, websocket, falls back to polling automatically
-v, -vvInfo or debug logging

A full example

Convert a born-digital PDF to Markdown and DocLang, classify its pictures and embed them in the Markdown:

docling convert-remote \
  --to md --to dclx \
  --no-ocr \
  --enrich-picture-classes \
  --image-export-mode embedded \
  --output ./out \
  report.pdf

Exit codes

CodeMeaning
0All documents converted
1Runtime or connection failure: the service is unreachable, or a conversion failed
2Configuration error: no Service URL from the flag, the environment or .env

Use them in scripts, for example docling convert-remote ./inbox || echo "conversion failed".

When to use something else

You want toUse
Convert from Python codethe Python SDK
Convert thousands of files, or read from and write to cloud storageBatch Conversion with connectors
Chunk documents for retrievalChunking
Let an AI assistant convert documents for youAgent Skills or MCP

On this page