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

# Edgee CLI

> The fastest way to run Claude Code, Codex, OpenCode, Cursor, and VS Code Copilot through Edgee. One command to authenticate, launch, and compress.

The Edgee CLI is the fastest way to route your coding agent through Edgee. Instead of manually configuring environment variables
and API keys, the CLI handles authentication, session tracking, and launching your agent in a single command.

## Supported Tools

<CardGroup cols={2}>
  <Card title="Claude Code" icon="https://mintcdn.com/edgee/RmPUqoqJw-u0FxFP/images/icons/claude.svg?fit=max&auto=format&n=RmPUqoqJw-u0FxFP&q=85&s=d3154991b618d253ee22ffaf55a433fc" width="128" height="128" data-path="images/icons/claude.svg">
    Anthropic's official CLI for interactive coding with AI.
  </Card>

  <Card title="Codex" icon="https://mintcdn.com/edgee/CrNen493EQpoYoa2/images/icons/codex.svg?fit=max&auto=format&n=CrNen493EQpoYoa2&q=85&s=0f19fa96ee1277109c66c3b411f868c0" width="128" height="128" data-path="images/icons/codex.svg">
    OpenAI's CLI agent for software engineering tasks.
  </Card>

  <Card title="OpenCode" icon="https://mintcdn.com/edgee/q0pRfKOA-_MkO9qY/images/icons/opencode.svg?fit=max&auto=format&n=q0pRfKOA-_MkO9qY&q=85&s=ea2fc548940c74f99826d9c3f651e2ad" width="128" height="128" data-path="images/icons/opencode.svg">
    Open-source coding agent with multi-model support.
  </Card>

  <Card title="CodeBuddy" icon="https://mintcdn.com/edgee/AIeEyI4UAlGiSW6a/images/icons/codebuddy.svg?fit=max&auto=format&n=AIeEyI4UAlGiSW6a&q=85&s=9bad4308c1dee5b03d9d326849dad3c2" width="128" height="128" data-path="images/icons/codebuddy.svg">
    CLI coding agent, routed through Edgee.
  </Card>

  <Card title="Crush" icon="https://mintcdn.com/edgee/AIeEyI4UAlGiSW6a/images/icons/crush.svg?fit=max&auto=format&n=AIeEyI4UAlGiSW6a&q=85&s=099c5e64cd537a4bc9a48b525bf903e4" width="128" height="128" data-path="images/icons/crush.svg">
    Charm's terminal coding agent, routed through Edgee.
  </Card>

  <Card title="Pi" icon="https://mintcdn.com/edgee/vmDLpOMJBalc41IG/images/icons/pi.svg?fit=max&auto=format&n=vmDLpOMJBalc41IG&q=85&s=16c2818afc43d44b4e13b12ece213dd8" width="128" height="128" data-path="images/icons/pi.svg">
    Terminal coding agent installed from npm, routed through Edgee.
  </Card>

  <Card title="Kimi Code" icon="https://mintcdn.com/edgee/32AEAZkEZJaEHF44/images/icons/kimi.svg?fit=max&auto=format&n=32AEAZkEZJaEHF44&q=85&s=25a2a3577d732e8713d13837a7a2ce47" width="128" height="128" data-path="images/icons/kimi.svg">
    Moonshot AI's terminal coding agent, routed through Edgee.
  </Card>

  <Card title="Kilo Code" icon="https://mintcdn.com/edgee/LlKf1bbK9KhD2RCB/images/icons/kilo.svg?fit=max&auto=format&n=LlKf1bbK9KhD2RCB&q=85&s=00de67f3485d9d7ba6e2ff3c7dd38b75" width="128" height="128" data-path="images/icons/kilo.svg">
    Kilo's terminal coding agent, routed through Edgee.
  </Card>

  <Card title="Cursor" icon="https://mintcdn.com/edgee/CrNen493EQpoYoa2/images/icons/cursor.svg?fit=max&auto=format&n=CrNen493EQpoYoa2&q=85&s=3de2173fea07b96507ee8bd0e351149f" width="128" height="128" data-path="images/icons/cursor.svg">
    Cursor IDE, routed through a local Edgee relay.
  </Card>

  <Card title="GitHub Copilot (VS Code)" icon="https://mintcdn.com/edgee/AIeEyI4UAlGiSW6a/images/icons/copilot.svg?fit=max&auto=format&n=AIeEyI4UAlGiSW6a&q=85&s=39d5d0af147199ca02bcd6c6c6c52a63" width="128" height="128" data-path="images/icons/copilot.svg">
    Copilot in VS Code, routed through a local Edgee relay.
  </Card>
</CardGroup>

<Note>
  CLI agents (Claude Code, Codex, OpenCode, CodeBuddy, Crush, Pi, Kimi Code, Kilo Code) run in your terminal. Cursor and VS Code Copilot are desktop editors: `edgee launch` starts a local Edgee relay and opens the editor routed through it.
</Note>

## Installation

<Tabs>
  <Tab title="macOS / Linux">
    ```bash theme={"dark"}
    curl -fsSL https://edgee.ai/install.sh | bash
    ```
  </Tab>

  <Tab title="Homebrew">
    ```bash theme={"dark"}
    brew install edgee-ai/tap/edgee
    ```
  </Tab>

  <Tab title="Windows (PowerShell)">
    ```powershell theme={"dark"}
    irm https://edgee.ai/install.ps1 | iex
    ```
  </Tab>
</Tabs>

Verify the installation:

```bash theme={"dark"}
edgee --version
```

## Quick Start

Launch your coding agent

<Tabs>
  <Tab title="Claude Code">
    ```bash theme={"dark"}
    edgee launch claude
    ```
  </Tab>

  <Tab title="Codex">
    ```bash theme={"dark"}
    edgee launch codex
    ```
  </Tab>

  <Tab title="OpenCode">
    ```bash theme={"dark"}
    edgee launch opencode
    ```
  </Tab>

  <Tab title="Kilo Code">
    ```bash theme={"dark"}
    edgee launch kilo
    ```
  </Tab>
</Tabs>

That's it. Your coding agent is now running with Edgee compression and observability enabled.
After your session ends, the CLI prints a link to view your session analytics in the Edgee Console.

## Commands

### Anthentication commands

#### `edgee auth login`

Authenticate with Edgee for a specific provider. Opens a browser window for OAuth-based login. Your API key and credentials
are saved to `~/.config/edgee/credentials.toml`.

If you want to use multiple Edgee profiles, you can add `--profile <profile-name>` to this command to declare the profile you want to use.

```bash theme={"dark"}
edgee auth login
```

#### `edgee auth status`

Display the current authentication status for all configured providers, including the logged-in email and connection mode.

```bash theme={"dark"}
edgee auth status
```

#### `edgee auth list`

List all configured profiles. Yes, because you can have multiple Edgee profiles, using `--profile <profile-name>` when you log in.

```bash theme={"dark"}
edgee auth list
```

#### `edgee auth switch`

Switch to a different profile.

```bash theme={"dark"}
edgee auth switch
```

### Launch commands

Launch your coding agent.

```bash theme={"dark"}
edgee launch
```

#### `edgee launch claude`

Launch Claude Code with all Edgee configuration automatically injected. The CLI sets the required environment variables
(`ANTHROPIC_BASE_URL`, authentication headers, session ID) and starts Claude Code.

```bash theme={"dark"}
edgee launch claude
```

You can pass any Claude Code arguments after the command:

```bash theme={"dark"}
edgee launch claude "How do I implement a binary search?"
edgee launch claude --resume
```

If you haven't authenticated yet, the CLI will prompt you to log in first. It will also ask you to select a connection mode
on first launch:

* **Claude Pro/Max**: uses your Anthropic subscription, Edgee compresses traffic to extend session duration
* **API Billing**: uses Edgee API keys for direct billing, reducing token costs

#### `edgee launch codex`

Launch Codex with Edgee routing automatically configured. The CLI passes the required provider configuration to Codex
and starts a new session.

```bash theme={"dark"}
edgee launch codex
```

You can pass any Codex arguments after the command:

```bash theme={"dark"}
edgee launch codex --model o4-mini
```

Connection modes for Codex:

* **ChatGPT Plus/Pro**: uses your OpenAI subscription with Edgee compression
* **API Billing**: uses Edgee API keys for direct billing

#### `edgee launch opencode`

Launch OpenCode with Edgee routing automatically configured.

```bash theme={"dark"}
edgee launch opencode
```

The generated provider declares each model's context window and per-million-token rates from the Edgee catalog, so OpenCode's context gauge, auto-compaction, and session cost readout work instead of defaulting to zero. See [OpenCode](/docs/integrations/opencode) for the fields it writes.

#### `edgee launch codebuddy`

Launch CodeBuddy with Edgee routing automatically configured.

```bash theme={"dark"}
edgee launch codebuddy
```

#### `edgee launch crush`

Launch Charm's Crush with Edgee routing automatically configured.

```bash theme={"dark"}
edgee launch crush
```

The generated provider declares each model's context window and per-million-token rates from the Edgee catalog, so Crush's context gauge, auto-summarizing, and session cost readout work instead of treating every model as unknown and free. See [Crush](/docs/integrations/crush) for the fields it writes.

#### `edgee launch pi`

Launch Pi with Edgee routing automatically configured.

```bash theme={"dark"}
edgee launch pi
```

The CLI adds an `edgee` provider to `~/.pi/agent/models.json`, leaving your other providers and logins untouched, and keeps the API key out of the file. Requires Pi 0.79.4 or newer. See [Pi](/docs/integrations/pi).

#### `edgee launch kimi`

Launch Moonshot AI's Kimi Code with Edgee routing automatically configured.

```bash theme={"dark"}
edgee launch kimi
```

The provider Edgee configures lives in memory for the length of the session — nothing is written to `~/.kimi-code/config.toml`. The session runs on Edgee credentials and the Edgee model catalog, not on a Moonshot subscription. Set `EDGEE_KIMI_MODEL` to pin a different catalog model. See [Kimi Code](/docs/integrations/kimi) for details.

#### `edgee launch kilo`

Launch the Kilo Code CLI with Edgee routing automatically configured.

```bash theme={"dark"}
edgee launch kilo
```

The Edgee provider is passed to Kilo inline, so your own configuration is never read or modified and your API key is never written to disk. It declares each model's context window and per-million-token rates from the Edgee catalog, so Kilo's context gauge, auto-compaction, and session cost readout work instead of defaulting to zero. See [Kilo Code](/docs/integrations/kilo) for the fields it writes.

#### Apps & editors

Cursor and VS Code Copilot are desktop editors, not terminal CLIs. `edgee launch` authenticates, starts a **local Edgee relay**, and opens the editor routed through it, so its requests get compression and observability like any CLI agent.

```bash theme={"dark"}
edgee launch cursor           # Cursor IDE
edgee launch copilot-vscode   # GitHub Copilot in VS Code
```

Both require the target app to be installed. See the [Cursor](/docs/integrations/cursor) and [GitHub Copilot](/docs/integrations/copilot-vscode) integration pages for details.

### Other commands

#### `edgee stats`

Show the stats of your latest sessions.

```bash theme={"dark"}
edgee stats
```

#### `edgee alias`

Install launch aliases so you can start each tool by its own name instead of typing `edgee launch <tool>` every time.

```bash theme={"dark"}
edgee alias
```

What it installs:

* **CLI agents** (`claude`, `codex`, `opencode`, `codebuddy`, `crush`, `pi`, `kimi`, `kilo`) — on macOS/Linux, PATH shims in `~/.edgee/bin`; on Windows, shell aliases. Running `claude` then transparently runs `edgee launch claude`.
* **Desktop editors** (`cursor`, `copilot-vscode`) — a desktop wrapper (macOS `.app`, Linux `.desktop`, Windows Start Menu shortcut) that opens the editor through Edgee. Installed **only when the editor is already present**; otherwise skipped with a note.

Scope it to one target, or undo:

```bash theme={"dark"}
edgee alias cursor          # only the Cursor wrapper
edgee alias remove          # remove every installed alias
edgee alias remove claude   # remove just one
```

<Note>
  After a fresh install on macOS/Linux, reopen your terminal (or run `exec $SHELL -l`) so `~/.edgee/bin` lands on your `PATH`.
</Note>

#### `edgee reset`

Reset your credentials and connection mode for a provider. Useful if you need to switch accounts, change your connection mode,
or re-authenticate.

```bash theme={"dark"}
edgee reset
```

#### `edgee self-update`

Check for updates and install the latest version of the Edgee CLI.

```bash theme={"dark"}
edgee self-update
```

## Configuration

The CLI stores credentials in `~/.config/edgee/credentials.toml` with restricted file permissions (`600`).

```toml theme={"dark"}
version = 2

[claude]
api_key = "ek_..."
email = "you@example.com"
connection = "plan"  # or "api"

[codex]
api_key = "ek_..."
email = "you@example.com"
connection = "plan"  # or "api"
```

<Note>
  You don't need to edit this file manually. The CLI manages it through `edgee init`, `edgee auth login`, and `edgee reset`.
</Note>

## Session Tracking

Every `edgee launch` session is assigned a unique session ID. When the agent exits, the CLI prints a link to a
detailed report in the Edgee Console. See [Sessions](/docs/features/sessions) for the full breakdown.

## How It Works

When you run `edgee launch claude` or `edgee launch codex`, the CLI:

1. Verifies your authentication (prompts login if needed)
2. Generates a unique session ID
3. Configures the appropriate environment variables and headers
4. Launches the coding agent as a child process with Edgee routing enabled
5. Prints a session analytics URL when the session ends

All requests from your coding session flow through Edgee's API, where token compression, cost tracking,
and observability are applied automatically.

## Next Steps

* Learn about [Token Compression V2](/docs/features/token-compression) and how it extends your sessions
* Set up [alerts](/docs/features/alerts) to monitor your token spend
* Explore [observability](/docs/features/observability) to track usage across all your sessions

<EdgeeSdk />
