Skip to main content
The Reducto CLI gives you direct terminal access to Reducto’s document capabilities: parse, extract, split, classify, and edit. Use it for batch processing, scripting, CI/CD pipelines, and quick operations without writing application code.

Fast path for coding agents

Use the CLI when the document is already on disk or when an agent needs a terminal-first workflow. It avoids writing upload code and produces Markdown files that agents can read directly.
For a local file:
For a directory:
The CLI writes <filename>.parse.md next to each input file. For agent tool calling instead of terminal commands, use the MCP server.

Installation

Install the Reducto CLI using pip:

Authentication

Before using the CLI, authenticate by running:
This command opens Reducto Studio in your browser, where you can securely authenticate your CLI session.

Quick Examples

Parsed outputs are written as <filename>.parse.md. Extraction reuses existing parses when possible and saves <filename>.extract.json containing only the payload.

Supported File Types

The CLI supports the same file types as the Reducto API: Commands accept either a file or a directory. Directories are scanned recursively, and only supported file types are processed.

Parse Command

The parse command converts documents into structured markdown output.

Flags

Examples

Extract Command

The extract command pulls structured data from documents according to a JSON Schema you provide. It automates information extraction by mapping complex or unstructured documents into machine-readable JSON.

Common Use Cases

  • Extracting line items, totals, vendor/customer info from invoices and receipts
  • Pulling key fields, tables, or sections from contracts or legal documents
  • Capturing form field values from scanned forms or applications
  • Summarizing structured results from reports, statements, or medical records

Schema Guidelines

  • Schemas must be valid JSON Schema documents
  • The top-level schema must be an object ({"type": "object", ...}) — inline strings or arrays are not permitted
  • Provide explicit property definitions so the extractor can map fields deterministically
  • Schemas may be supplied as file paths or inline JSON strings

Example Schema

You can reuse parses across multiple extractions: the CLI automatically detects existing .parse.md files, rehydrates the recorded job ID, and uses jobid://<id> references to accelerate extraction jobs.

Edit Command

The edit command modifies documents using natural language instructions. It uploads the document, applies the specified edits, and downloads the resulting file.

Usage

Parameters

Output

Edited files are saved alongside the original with the naming pattern <filename>.edited.<extension>. For example:
  • invoice.pdf becomes invoice.edited.pdf
  • report.docx becomes report.edited.docx

Examples

Tips for Effective Instructions

For best results with the --instructions flag:
  • Be specific about what content to modify and how
  • Reference specific elements (headers, footers, tables, specific text)
  • Describe the desired outcome clearly
  • For bulk operations on directories, ensure instructions apply uniformly to all file types

Next Steps

API Quickstart

Learn to use the Reducto API directly for more advanced integrations.

Parse Options

Explore all available parsing configurations.

Extract Overview

Deep dive into structured data extraction.

Edit Overview

Learn more about document editing capabilities.