> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runpulse.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI

> Extract, structure, split, and pull tables from documents without leaving your terminal.

> One command from a PDF to clean markdown and structured JSON: `pulse extract invoice.pdf --schema invoice.json`

The **Pulse CLI** brings the full extraction pipeline to your terminal. It talks to the
same API as the platform and the MCP server, so your API key is the only credential, and
anything you run is visible in your [platform](https://platform.runpulse.com) extraction
library.

```bash theme={null}
uv tool install pulse-ai-cli
pulse login
pulse extract report.pdf
```

<CardGroup cols={2}>
  <Card title="Command reference" icon="terminal" href="/cli/commands">
    Every command, flag, and workflow with examples.
  </Card>

  <Card title="Get an API key" icon="key" href="https://platform.runpulse.com">
    Or skip it: `pulse login` fetches one through your browser.
  </Card>
</CardGroup>

***

## Install

<CodeGroup>
  ```bash uv theme={null}
  uv tool install pulse-ai-cli
  ```

  ```bash pip theme={null}
  pip install pulse-ai-cli
  ```
</CodeGroup>

Installs the `pulse` command. Requires Python 3.11+.

## Log in

```bash theme={null}
pulse login
```

Your browser opens the Pulse platform, you approve a short code (like `ABCD-1234`), and
the CLI picks up your organization's API key automatically. The key is validated and
stored in your OS keychain.

No browser handy? Use the key directly:

```bash theme={null}
pulse login --api-key sk_your_key_here
```

For CI and scripts, set `PULSE_API_KEY` in the environment instead; it takes precedence
over the stored credential, and `--api-key` on any command beats both.

## Sixty-second tour

```bash theme={null}
# Document in, markdown + JSON out (report.pulse.md / report.pulse.json)
pulse extract report.pdf

# Add a schema and get structured fields in the same run
pulse extract invoice.pdf --schema schemas/invoice.json

# No schema yet? Describe the fields and let Pulse draft one
pulse schema generate -p "vendor, line items, total due" -o schemas/invoice.json

# Whole folder, async; come back for results later
pulse extract ./contracts --no-wait
pulse jobs get <job_id> --watch

# Follow-ups reuse the extraction_id printed by extract
pulse tables <extraction_id>
pulse split <extraction_id> -t "financials:tables and figures"

# Check your plan and page usage
pulse usage
```

Every command takes `--json` for raw, pipe-safe output and `-h` for its full options.
Running bare `pulse` starts an interactive shell with the same commands.

## Commands at a glance

| Command                             | What it does                                                                                         |
| ----------------------------------- | ---------------------------------------------------------------------------------------------------- |
| `pulse extract`                     | Documents (files, folders, URLs) to markdown and JSON; `--schema` adds structured output in one run. |
| `pulse schema generate`             | AI-draft or refine a JSON extraction schema from a prompt.                                           |
| `pulse schema apply`                | Run a schema against a prior extraction or split.                                                    |
| `pulse split`                       | Split a prior extraction into topic-based page ranges.                                               |
| `pulse tables`                      | Pull tables (HTML or JSON) out of a prior extraction.                                                |
| `pulse jobs`                        | Watch, resume, or cancel async jobs.                                                                 |
| `pulse usage`                       | Plan, pages used vs. allowance, and a breakdown by source.                                           |
| `pulse open`                        | Open an extraction (or the dashboard) on the platform.                                               |
| `pulse whoami` / `login` / `logout` | Manage the stored credential.                                                                        |

See the [command reference](/cli/commands) for full flags and examples.

***

## When to use the CLI

<CardGroup cols={2}>
  <Card title="Use the CLI" icon="terminal">
    You're working **hands-on in a terminal**: one-off extractions, local files and
    folders, shell scripts, cron jobs, and CI steps where `--json` pipes straight into
    `jq` or the next tool.
  </Card>

  <Card title="Use the MCP server" icon="robot" href="/mcp/overview">
    You want an **AI agent** (Claude, Codex, VS Code) to read and structure documents on
    demand, deciding the steps itself.
  </Card>

  <Card title="Use the SDK / API" icon="code" href="/quickstart">
    You're building a **production pipeline** in your own application code with precise,
    repeatable control.
  </Card>

  <Card title="Use the Platform" icon="browser" href="/platform-reference/introduction">
    You want a **visual workspace** to iterate on schemas, presets, and pipelines before
    automating them.
  </Card>
</CardGroup>

***

## Next steps

<CardGroup cols={2}>
  <Card title="Command reference" icon="terminal" href="/cli/commands">
    Full flags, workflows, output conventions, and troubleshooting.
  </Card>

  <Card title="Structured output guidelines" icon="brackets-curly" href="/api-reference/structured-output-guidelines">
    Write schemas that extract reliably.
  </Card>
</CardGroup>
