---
title: "Extend CLI for AI Agents | Extend"
description: "Install the extend command and the extend-cli skill so coding agents can parse, extract, classify, split, and edit documents from the shell."
canonical: https://www.extend.ai/agents/cli
---

# Extend CLI for AI Agents | Extend

[Agents](https://www.extend.ai/agents) / Integration path

## Drive Extend from the shell

Install the extend command, run the setup wizard, and your agent gets every processor plus an installable skill generated from the CLI's own command tree.

### Install and set up

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

[Full docs](https://docs.extend.ai/cli)

## What extend setup does

- **Signs you in** — Through your browser with no API key, or with an API key for headless use.
- **Picks your region** — US1, US2, or EU1. Everything else can be configured by hand.
- **Installs the extend-cli skill** — Writes ~/.agents/skills/extend-cli/SKILL.md, the path Codex, OpenCode, Cursor, and most harnesses read, and symlinks it into ~/.claude/skills/extend-cli for Claude Code.

### Other install options

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

## Headless, CI, and remote agent boxes

Skip the wizard. Export a key from the Developers dashboard and install the skill directly. The skill is generated from the installed CLI, so re-run the install after upgrading.

### Machine-wide

```bash
export EXTEND_API_KEY="sk_xxx"
extend skill install
```

### One project

```bash
export EXTEND_API_KEY="sk_xxx"
extend skill install --target ./.agents/skills/extend-cli/SKILL.md
```

[Developers dashboard](https://dashboard.extend.ai/developers)

## Verify the setup

Ask your agent to run a read-only command that spends no credits. A clean list back means the key, the CLI, and the connection all work.

```bash
extend extractors list
```

## What agents do with it

Every command takes a local file path, an Extend file ID, or a public URL across 35+ file types. Results go to stdout; status goes to stderr.

### Parse a file

```bash
extend parse invoice.pdf > invoice.md
```

### Run an extractor

```bash
extend extract invoice.pdf --using ex_abc
```

### Batch a folder

```bash
extend extract batch invoices/*.pdf --using ex_abc
```

### Watch a workflow

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

## Frequently asked questions

### Where does the extend-cli skill install, and can I scope it to one project?

extend setup and extend skill install write ~/.agents/skills/extend-cli/SKILL.md, the path Codex, OpenCode, Cursor, and most other harnesses read, and symlink it into ~/.claude/skills/extend-cli for Claude Code. Pass --target ./.agents/skills/extend-cli/SKILL.md to scope it to one project instead.

### Should I sign in through the browser or use an API key?

Browser login (extend setup or extend login) is best on your own machine: tokens are stored securely, refresh on their own, and are scoped to the workspaces and environments you approve. API keys are long-lived and headless, the right choice for scripts, CI, and agents. When both are configured, EXTEND_API_KEY wins.

### How do I pick a region?

extend setup asks for one. Headless, set EXTEND_REGION to us, us2, or eu (default: us). Set EXTEND_WORKSPACE_ID for organization-scoped keys.

## Other ways to connect

### [MCP server](https://www.extend.ai/agents/mcp)

- **If your agent** If your agent calls tools from chat (Cursor, Claude, ChatGPT, and other MCP clients)
- **Give it** The hosted MCP server. OAuth sign-in, nothing to install.

### [SDK and extend-api skill](https://www.extend.ai/agents/sdk)

- **If your agent** If your agent writes durable integration code with an SDK
- **Give it** The extend-api context file plus the Python, TypeScript, Java, or Go SDK.
