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

# Chatbase CLI

> Install and use the official Chatbase CLI to manage AI agents, sources, conversations, helpdesk, and WhatsApp from your terminal or CI.

The Chatbase CLI is the official command-line client for the [Chatbase API v2](https://chatbase.co/docs/api-reference/v2/overview.md). Use it to manage AI agents, knowledge sources, conversations, helpdesk tickets, and WhatsApp templates from your terminal or CI pipelines.

> [!NOTE]
>
> Requires **Node.js 20+**. Interactive login uses your Chatbase account in the browser (`chatbase auth login --browser`). API keys (Basic plan or higher) work for paste-login and CI — create them in **Workspace settings → API keys**.

## Install

```bash theme={null}
npm install -g chatbase
```

Or run without installing:

```bash theme={null}
npx chatbase <command>
```

Check the version:

```bash theme={null}
chatbase --version
```

## Quick start

**1. Authenticate in the browser**

```bash theme={null}
chatbase auth login --browser
```

This opens a browser window and shows a short code. Approve the code at [chatbase.co/activate](https://www.chatbase.co/activate). The CLI stores the credential for later commands.

Prefer pasting an API key instead? Run `chatbase auth login` and paste a key from **Workspace settings → API keys**. See [CLI Auth](https://chatbase.co/docs/cli/auth.md) for all login options.

**2. List your AI agents**

```bash theme={null}
chatbase agents list
```

**3. Send a message**

```bash theme={null}
chatbase chat -a agt_123 -m "How do I reset my password?"
```

## Authenticate in CI

In non-interactive environments, set an API key in the environment instead of running `auth login`:

```bash theme={null}
export CHATBASE_API_KEY=cb_...
chatbase agents list
```

Optionally pin a default agent:

```bash theme={null}
export CHATBASE_AGENT_ID=agt_123
# or
chatbase config set agent agt_123
```

> [!WARNING]
>
> Never commit API keys. Prefer secrets managers or CI secret stores.

## Global output flags

Most commands support:

| Flag | Purpose |
| - | - |
| `--json` | Raw API JSON |
| `--plain` | Tab-separated output for scripts |
| `--quiet` / `-q` | Suppress non-essential output |
| `--verbose` | Verbose diagnostics |
| `--no-input` | Never prompt; fail instead |
| `--no-color` | Disable colored output |

## Privacy

The CLI sends no telemetry. Requests include a `chatbase-cli/<version>` User-Agent so Chatbase can distinguish CLI traffic. The only network calls are the API calls you invoke.

## Commands

> **[Auth](https://chatbase.co/docs/cli/auth.md)**
>
> Log in, log out, and inspect credentials.

> **[Agents](https://chatbase.co/docs/cli/agents.md)**
>
> Create, update, train, clone, and delete AI agents.

> **[Sources](https://chatbase.co/docs/cli/sources.md)**
>
> Manage knowledge sources (text, Q\&A, links, files).

> **[Chat](https://chatbase.co/docs/cli/chat.md)**
>
> Send messages and stream responses.

> **[Conversations](https://chatbase.co/docs/cli/conversations.md)**
>
> List, inspect, and export conversations.

> **[Tickets](https://chatbase.co/docs/cli/tickets.md)**
>
> Manage helpdesk tickets and lookups.

> **[WhatsApp](https://chatbase.co/docs/cli/whatsapp.md)**
>
> List templates and send template messages.

> **[Config](https://chatbase.co/docs/cli/config.md)**
>
> Set default agent and timeout.

> **[API](https://chatbase.co/docs/cli/api.md)**
>
> Call any API v2 endpoint directly.

> **[Health](https://chatbase.co/docs/cli/health.md)**
>
> Check that the API is reachable.

## Uninstall

```bash theme={null}
npm uninstall -g chatbase
rm -rf ~/.config/chatbase ~/.local/state/chatbase ~/.cache/chatbase
rm -rf ~/Library/Caches/chatbase   # macOS: update-check cache
```

> [!TIP]
>
> For every flag on a command, run `chatbase <command> --help`.


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