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

# CLI

> The official Opper command for the terminal: sign in, make calls, view traces, generate images, and launch coding agents through Opper

The Opper CLI is the official `opper` command for the terminal. It gives you direct platform access to make calls, manage models, inspect traces, track usage, and generate images. It can also launch coding agents (Claude Code, Claude Desktop, OpenCode, Codex, Hermes, OpenClaw, pi) and route their inference through Opper.

## Install

```bash theme={null}
npm i -g @opperai/cli
```

Or run any command on demand without installing:

```bash theme={null}
npx @opperai/cli <command>
```

Requires Node.js ≥ 20.12.

## Quick start

```bash theme={null}
opper login              # OAuth device flow
opper whoami             # confirm the active account
opper launch claude      # launch Claude Code through Opper
```

## What you can do

| Command group                                                 | What it does                                                                                                                                                                                     |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `login` / `logout` / `whoami`                                 | OAuth device flow and account inspection.                                                                                                                                                        |
| `ask`                                                         | Ask a question grounded on the installed Opper [skills](/developer-tools/skills). Useful for "how do I…" questions about the platform, SDKs, or the CLI itself.                                  |
| `call`                                                        | Run an Opper call from the terminal, with `--model` and `--stream`.                                                                                                                              |
| `launch <agent>` / `agents list` / `agents uninstall <agent>` | Launch coding agents through Opper (Claude Code, Claude Desktop, OpenCode, Codex, Hermes, OpenClaw, pi). `agents uninstall` removes the Opper integration without uninstalling the agent itself. |
| `editors`                                                     | Wire AI code editors (OpenCode) to use Opper as a provider.                                                                                                                                      |
| `skills`                                                      | Install, update, list, or uninstall bundled Opper [skills](/developer-tools/skills).                                                                                                             |
| `models`, `traces`, `usage`                                   | Manage every Opper platform resource directly.                                                                                                                                                   |
| `image generate`                                              | Generate images from a prompt.                                                                                                                                                                   |
| `config`                                                      | Manage stored API keys and slots.                                                                                                                                                                |

For full flags on any subcommand: `opper <command> --help`. Or run `opper` with no arguments for an interactive menu.

## Launch coding agents through Opper

`opper launch <agent>` routes a coding agent through Opper. Every model call from the agent goes through your Opper account, so you get the same traces, cost tracking, and model routing.

| Agent          | Slug             | How Opper plugs in                                                                                                                                                                                      |
| -------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Claude Code    | `claude`         | `ANTHROPIC_BASE_URL` / `ANTHROPIC_AUTH_TOKEN` env vars                                                                                                                                                  |
| Claude Desktop | `claude-desktop` | writes a third-party-inference (`deploymentMode: "3p"`) profile into `~/Library/Application Support/Claude-3p/` (macOS) / `%LOCALAPPDATA%\Claude-3p\` (Windows); quits and reopens the GUI app to apply |
| OpenCode       | `opencode`       | provider block in `~/.config/opencode/opencode.json`                                                                                                                                                    |
| Codex          | `codex`          | `[model_providers.opper]` block in `~/.codex/config.toml`                                                                                                                                               |
| Hermes         | `hermes`         | isolated `HERMES_HOME=~/.opper/hermes-home/` so your real `~/.hermes/` is never touched                                                                                                                 |
| OpenClaw       | `openclaw`       | `opper` provider entry in `~/.openclaw/agents/main/agent/models.json`; defaults to running `gateway start` (background daemon)                                                                          |
| pi             | `pi`             | `opper` provider entry in `~/.pi/agent/models.json`                                                                                                                                                     |

Anything after the agent name is forwarded to the agent's CLI verbatim (Claude Desktop is GUI-only and does not accept extra arguments):

```bash theme={null}
opper launch claude -- --print "Hello"
```

To remove an agent's Opper integration without uninstalling the agent itself:

```bash theme={null}
opper agents uninstall claude-desktop   # works for any registered adapter
```

## Ask the CLI a question

`opper ask "<question>"` runs an Opper agent grounded on the locally-installed Opper [skills](/developer-tools/skills). The answer streams to your terminal, then prints token and request counts.

```bash theme={null}
opper skills install                                          # one-time
opper ask "how do I make a call?"
opper ask --model anthropic/claude-opus-4-7 "compare the v2 and v3 APIs"
```

Use `ask` to get unstuck without leaving the terminal. The model has the same skill packs available as the agents you launch through `opper launch`.

## Authentication

Auth state lives in `~/.opper/config.json` as a list of slots, each holding an API key and base URL. Use `--key <slot>` on any command to pick which slot to use.

Resolution at request time: `OPPER_API_KEY` env var > slot named by `--key` (or `default`).

```bash theme={null}
opper config add staging <api-key> --base-url https://...
opper call --key staging my-call "instructions" "input"
```

## Source and reference

<a href="https://github.com/opper-ai/cli" variant="outline">View on GitHub</a>

The repository README is the source of truth for releases, supported agents, and configuration details. For exact arguments and flags, `opper <command> --help` is always authoritative.
