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

# CLI Overview

> The cast command-line interface

# CLI Overview

The `cast` CLI is the fastest way to deploy and manage agents on Castari.

## Installation

```bash theme={null}
npm install -g @castari/cli
```

## Commands

| Command                                                      | Description                        |
| ------------------------------------------------------------ | ---------------------------------- |
| [`cast login`](/cli/login)                                   | Authenticate with Castari          |
| [`cast logout`](/cli/login#logout)                           | Clear stored credentials           |
| [`cast whoami`](/cli/whoami)                                 | Show current user                  |
| [`cast init`](/cli/init)                                     | Create a new agent from a template |
| [`cast deploy`](/cli/deploy)                                 | Deploy an agent                    |
| [`cast stop`](/cli/stop)                                     | Stop a running agent               |
| [`cast invoke`](/cli/invoke)                                 | Invoke a deployed agent            |
| [`cast agents list`](/cli/agents)                            | List all agents                    |
| [`cast agents get`](/cli/agents#cast-agents-get)             | Get agent details                  |
| [`cast agents update`](/cli/agents)                          | Update agent configuration         |
| [`cast agents delete`](/cli/agents#cast-agents-delete)       | Delete an agent                    |
| [`cast secrets list`](/cli/secrets)                          | List secrets for an agent          |
| [`cast secrets set`](/cli/secrets#cast-secrets-set)          | Set a secret                       |
| [`cast secrets delete`](/cli/secrets#cast-secrets-delete)    | Delete a secret                    |
| [`cast apikey list`](/cli/apikey)                            | List API keys                      |
| [`cast apikey create`](/cli/apikey#cast-apikey-create)       | Create a new API key               |
| [`cast apikey revoke`](/cli/apikey#cast-apikey-revoke)       | Revoke an API key                  |
| [`cast usage`](/cli/usage)                                   | Show usage statistics              |
| [`cast buckets`](/cli/buckets)                               | Manage storage buckets             |
| [`cast mounts`](/cli/mounts)                                 | Mount buckets to agents            |
| [`cast files`](/cli/files)                                   | Manage files in storage            |
| [`cast sessions list`](/cli/sessions)                        | List agent sessions                |
| [`cast sessions delete`](/cli/sessions#cast-sessions-delete) | Delete a session                   |
| [`cast invocations list`](/cli/agents)                       | List invocation history            |

## Global Options

All commands support these options:

| Option      | Description             |
| ----------- | ----------------------- |
| `--help`    | Show help for a command |
| `--version` | Show CLI version        |

## Configuration

The CLI stores configuration in `~/.castari/`:

```
~/.castari/
├── config.json      # API URL, preferences
└── credentials.json # Auth tokens (do not share!)
```

## Environment Variables

| Variable          | Description                  |
| ----------------- | ---------------------------- |
| `CASTARI_API_URL` | Override API base URL        |
| `CASTARI_API_KEY` | Use API key instead of OAuth |

## Examples

```bash theme={null}
# Full workflow
cast login
cast init my-agent
cd my-agent
cast deploy
cast invoke my-agent "Hello!"

# Check agent status
cast agents get my-agent

# Add a secret
cast secrets set my-agent OPENAI_API_KEY sk-xxx
```
