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

# CLI Reference

> All available commands for the AO CLI.

## Installation

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

## Commands

### `ao init`

Initializes AO in your current project directory. Creates an `ao.toml` configuration file if one doesn't already exist.

```bash theme={null}
ao init
```

**Example output:**
Initialized AO configuration file at: /your/project/ao.toml

***

### `ao login`

Authenticates your machine with your AO account. Opens a browser window to complete login. Your API key is stored securely in your system's keychain.

```bash theme={null}
ao login
```

***

### `ao logout`

Removes your stored API key from the system keychain.

```bash theme={null}
ao logout
```

### `ao deploy`

Zips your current project and deploys your agent to AO's infrastructure.

```bash theme={null}
ao deploy
ao deploy --env preview
```

**Options:**

| Option  | Default      | Description                                                |
| ------- | ------------ | ---------------------------------------------------------- |
| `--env` | `production` | Target environment: `production`, `preview`, `development` |

**Requirements before deploying:**

* `ao.toml` must exist (run `ao init` first)
* `requirements.txt` must exist
* `pyproject.toml` must exist

**Example output:**
Deploying agent to production...
Packing project...
Deployment successful!
You can view your new deployment at: [https://aodeploy.com/dashboard/deployments](https://aodeploy.com/dashboard/deployments)

***

### `ao run`

Triggers a run of a deployed agent. `--input` must be a valid JSON object.

```bash theme={null}
ao run --deployment <deployment-id> --input '<json>'
```

**Options:**

| Option               | Required | Description                                 |
| -------------------- | -------- | ------------------------------------------- |
| `--deployment`, `-d` | Yes      | The deployment ID to run                    |
| `--input`            | Yes      | A JSON object passed as input to your agent |

**Example:**

```bash theme={null}
ao run --deployment abc123 --input '{"messages": ["summarize last week'\''s sales data"]}'
```

***

## Global options

| Flag        | Description               |
| ----------- | ------------------------- |
| `--version` | Print the CLI version     |
| `--help`    | Show help for any command |
