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

# CLI

> Manage your Bota project from the terminal

The Bota CLI lets you manage end users, devices, recordings, and webhooks directly from your terminal. It also bundles an MCP server so one install covers both human and AI workflows.

```bash theme={null}
npm install -g @bota.dev/cli
```

***

## Authentication

### Browser login (recommended)

```bash theme={null}
bota auth login
```

Opens your browser to the Bota dashboard, where you select a project and click **Authorize**. The CLI saves a secret API key to `~/.bota/config.json` automatically.

### Headless / CI

```bash theme={null}
bota auth login sk_live_...
```

Pass your API key directly — no browser required. Useful in CI environments.

### Check status

```bash theme={null}
bota auth status
```

Shows the active key and confirms it's valid against the API.

### Logout

```bash theme={null}
bota auth logout
```

Removes the saved key from `~/.bota/config.json`.

***

## Commands

### End Users

```bash theme={null}
bota end-users list
bota end-users get <id>
bota end-users create --name "Jane Smith" --email jane@example.com --external-id user_123

# MCP tokens
bota end-users token <id>           # Issue a user token (shown once)
bota end-users token-revoke <id>    # Revoke the token
```

### Devices

```bash theme={null}
bota devices list
bota devices get <id>
bota devices inspect <id>           # Detailed view with battery, connectivity, last heartbeat
```

### Recordings

```bash theme={null}
bota recordings list
bota recordings list --end-user-id eu_abc123
bota recordings get <id>
```

### Webhooks

```bash theme={null}
bota webhooks list
bota webhooks get <id>
```

### Webhook forwarding

Forward live webhook events to a local server — useful during integration development:

```bash theme={null}
bota listen --forward-to http://localhost:3000/webhook
```

### Trigger test events

Fire a test webhook event without needing real device activity:

```bash theme={null}
bota trigger recording.uploaded
bota trigger transcription.completed
```

### MCP server (stdio)

Expose all CLI commands as MCP tools for AI assistants that support stdio transport:

```bash theme={null}
bota mcp
```

Add to Claude Code:

```bash theme={null}
claude mcp add bota -- bota mcp
```

***

## Global flags

| Flag                    | Description                                                 |
| :---------------------- | :---------------------------------------------------------- |
| `--api-url <url>`       | Override the API base URL (default: `https://api.bota.dev`) |
| `--dashboard-url <url>` | Override the portal URL used for browser login              |
| `--json`                | Output raw JSON instead of formatted tables                 |

### Example: point at a different environment

```bash theme={null}
bota --api-url https://api.dev.bota.dev end-users list
```

***

## Output formats

By default the CLI prints human-readable tables. Add `--json` to get raw JSON for scripting:

```bash theme={null}
bota end-users list --json | jq '.data[].id'
```

***

## Configuration file

Credentials are stored in `~/.bota/config.json`:

```json theme={null}
{
  "apiKey": "sk_live_...",
  "apiUrl": "https://api.bota.dev"
}

```

`apiUrl` is only written when using a non-default environment. You can also use environment variables instead of the config file:

```bash theme={null}
export BOTA_API_KEY=sk_live_...
export BOTA_API_URL=https://api.bota.dev
```
