> ## 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 use Claude Code and Codex with 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="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">
    🔜 Coming soon.
  </Card>
</CardGroup>

## 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>
</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

### Other commands

#### `edgee stats`

Show the stats of your latest sessions.

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

#### `edgee alias`

Install shell aliases for Edgee launch commands, so you won't need to launch `edgee launch <tool>` every time.

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

#### `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](/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 [Claude Token Compression](/features/claude-compression) and how it extends your sessions
* Set up [alerts](/features/alerts) to monitor your token spend
* Explore [observability](/features/observability) to track usage across all your sessions
