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

# Command Line Interface

> Manage your Bland account from the terminal: make calls, build and test pathways, configure phone numbers, and more.

Manage your entire Bland account from the terminal: make calls, build and test pathways, configure phone numbers, and more.

**Install via NPM:** [`bland-cli`](https://www.npmjs.com/package/bland-cli)

```bash theme={null}
# Install globally
npm install -g bland-cli

# Or run without installing
npx bland-cli
```

**Requirements:** Node.js 18+

## Getting started

```bash theme={null}
bland auth login --device
```

This starts a device-authorization flow: the CLI prints a link and a short code, you approve it in your browser, and the CLI stores the resulting API key in your profile. No key to copy and paste. See the [Agent onboarding API](https://docs.bland.ai/platform/connect-your-agent.md) for what happens behind that link.

Already have an API key? Skip straight to it:

```bash theme={null}
bland auth login --key YOUR_API_KEY
```

Or set the environment variable:

```bash theme={null}
export BLAND_API_KEY=your_key_here
```

```bash theme={null}
# Check your account
bland auth whoami

# Make an outbound call
bland call send +15551234567 --task "Ask about demo" --voice nat --wait

# List recent calls
bland call list
```

## What you can do

> [accordion] Phone Calls
>
> Make outbound calls with customizable voices, tasks, and pathways. View and analyze call history directly from the terminal.
>
> ```bash theme={null}
> bland call send +15551234567 --task "Schedule a follow-up" --voice Karen
> bland call list
> bland call get <call_id>
> bland call stop <call_id>
> bland call events <call_id>
> bland call recording <call_id>
> bland call analyze <call_id>
> ```

> [accordion] Pathways
>
> Create and manage conversational pathways as YAML files. Sync local YAML with the Bland API, run interactive tests, and automate test cases.
>
> ```bash theme={null}
> bland pathway init ./my-pathway --name "Customer Support"
> bland pathway push ./my-pathway
> bland pathway pull <id> ./my-pathway
> bland pathway diff ./my-pathway
> bland pathway validate ./my-pathway
> bland pathway watch ./my-pathway
> bland pathway list
> bland pathway get <id>
> bland pathway create
> bland pathway chat <id> --verbose
> bland pathway test <id>
> bland pathway simulate <id>
> bland pathway promote <id>
> bland pathway versions <id>
> bland pathway generate --description "..."
> ```

> [accordion] Phone Numbers
>
> Purchase, configure, and release phone numbers from your terminal.
>
> ```bash theme={null}
> bland number list
> bland number buy --area-code 415
> bland number release <number>
> bland number update <number>
> bland number configure <number>
> ```

> [accordion] Voices
>
> Browse available voices and synthesize audio samples.
>
> ```bash theme={null}
> bland voice list
> bland voice speak "Hello there" --voice nat -o hello.mp3
> ```

> [accordion] Personas
>
> Create and manage personas for your agents, including versioning and knowledge gap tracking.
>
> ```bash theme={null}
> bland persona list
> bland persona get <id>
> bland persona create
> bland persona update <id>
> bland persona delete <id>
> bland persona promote <id>
> bland persona reset-draft <id>
> bland persona gaps <id>
> ```

> [accordion] Tools
>
> Create and manage custom tools that your agents can call during conversations.
>
> ```bash theme={null}
> bland tool list
> bland tool get <id>
> bland tool create
> bland tool update <id>
> bland tool delete <id>
> bland tool test <id> --input '{"key": "value"}'
> ```

> [accordion] Knowledge Bases
>
> Create and manage knowledge base items, including populating them via web scraping.
>
> ```bash theme={null}
> bland knowledge list
> bland knowledge create <name>
> bland knowledge scrape <name> --urls https://example.com
> bland knowledge status <id>
> bland knowledge delete <id>
> ```

> [accordion] Batch Campaigns
>
> Automate large-scale outbound call campaigns.
>
> ```bash theme={null}
> bland batch create --file contacts.csv --pathway <id>
> bland batch list
> bland batch get <id>
> bland batch stop <id>
> ```

> [accordion] SMS \[Enterprise]
>
> Send and manage SMS conversations through the CLI.
>
> ```bash theme={null}
> bland sms send +15551234567 --message "Hello!"
> bland sms conversations
> bland sms get <id>
> ```

> [accordion] Agents
>
> Manage web agents.
>
> ```bash theme={null}
> bland agent list
> bland agent get <id>
> bland agent create
> bland agent update <id>
> bland agent delete <id>
> ```

> [accordion] Guard Rails
>
> Configure guard rails for your agents.
>
> ```bash theme={null}
> bland guard list
> bland guard create
> bland guard delete <id>
> ```

> [accordion] Monitoring & Secrets
>
> Set up monitoring alarms and manage secrets.
>
> ```bash theme={null}
> bland alarm list
> bland alarm create
> bland alarm delete <id>
>
> bland secret list
> bland secret set
> bland secret delete <name>
> ```

> [accordion] Releases & Widgets
>
> Manage releases and embeddable widgets.
>
> ```bash theme={null}
> bland release list
> bland release create
> bland release promote <id>
>
> bland widget list
> bland widget create
> bland widget delete <id>
> ```

> [accordion] Audio & SIP
>
> Generate TTS audio, analyze audio files, and manage SIP endpoints.
>
> ```bash theme={null}
> bland audio generate <text> --voice nat -o output.mp3
> bland audio analyze <file>
> bland sip discover <host>
> ```

> [accordion] Evaluations
>
> Run and manage automated pathway test cases.
>
> ```bash theme={null}
> bland eval run <pathway_id>
> bland eval list
> bland eval get <id>
> bland eval add <pathway_id>
> ```

## Local Webhook Development

Forward Bland webhooks to your local dev server without ngrok:

```bash theme={null}
# Terminal 1: your app
node server.js

# Terminal 2: bland webhook forwarder
bland listen --forward-to http://localhost:3000/webhook
```

## MCP Server

The CLI includes an [MCP (Model Context Protocol)](https://modelcontextprotocol.io) server, which lets AI coding tools like Claude Code and Cursor interact with your Bland account through natural language.

> [!NOTE]
>
> **Most agents should use the hosted server instead.** Bland runs a remote MCP server at `https://api.bland.ai/v1/mcp`: nothing to install, the full toolset, and one-line setup for Claude Code, Cursor, Codex, VS Code, and other clients. Start at the [Bland MCP Server docs](https://docs.bland.ai/integrations/mcp/overview.md).
>
> The `bland mcp` command below is a **local** stdio server bundled with the CLI. Reach for it when you specifically want a local process, or when your agent has no API key yet: the local server exposes `bland_auth_login` and `bland_auth_poll`, so an agent can [onboard itself](https://docs.bland.ai/platform/connect-your-agent.md#try-it-with-a-client) and get its own key, plus a phone number if its owner starts the Agent Phone Plan.

```bash theme={null}
bland mcp

# Or with SSE transport
bland mcp --transport sse --port 3100
```

### Claude Code Setup

Add to your Claude Code config:

```json theme={null}
{
  "mcpServers": {
    "bland": {
      "command": "npx",
      "args": ["bland-cli", "mcp"]
    }
  }
}
```

Once running, AI tools can make calls, manage pathways, check your balance, and more without leaving your development environment.

## JSON Output

Every list and get command supports `--json` for piping to `jq` or scripts:

```bash theme={null}
bland pathway list --json | jq '.[].id'
bland call get <id> --json | jq '.transcripts'
bland number list --json | jq 'length'
```

## Environment Variables

| Variable | Purpose |
| - | - |
| `BLAND_API_KEY` | API key (overrides stored profile) |
| `BLAND_BASE_URL` | API base URL (default: `https://api.bland.ai`) |

## Profiles

The CLI supports multiple profiles for managing different API keys or organizations.

```bash theme={null}
bland auth login --key sk-...    # Add a profile
bland auth switch                # Switch between profiles
bland auth profiles              # List all profiles
bland auth logout                # Clear credentials
```

Profiles are stored at `~/.config/bland-cli/config.json`. You can also override the API key per-command with `BLAND_API_KEY`.

***

Docs for agents: [llms.txt](https://docs.bland.ai/llms.txt)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.