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

# razi CLI reference: setup, claude, shell, status

> Complete reference for every razi CLI command — setup, claude, shell, and status — with flags, arguments, and config file location.

The `razi` CLI is the fastest way to use Raziel with Claude Code. It handles authentication, starts a local proxy, and launches Claude Code with the right environment already configured — no manual shell exports needed. The binary is also available as `raziel` (an alias for `razi`).

## Installation

<CodeGroup>
  ```bash one-time use (npx) theme={null}
  npx @raziel.fun/cli setup
  ```

  ```bash global install theme={null}
  npm install -g @raziel.fun/cli
  razi setup
  ```
</CodeGroup>

After a global install, both `razi` and `raziel` are available in your `PATH`.

***

## razi setup

Authenticates your machine and saves your API key locally.

```bash theme={null}
razi setup
```

<Steps>
  <Step title="Browser sign-in">
    The CLI opens your browser to the Raziel sign-in page. Complete the OAuth flow there.
  </Step>

  <Step title="Key saved">
    Once authorized, your key is written to `~/.config/raziel/config.json`. The full key value is stored locally — keep this file protected.
  </Step>
</Steps>

If you prefer not to use the browser flow, you can paste a key manually when the CLI prompts you. Keys start with `rz_live_` and are issued from **Customer → API Keys** in the dashboard.

<Tip>
  Run `razi setup` again any time to replace your stored key with a new one.
</Tip>

***

## razi claude

Starts a local proxy and launches Claude Code with the correct environment pre-configured.

```bash theme={null}
razi claude [args...]
```

### What it does

1. Reads your key from `~/.config/raziel/config.json`.
2. Starts a local HTTP proxy on `localhost:3099`.
3. Spawns `claude` with `ANTHROPIC_BASE_URL=http://localhost:3099` and `ANTHROPIC_AUTH_TOKEN=<your key>` set automatically — no shell config changes required.
4. Exits when Claude Code exits, shutting down the proxy cleanly.

### Passing arguments to Claude Code

Any arguments after `claude` are forwarded directly to the `claude` binary:

<CodeGroup>
  ```bash default theme={null}
  razi claude
  ```

  ```bash specify a model theme={null}
  razi claude --model claude-opus-4-7
  ```

  ```bash open a specific file theme={null}
  razi claude --file ./src/main.ts
  ```
</CodeGroup>

<Warning>
  Claude Code must be installed for this command to work. Download it at [https://claude.ai/download](https://claude.ai/download). If `claude` is not found in your `PATH`, the command will exit with an error.
</Warning>

### Manual setup (advanced)

If you prefer to set environment variables yourself without the CLI:

```bash theme={null}
export ANTHROPIC_BASE_URL=https://raziel.fun/gateway
export ANTHROPIC_AUTH_TOKEN=rz_live_xxxxxxxxxxxx
unset ANTHROPIC_API_KEY
claude logout  # if signed in via claude.ai OAuth
```

Use `ANTHROPIC_AUTH_TOKEN`, not `ANTHROPIC_API_KEY` — the latter triggers a connectivity check against Anthropic's servers.

***

## razi shell

Lists your teams or opens an interactive PTY shell into a specific team's server.

```bash theme={null}
razi shell [team]
```

### List teams

Run with no argument to see all teams on your account with their status:

```bash theme={null}
razi shell
```

Each team is shown with a status indicator:

* Green dot — active, shellable
* Grey dot — not currently running

### Open a shell

Pass a team slug or partial name to connect:

<CodeGroup>
  ```bash by exact slug theme={null}
  razi shell blue-fox-1234
  ```

  ```bash by partial name theme={null}
  razi shell blue-fox
  ```
</CodeGroup>

The CLI opens a full PTY session into the team's VM. Your terminal size is forwarded automatically and kept in sync on resize.

Exit the shell with `exit` or `Ctrl-D`. `Ctrl-C` is forwarded to the remote shell as usual (it does not disconnect you).

<Warning>
  Only active (running) teams accept shell connections. If the team is stopped or still starting, the command will exit with an error. Check the status with `razi shell` (no argument) first.
</Warning>

***

## razi status

Shows your current CLI configuration. Reads from the local config file — makes no network requests.

```bash theme={null}
razi status
```

Example output:

```
  ▲ razi

  Key:     rz_live_abcd…
  Added:   2025-01-15
  Gateway: https://raziel.fun/gateway
```

***

## Configuration file

The CLI stores your key at:

```
~/.config/raziel/config.json
```

The file contains:

```json theme={null}
{
  "apiKey": "rz_live_xxxxxxxxxxxx",
  "keyPrefix": "rz_live_abcd",
  "addedAt": "2025-01-15T10:00:00.000Z"
}
```

<Warning>
  This file contains your full API key in plaintext. Restrict its permissions and do not commit it to version control.
</Warning>
