Skip to content

K-Dense-AI/scientific-agent-skills / skills/liteparse

liteparse

Verified

Local document and PDF parsing that returns spatial text with bounding boxes. Use for extracting text from PDFs, DOCX, Office files, and images; running OCR on scans; producing layout-preserved JSON for RAG; batch-ingesting folders of papers; or rendering pages to PNG for multimodal agents. Distinguishing capabilities are spatial text boxes, Markdown, page raster output, and local parsing with optional custom HTTP OCR.

references/cli_reference.md

View on GitHub
# 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.

```bash
lit --help
lit parse --help
lit batch-parse --help
lit screenshot --help
```

---

## `lit parse`

Parse a single file or stdin.

```
lit parse [OPTIONS] <file>
```

| Option | Description |
|--------|-------------|
| `-o, --output <file>` | Write output to file (default: stdout) |
| `--format <format>` | `json`, `text`, or `markdown` (default: `text`) |
| `--no-ocr` | Disable 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-text` | Keep very small text |
| `--password <password>` | Encrypted document password |
| `--num-workers <n>` | Concurrent OCR workers |
| `-q, --quiet` | Suppress progress |
| `-h, --help` | Help |

### Examples

```bash
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.

## `lit batch-parse`

Parse every supported file in a directory.

```
lit batch-parse [OPTIONS] <input-dir> <output-dir>
```

| Option | Description |
|--------|-------------|
| `--format <format>` | `json`, `text`, or `markdown` (default: `text`) |
| `--no-ocr` | Disable 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) |
| `--recursive` | Recurse into subdirectories |
| `--extension <ext>` | Only files with extension (e.g. `.pdf`) |
| `--password <password>` | Password for encrypted documents |
| `--num-workers <n>` | Concurrent OCR workers |
| `-q, --quiet` | Suppress progress |
| `-h, --help` | Help |

### Examples

```bash
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.

---

## `lit screenshot`

Render pages to PNG files.

```
lit screenshot [OPTIONS] <file>
```

| Option | Description |
|--------|-------------|
| `-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, --quiet` | Suppress progress |
| `-h, --help` | Help |

### Examples

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

---

## Environment variables

| Variable | Description |
|----------|-------------|
| `TESSDATA_PREFIX` | Directory containing Tesseract `.traineddata` files (offline/air-gapped) |

Reviewed 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`.
canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall