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

# CLI Agents

> Create, inspect, update, train, clone, and delete Chatbase agents from the terminal.

Use agent commands to manage the AI agents in your workspace. For REST details, see [Agents API](/docs/api-v2/agents). Authenticate first — see [CLI Auth](/docs/cli/auth).

## List and inspect

List every agent in the workspace:

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

Show one agent by ID:

```bash theme={null}
chatbase agents get agt_123
```

Use `--json` or `--plain` for scripting. Set a default agent with [CLI Config](/docs/cli/config) so you can omit the ID on `get` and other commands.

## Create and configure

Create a new agent:

```bash theme={null}
chatbase agents create --name "Support Bot" --instructions "Be helpful"
```

Update name, instructions, model, and other fields:

```bash theme={null}
chatbase agents update agt_123 --name "Support Bot v2"
```

Update chat widget appearance (theme, colors, etc.):

```bash theme={null}
chatbase agents styles agt_123 --data '{"chat":{"theme":"dark"}}'
```

Pass a JSON file with `@styles.json` instead of inline JSON when you have many style properties.

## Train and duplicate

Queue a training job after you add or change [sources](/docs/cli/sources):

```bash theme={null}
chatbase agents train agt_123
```

Enable automatic retraining when sources change:

```bash theme={null}
chatbase agents auto-retrain agt_123 --enabled
```

Clone an agent and its sources (Notion sources are excluded):

```bash theme={null}
chatbase agents clone agt_123
```

## Delete an agent

Permanently remove an agent:

```bash theme={null}
chatbase agents delete agt_123
```

<Warning>
  Deletion cannot be undone. In scripts and CI, pass `--confirm agt_123` to skip the interactive prompt.
</Warning>

## Commands

| Command                        | Purpose                                                      |
| ------------------------------ | ------------------------------------------------------------ |
| `chatbase agents auto-retrain` | Enable or disable automatic retraining for an agent          |
| `chatbase agents clone`        | Clone an agent, including all its sources (excluding Notion) |
| `chatbase agents create`       | Create a new agent                                           |
| `chatbase agents delete`       | Permanently delete an agent (cannot be undone)               |
| `chatbase agents get`          | Show one agent                                               |
| `chatbase agents list`         | List all agents in the workspace                             |
| `chatbase agents styles`       | Update visual styles for an agent                            |
| `chatbase agents train`        | Queue a training job for an agent                            |
| `chatbase agents update`       | Update an existing agent                                     |

<Note>
  For every flag, run `chatbase agents <command> --help`.
</Note>
