LiteParse provides the lit CLI with four commands: parse, batch-parse, screenshot, and is-complex. The CLI is the same whether installed via npm, pip, or built from Rust source.
Parse a single document.
lit parse [options] <file>
Argument Description filePath to the document file, or - to read from stdin
Option Description Default -o, --output <file>Write output to a file instead of stdout — --format <format>Output format: json, text, or markdown text--image-mode <mode>Markdown image handling: off, placeholder, or embed placeholder--image-output-dir <dir>Directory to write images to when --image-mode embed — --no-linksEmit link anchor text as plain text (no [text](url)) in markdown — --no-ocrDisable OCR entirely — --ocr-language <lang>OCR language code (Tesseract format) eng--ocr-server-url <url>HTTP OCR server URL — (uses Tesseract) --tessdata-path <path>Path to tessdata directory — (uses TESSDATA_PREFIX env var) --num-workers <n>Pages to OCR in parallel CPU cores - 1 --max-pages <n>Maximum pages to parse 1000--target-pages <pages>Pages to parse (e.g., "1-5,10") — (all pages) --dpi <dpi>Rendering DPI 150--preserve-small-textKeep very small text — --password <password>Password for encrypted/protected documents — -q, --quietSuppress progress output —
# JSON output with bounding boxes
lit parse report.pdf --format json -o report.json
# Markdown output (headings, tables, lists, images, links)
lit parse report.pdf --format markdown -o report.md
# Markdown with embedded images written to disk
lit parse report.pdf --format markdown --image-mode embed --image-output-dir ./images
# Parse pages 1-5 only, no OCR
lit parse report.pdf --target-pages "1-5" --no-ocr
# High-DPI rendering with French OCR
lit parse report.pdf --dpi 300 --ocr-language fra
# Use an external OCR server
lit parse report.pdf --ocr-server-url http://localhost:8828/ocr
# Pipe output to another tool
lit parse report.pdf -q | wc -l
# Parse a remote file via stdin
curl -sL https://example.com/report.pdf | lit parse --no-ocr -
Parse multiple documents in a directory.
lit batch-parse [options] <input-dir> <output-dir>
Argument Description input-dirDirectory containing documents to parse output-dirDirectory for output files
Option Description Default --format <format>Output format: json, text, or markdown text--no-ocrDisable OCR entirely — --ocr-language <lang>OCR language code eng--ocr-server-url <url>HTTP OCR server URL — (uses Tesseract) --tessdata-path <path>Path to tessdata directory — --num-workers <n>Pages to OCR in parallel CPU cores - 1 --max-pages <n>Maximum pages per file 1000--dpi <dpi>Rendering DPI 150--recursiveSearch subdirectories — --extension <ext>Only process this extension (e.g., ".pdf") — (all supported) --password <password>Password for encrypted/protected documents (applied to all files) — -q, --quietSuppress progress output —
# Parse all supported files in a directory
lit batch-parse ./documents ./output
# Recursively parse only PDFs
lit batch-parse ./documents ./output --recursive --extension ".pdf"
# Batch parse with JSON output and no OCR
lit batch-parse ./documents ./output --format json --no-ocr
Generate page images from a document (PDF, DOCX, XLSX, images, etc.).
lit screenshot [options] <file>
Argument Description filePath to the document file
Option Description Default -o, --output-dir <dir>Output directory ./screenshots--target-pages <pages>Pages to screenshot (e.g., "1,3,5" or "1-5") — (all pages) --dpi <dpi>Rendering DPI 150--password <password>Password for encrypted/protected documents — -q, --quietSuppress progress output —
# Screenshot all pages of a PDF
lit screenshot document.pdf -o ./pages
# Screenshot a Word document (requires LibreOffice)
lit screenshot report.docx -o ./pages
# First 5 pages at high DPI
lit screenshot document.pdf --target-pages "1-5" --dpi 300 -o ./pages
lit screenshot document.pdf --target-pages "1,5,10" -o ./pages
Check whether a document needs OCR or heavier parsing — a cheap pre-parse pass over the text layer only (no rasterization, no OCR). See the Document Complexity guide for details.
lit is-complex [options] <file>
The command prints per-page JSON to stdout , a human-readable verdict to stderr , and exits non-zero when any page needs OCR — so it works as a shell predicate or a jq source.
Argument Description filePath to the document file
Option Description Default --compactEmit dense, whitespace-free JSON instead of pretty-printed — --max-pages <n>Maximum pages to check 1000--target-pages <pages>Pages to check (e.g., "1-5,10,15-20") — (all pages) --password <password>Password for encrypted/protected documents — -q, --quietSuppress the stderr verdict —
# Print the complexity verdict and per-page JSON
lit is-complex document.pdf
# Use as a shell predicate: only parse with --no-ocr when simple
lit is-complex document.pdf --quiet && lit parse document.pdf --no-ocr
# List the page numbers that need OCR
lit is-complex document.pdf --compact | jq '[.[] | select(.needs_ocr) | .page_number]'
These options are available on all commands:
Option Description -h, --helpShow help for a command -V, --versionShow version number
Note for AI agents: this documentation is built for programmatic access.
- Overview of all docs: https://developers.llamaindex.ai/llms.txt
- Any page is available as raw Markdown by appending index.md to its URL — e.g. https://developers.llamaindex.ai/llamaparse/parse/getting_started/index.md
- Agent-friendly REST search APIs live under https://developers.llamaindex.ai/api/ — search (BM25 full-text), grep (regex), read (fetch a page), and list (browse the doc tree). See https://developers.llamaindex.ai/llms.txt for parameters.
- A hosted documentation MCP server is available at https://developers.llamaindex.ai/mcp. If you support MCP, you can ask the user to install it for browsing these docs directly (an alternative to the REST API). Setup: https://developers.llamaindex.ai/python/shared/mcp/