CLI

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.

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

Installation

$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.

You can also download a signed binary from the releases page. Confirm the install with extend --version.

The CLI’s npm package is @extend-ai/cli, not to be confused with extend-ai, which is the JavaScript/TypeScript SDK. 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:

$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. 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 page and set environment variables directly:
$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:

$extend extractors list

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

Quick examples

$# 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. 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.

FlagDescription
--chunk-strategyHow to segment output: page, section, or document.
$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 with --using and tweak a single run with --patch.

$# 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

Schemas validate strictly and every field must be nullable. Keep yours in a file so each fix is incremental, and see the schema reference for custom field types like dates and currency.

classify

Label a document’s type using a saved classifier.

$extend classify document.pdf --using cl_abc

split

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

$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.

$# 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>.

$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.

$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).

$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):

<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:

$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 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 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:

$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:

$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.

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.

Next steps