Skill Tracer
Skills › Scientific Agent Skills › liteparse › cli_reference.md

cli_reference.md

138 lines · skills/liteparse/references/cli_reference.md at 5f2bc03

Open on GitHub
1# LiteParse CLI Reference (`lit`)
2
3The **`lit`** command ships with `liteparse` (Python), `@llamaindex/liteparse` (npm), and `cargo install liteparse` (Rust). This reference covers the Python-provided 2.15.0 CLI (`lit ... --help` was executed). Node/Rust releases target the same commands, but inspect the installed CLI before copying version-specific flags.
4
5```bash
6lit --help
7lit parse --help
8lit batch-parse --help
9lit screenshot --help
10```
12---

LiteParse CLI Reference (lit)

The **lit** command ships with liteparse (Python), @llamaindex/liteparse (npm), and cargo install liteparse (Rust). This reference covers the Python-provided 2.15.0 CLI (lit ... --help was executed). Node/Rust releases target the same commands, but inspect the installed CLI before copying version-specific flags.

lit --help
lit parse --help
lit batch-parse --help
lit screenshot --help

Raw lines 1 to 13
14## `lit parse`
16Parse a single file or stdin.
18```
19lit parse [OPTIONS] <file>
20```
22| Option | Description |
23|--------|-------------|
24| `-o, --output <file>` | Write output to file (default: stdout) |
25| `--format <format>` | `json`, `text`, or `markdown` (default: `text`) |
26| `--no-ocr` | Disable OCR |
27| `--ocr-language <lang>` | Tesseract language (default: `eng`) |
28| `--ocr-server-url <url>` | Complete HTTP OCR endpoint URL (no `/ocr` appended) |
29| `--ocr-server-header <header>` | Repeatable `Name: Value` header for HTTP OCR |
30| `--tessdata-path <path>` | Tessdata directory; missing files still download |
31| `--max-pages <n>` | Max pages (default: 1000) |
32| `--target-pages <pages>` | e.g. `1-5,10,15-20` |
33| `--dpi <dpi>` | Rendering DPI (default: 150) |
34| `--preserve-small-text` | Keep very small text |
35| `--password <password>` | Encrypted document password |
36| `--num-workers <n>` | Concurrent OCR workers |
37| `-q, --quiet` | Suppress progress |
38| `-h, --help` | Help |

lit parse

Parse a single file or stdin.

lit parse [OPTIONS] <file>
OptionDescription
-o, --output <file>Write output to file (default: stdout)
--format <format>json, text, or markdown (default: text)
--no-ocrDisable OCR
--ocr-language <lang>Tesseract language (default: eng)
--ocr-server-url <url>Complete HTTP OCR endpoint URL (no /ocr appended)
--ocr-server-header <header>Repeatable Name: Value header for HTTP OCR
--tessdata-path <path>Tessdata directory; missing files still download
--max-pages <n>Max pages (default: 1000)
--target-pages <pages>e.g. 1-5,10,15-20
--dpi <dpi>Rendering DPI (default: 150)
--preserve-small-textKeep very small text
--password <password>Encrypted document password
--num-workers <n>Concurrent OCR workers
-q, --quietSuppress progress
-h, --helpHelp
Raw lines 14 to 39
40### Examples
42```bash
43lit parse document.pdf
44lit parse document.pdf --format json -o output.json
45lit parse document.pdf --format markdown -o output.md
46lit parse document.pdf --target-pages "1-5,10" --no-ocr
47lit parse scan.pdf --ocr-language fra --dpi 200
48lit parse protected.pdf --password secret
49curl -sL https://example.com/paper.pdf | lit parse - -o paper.txt
50```
52---
54Optional parse flags verified from 2.15.0 `--help`:
56- `--continue-on-page-error`: report page extraction failures while retaining
57 successful pages. Check JSON `page_errors`; text/Markdown errors go to stderr.
58- `--image-mode off|placeholder|embed`: Markdown presentation; use
59 `--extract-images --image-output-dir images` for actual image files.
60- `--no-links`, `--keep-headers-footers`: control Markdown rendering.
61- `--extract-blocks`, `--extract-annotations`, `--extract-form-fields`,
62 `--extract-structure-tree`, `--extract-vector-graphics`,
63 `--extract-text-metadata`, `--extract-xfa-packets`, `--extract-content-bounds`,
64 `--complexity`: include optional structured fields in JSON.
66These optional extraction flags were source/help-checked; representative block,
67image and metadata behavior was smoke-tested, not every document feature.

Examples

lit parse document.pdf
lit parse document.pdf --format json -o output.json
lit parse document.pdf --format markdown -o output.md
lit parse document.pdf --target-pages "1-5,10" --no-ocr
lit parse scan.pdf --ocr-language fra --dpi 200
lit parse protected.pdf --password secret
curl -sL https://example.com/paper.pdf | lit parse - -o paper.txt

Optional parse flags verified from 2.15.0 --help:

  • --continue-on-page-error: report page extraction failures while retaining successful pages. Check JSON page_errors; text/Markdown errors go to stderr.
  • --image-mode off|placeholder|embed: Markdown presentation; use --extract-images --image-output-dir images for actual image files.
  • --no-links, --keep-headers-footers: control Markdown rendering.
  • --extract-blocks, --extract-annotations, --extract-form-fields, --extract-structure-tree, --extract-vector-graphics, --extract-text-metadata, --extract-xfa-packets, --extract-content-bounds, --complexity: include optional structured fields in JSON.

These optional extraction flags were source/help-checked; representative block, image and metadata behavior was smoke-tested, not every document feature.

Raw lines 40 to 68
69## `lit batch-parse`
71Parse every supported file in a directory.
73```
74lit batch-parse [OPTIONS] <input-dir> <output-dir>
75```
77| Option | Description |
78|--------|-------------|
79| `--format <format>` | `json`, `text`, or `markdown` (default: `text`) |
80| `--no-ocr` | Disable OCR |
81| `--ocr-language <lang>` | Tesseract language (default: `eng`) |
82| `--ocr-server-url <url>` | Complete HTTP OCR endpoint URL |
83| `--ocr-server-header <header>` | Repeatable `Name: Value` header for HTTP OCR |
84| `--tessdata-path <path>` | Tessdata directory; missing files still download |
85| `--max-pages <n>` | Max pages per file (default: 1000) |
86| `--dpi <dpi>` | Rendering DPI (default: 150) |
87| `--recursive` | Recurse into subdirectories |
88| `--extension <ext>` | Only files with extension (e.g. `.pdf`) |
89| `--password <password>` | Password for encrypted documents |
90| `--num-workers <n>` | Concurrent OCR workers |
91| `-q, --quiet` | Suppress progress |
92| `-h, --help` | Help |

lit batch-parse

Parse every supported file in a directory.

lit batch-parse [OPTIONS] <input-dir> <output-dir>
OptionDescription
--format <format>json, text, or markdown (default: text)
--no-ocrDisable OCR
--ocr-language <lang>Tesseract language (default: eng)
--ocr-server-url <url>Complete HTTP OCR endpoint URL
--ocr-server-header <header>Repeatable Name: Value header for HTTP OCR
--tessdata-path <path>Tessdata directory; missing files still download
--max-pages <n>Max pages per file (default: 1000)
--dpi <dpi>Rendering DPI (default: 150)
--recursiveRecurse into subdirectories
--extension <ext>Only files with extension (e.g. .pdf)
--password <password>Password for encrypted documents
--num-workers <n>Concurrent OCR workers
-q, --quietSuppress progress
-h, --helpHelp
Raw lines 69 to 93
94### Examples
96```bash
97lit batch-parse ./papers ./parsed
98lit batch-parse ./papers ./parsed --format json --recursive
99lit batch-parse ./pdfs ./out --extension .pdf --no-ocr
100```
102Output paths mirror relative input directories with `.txt`, `.json`, or `.md` replacing the input extension. Same-stem files in the same directory can overwrite each other; restrict `--extension .pdf` or use the bundled wrapper, which preserves source suffixes and refuses existing outputs.
104---

Examples

lit batch-parse ./papers ./parsed
lit batch-parse ./papers ./parsed --format json --recursive
lit batch-parse ./pdfs ./out --extension .pdf --no-ocr

Output paths mirror relative input directories with .txt, .json, or .md replacing the input extension. Same-stem files in the same directory can overwrite each other; restrict --extension .pdf or use the bundled wrapper, which preserves source suffixes and refuses existing outputs.


Raw lines 94 to 105
106## `lit screenshot`
108Render pages to PNG files.
110```
111lit screenshot [OPTIONS] <file>
112```
114| Option | Description |
115|--------|-------------|
116| `-o, --output-dir <dir>` | Output directory (default: `./screenshots`) |
117| `--target-pages <pages>` | Pages to render (e.g. `1,3,5` or `1-5`) |
118| `--dpi <dpi>` | Rendering DPI (default: 150) |
119| `--password <password>` | Encrypted document password |
120| `-q, --quiet` | Suppress progress |
121| `-h, --help` | Help |

lit screenshot

Render pages to PNG files.

lit screenshot [OPTIONS] <file>
OptionDescription
-o, --output-dir <dir>Output directory (default: ./screenshots)
--target-pages <pages>Pages to render (e.g. 1,3,5 or 1-5)
--dpi <dpi>Rendering DPI (default: 150)
--password <password>Encrypted document password
-q, --quietSuppress progress
-h, --helpHelp
Raw lines 106 to 122
123### Examples
125```bash
126lit screenshot document.pdf -o ./screenshots
127lit screenshot document.pdf --target-pages "1,3,5" --dpi 300
128```
130---

Examples

lit screenshot document.pdf -o ./screenshots
lit screenshot document.pdf --target-pages "1,3,5" --dpi 300

Raw lines 123 to 131
132## Environment variables
134| Variable | Description |
135|----------|-------------|
136| `TESSDATA_PREFIX` | Directory containing Tesseract `.traineddata` files (offline/air-gapped) |
138Reviewed 2026-10-01 against [2.15.0 Python CLI source](https://github.com/run-llama/liteparse/blob/d3a79177b9e9e570f8c2d9878ace601445fdaf76/crates/liteparse-python/src/cli.rs) and installed help/output. Native CLI JSON uses `pages[].page` and has no top-level `text`; see `output_formats.md`.

Environment variables

VariableDescription
TESSDATA_PREFIXDirectory containing Tesseract .traineddata files (offline/air-gapped)

Reviewed 2026-10-01 against 2.15.0 Python CLI source and installed help/output. Native CLI JSON uses pages[].page and has no top-level text; see output_formats.md.

Raw lines 132 to 138