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

<AccordionGroup>
  <Accordion title="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 maya
    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>

  <Accordion title="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>

  <Accordion title="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>

  <Accordion title="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>

  <Accordion title="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>

  <Accordion title="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>

  <Accordion title="Knowledge Bases">
    Create and manage knowledge bases, 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>

  <Accordion title="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>

  <Accordion title="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>

  <Accordion title="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>

  <Accordion title="Guard Rails">
    Configure guard rails for your agents.

    ```bash theme={null}
    bland guard list
    bland guard create
    bland guard delete <id>
    ```
  </Accordion>

  <Accordion title="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>

  <Accordion title="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>

  <Accordion title="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>

  <Accordion title="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>
    ```
  </Accordion>
</AccordionGroup>

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

```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](/llms.txt)
