> This page is for version v2026-02-09 (default).
> For other versions, use one of these documentation indexes:
> - v2026-02-09 (default): https://docs.extend.ai/2026-02-09/llms.txt
> - v2025-04-21: https://docs.extend.ai/2025-04-21/llms.txt
> - v2024-12-23: https://docs.extend.ai/2024-12-23/llms.txt

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.extend.ai/llms.txt
> Use this file to discover all available pages before exploring further.
>
> ## API version
> The current API version is `2026-02-09`, served at the site root (no version prefix in URLs).
> If this page URL contains `/2025-04-21/` or `/2024-12-23/`, you are reading an older API version.
> Prefer the current docs at https://docs.extend.ai/llms.txt unless the user explicitly needs that older version.
> Do not treat older-version pages as the source of truth for new integrations.

# CLI

> Run Extend from your terminal: parse, extract, classify, split, and edit documents without writing code.

The `extend` CLI gives you direct terminal access to Extend's document operations: parse, extract, classify, split, edit, and run workflows. Reach for it for quick one-off jobs, batch processing, scripting, and CI/CD pipelines. No application code required.

> **Note**
>
> Building a durable integration in your own codebase? Use an [SDK](/sdks) (Python, TypeScript, Java, Go) instead. They ship typed clients, polling helpers, and webhook verification.

## Installation

#### Install script

```bash
curl -fsSL https://extend.ai/install.sh | sh
```

Works on macOS and Linux. The script verifies the release checksum and installs to a directory already on your `PATH`; see its options with `curl -fsSL https://extend.ai/install.sh | sh -s -- --help`.

#### Homebrew

```bash
brew install extend-hq/tap/extend
```

#### npm

```bash
npm install -g @extend-ai/cli
```

#### Go

```bash
go install github.com/extend-hq/extend-cli/cmd/extend@latest
```

You can also download a signed binary from the [releases page](https://github.com/extend-hq/extend-cli/releases). Confirm the install with `extend --version`.

> **Note**
>
> The CLI's npm package is **`@extend-ai/cli`**, not to be confused with **`extend-ai`**, which is the JavaScript/TypeScript [SDK](/sdks). Install `@extend-ai/cli` for the `extend` command, and `extend-ai` for the typed client library.

## Setup

The fastest way to get configured is the setup wizard:

```bash
extend setup
```

It asks how you want to sign in (through your browser with no API key, or with an API key), picks your region, walks you through the rest, and installs the [agent skill](#agent-skill). Everything it does can also be configured by hand, as described below.

## Authentication

The CLI accepts two kinds of credentials:

* **Browser login** (`extend setup`, or `extend login` directly) is best on your own machine: nothing to create or copy, tokens are stored securely and refresh on their own, and the session is scoped to the workspaces and environments you approve. `extend logout` revokes it.
* **API keys** are long-lived and headless, the right choice for scripts, CI, and agents. Save one with `extend setup`, or grab a key from the [Developers](https://dashboard.extend.ai/developers) page and set environment variables directly:

```bash
export EXTEND_API_KEY="sk_xxx"
export EXTEND_REGION="us"             # us | us2 | eu (default: us)
export EXTEND_WORKSPACE_ID="ws_xxx"   # for organization-scoped keys
```

When several sources are configured, `EXTEND_API_KEY` wins (or `EXTEND_<LABEL>_API_KEY` under `--env <label>`), then the API key saved by `extend setup`, then the stored `extend login` session.

Check who you're signed in as with `extend whoami` (or `extend config` for the full picture), and verify the connection with a read-only command that spends no credits:

```bash
extend extractors list
```

For token storage details and troubleshooting, run `extend help auth`.

## Quick examples

```bash
# Parse a document to clean markdown
extend parse invoice.pdf > invoice.md

# Extract fields with an inline schema
extend extract invoice.pdf --config '{"baseProcessor":"extraction_performance","schema":{"type":"object","properties":{"total":{"type":["number","null"]}}}}'

# Extract, classify, or split using a saved processor
extend extract invoice.pdf --using ex_abc
extend classify invoice.pdf --using cl_abc
extend split combined.pdf --using spl_abc

# Run a workflow, then watch it to completion
RUN=$(extend workflows run doc.pdf --using workflow_abc -o id)
extend workflows runs watch "$RUN"

# Process a whole folder
extend extract batch invoices/*.pdf --using ex_abc
```

Every command takes an `<input>`: a local file path (uploaded for you), an Extend `file_xxx` ID, or a publicly reachable `https://` URL, across [35+ file types](/general/supported-file-types). Results are written to stdout, so redirect them to a file (`> result.json`) for anything large.

## Commands

### parse

Convert a document into clean markdown chunks. No configuration required.

| Flag               | Description                                              |
| ------------------ | -------------------------------------------------------- |
| `--chunk-strategy` | How to segment output: `page`, `section`, or `document`. |

```bash
extend parse contract.pdf > contract.md
extend parse contract.pdf -o json
```

### extract

Pull structured data into JSON. Pass an inline `--config` for prototyping, or reference a saved [extractor](/evaluation/processors) with `--using` and tweak a single run with `--patch`.

```bash
# Inline config (a baseProcessor plus a JSON schema)
extend extract invoice.pdf --config "$(cat config.json)"

# Saved extractor, with optional per-run overrides
extend extract invoice.pdf --using ex_abc
extend extract invoice.pdf --using ex_abc --patch tweaks.json
```

> **Tip**
>
> Schemas validate strictly and every field must be nullable. Keep yours in a file so each fix is incremental, and see the [schema reference](/extraction/schema#custom-field-types) for custom field types like dates and currency.

### classify

Label a document's type using a saved classifier.

```bash
extend classify document.pdf --using cl_abc
```

### split

Break a multi-document bundle into segments using a saved splitter.

```bash
extend split combined.pdf --using spl_abc
```

### edit

Fill a PDF form's fields and get back a filled PDF. Use natural-language `--instructions` for quick fills, or scaffold a schema with `detect-form` for repeatable, structured fills.

```bash
# Natural-language fill
extend edit form.pdf --instructions "name is Acme Corp; date is 2026-04-15"

# Structured fill: scaffold a schema, populate its values, then apply it
extend detect-form form.pdf --jq '.output.schema' -o json > schema.json
extend edit form.pdf --schema schema.json --output-file filled.pdf
```

### detect-form

Detect a PDF's form fields and scaffold an edit schema you can hand-edit and pass to `extend edit --schema`. The command waits for the form detection run by default and prints it with the generated schema under `output.schema`; pass `--wait=false` to detach and follow up with `extend detect-form runs get|watch <id>`.

```bash
extend detect-form form.pdf --instructions "skip the signature block"
```

### workflows run

Run a saved workflow, a multi-step pipeline that chains the operations above.

```bash
RUN=$(extend workflows run doc.pdf --using workflow_abc -o id)
extend workflows runs watch "$RUN"
```

### batch

Add `batch` to any processing command to run across many files at once (`extend workflows run batch` for workflows).

```bash
extend parse batch ./docs/*.pdf
extend extract batch invoices/*.pdf --using ex_abc --files-from list.txt
```

## Managing resources

Beyond processing, the CLI inspects runs and manages the resources behind them. Run commands live under the verb that produced the run, so an ID's prefix tells you where to look (`exr_` is `extract runs`, `pr_` is `parse runs`, and so on):

```text
<verb> runs   get | list | watch | cancel | delete   # extract, parse, classify, split, edit, detect-form, workflows
<verb> batches  get | watch                          # batch status for extract, parse, classify, split
files         upload | list | get | delete | download
extractors    list | get | create | update | versions ...   # also classifiers, splitters, workflows
evaluations   list | get | create   (items, runs as subcommands)
webhooks      endpoints | subscriptions | verify
```

Not every kind supports every operation: parse and edit runs cannot be cancelled, edit runs cannot be listed, form detection runs support only `get` and `watch`, and only workflow runs support `update`. Workflow batches have no status endpoint; track them with `extend workflows runs list --batch <id>`.

Create a saved extractor without leaving the terminal:

```bash
echo '{"config":{"baseProcessor":"extraction_performance","schema":{"type":"object","properties":{"invoice_id":{"type":["string","null"]}}}}}' \
  | extend extractors create --name "Invoices" --from-file - -o id
```

Run `extend <command> --help` for the full flag list on any command, and see the [CLI on GitHub](https://github.com/extend-hq/extend-cli) for the complete reference.

## Output and scripting

* **`-o <format>`**: `json`, `yaml`, `raw`, `id`, `table`, or `markdown`.
* **`--jq '<expr>'`**: filter structured results with the built-in jq, e.g. `--jq '.output.value.invoice_id' -o raw` (no separate `jq` install needed).

Data goes to stdout and status to stderr, so you can pipe results cleanly. The CLI honors `NO_COLOR` and `CLICOLOR_FORCE`.

## Agent skill

The CLI can describe itself to coding agents as an installable skill: a `SKILL.md` (following the [agentskills.io](https://agentskills.io) standard) that teaches harnesses like Claude Code, Codex, Cursor, OpenCode, and Goose how to drive `extend` correctly. `extend setup` installs it for you; to install or refresh it directly:

```bash
extend skill install
```

This writes `~/.agents/skills/extend-cli/SKILL.md`, the path Codex, OpenCode, Cursor, and most other harnesses read, and symlinks it into `~/.claude/skills/extend-cli` for Claude Code. To scope the skill to one project instead of your whole machine:

```bash
extend skill install --target ./.agents/skills/extend-cli/SKILL.md
```

Or print it to stdout to redirect anywhere with `extend skill > SKILL.md`. The skill is generated from the CLI's own command tree, so re-run `extend skill install` after upgrading to pick up new commands and flag changes. For the full agent setup, including the MCP server and the platform context file for writing SDK code, see the [Agent Quickstart](/agent-quickstart).

> **Warning**
>
> The CLI is under active development. Commands, flags, and output formats may change. If you depend on a specific output shape (for example in CI), pin to a specific [release tag](https://github.com/extend-hq/extend-cli/releases).

## Next steps

#### [Agent Quickstart](/agent-quickstart)

Set up a coding agent to drive Extend, including the installable CLI skill.

#### [SDKs](/sdks)

Build durable integrations in Python, TypeScript, Java, or Go.

#### [MCP Server](/mcp)

Give chat and tool-calling clients the whole platform as MCP tools.

#### [API Quickstart](/api-quickstart)

Call the Extend API directly for more advanced integrations.