# CLI (https://inference.net/docs/cli)

The Inference Fast CLI (`fast`) connects supported coding agents to a project
you choose. It signs in through the dashboard, creates one machine-scoped API
key when you connect an agent, and can restore every config file it changes.

## Install and sign in

<Steps>
  <Step title="Install the CLI">

Choose the package manager you already use.

```bash
npm install -g @inference/fast
# or: pnpm add -g @inference/fast
# or: bun add -g @inference/fast
# or: yarn global add @inference/fast
```

  </Step>
  <Step title="Sign in">

```bash
fast login
```

The command opens a browser approval flow. If your account has a passkey or an authenticator app, finish
[passkey verification](/docs/getting-started/#passkey-verification) after signing in
and before approving the terminal connection. After approval, it asks you to select
a team and project when multiple options are available. In a non-interactive
terminal, it falls back to your personal team and that team's first project.
Select the same team in the Inference.net sidebar to see the CLI's project and keys.

  </Step>
  <Step title="Confirm the connection">

```bash
fast status
```

Status shows your account, selected project, machine key, endpoints, and the
connection state of every supported coding agent.

  </Step>
</Steps>

## Common commands

| Command                   | Purpose                                                              |
| ------------------------- | -------------------------------------------------------------------- |
| `fast login`              | Sign in through the Inference.net dashboard.                         |
| `fast status`             | Show the account, project, machine key, and agent states.            |
| `fast on --plan`          | Connect all detected agents using an Inference Pass plan key.        |
| `fast claude on`          | Connect Claude Code (add `--plan` for an Inference Pass plan key).   |
| `fast codex on`           | Connect Codex (add `--plan` for an Inference Pass plan key).         |
| `fast opencode on`        | Connect OpenCode (add `--plan` for an Inference Pass plan key).      |
| `fast pi on`              | Connect Pi (add `--plan` for an Inference Pass plan key).            |
| `fast key rotate --plan`  | Rotate this machine's API key to a fresh Inference Pass plan key.    |
| `fast <agent> status`     | Show an agent's connection, model, and config paths.                 |
| `fast <agent> off`        | Restore that agent's original configuration.                         |
| `fast logout`             | Restore all connected agents, disable the machine key, and sign out. |
| `fast --help`             | Show the complete command tree.                                      |

Calling an agent without `on` is equivalent to turning it on, so `fast claude`
and `fast claude on` do the same thing.

## Connect a coding agent

Four adapters are currently available:

```bash
fast claude on
fast codex on
fast opencode on
fast pi on
```

The first connection creates one project-scoped key named for your machine.
The CLI reuses that key for the other supported agents. To choose a model,
provide its catalog ID with `--model`:

```bash
fast codex on --model glm-5.2-fast
```

For Claude Code, `fast claude on --model <id>` sets every model override;
`--main`, `--opus`, `--sonnet`, `--haiku`, and `--subagents <id>` override one
role each.

To use an Inference Pass plan key instead of pay-as-you-go credits, add `--plan`
to `fast <agent> on`, `fast on`, or `fast key rotate`:

```bash
fast claude on --plan
fast opencode on --plan
fast on --plan
```

The CLI checks that you have an active plan on [My plans](/plans/), mints a plan
key, validates it against `GET /v1/usage`, and loads only the models included in
your plan. When connecting OpenCode with both a plan key and a custom model for
OpenCode's `plan` agent, pass `--plan-key --plan <model-id>`.

Each adapter snapshots the original files before changing them. Choose an
integration guide for the exact paths and verification flow:

- [Claude Code](/docs/integrations/claude-code/)
- [Codex](/docs/integrations/codex/)
- [OpenCode](/docs/integrations/opencode/)
- [Pi](/docs/integrations/pi/)

## Files and local configuration

CLI state, transport credentials, and reversible backups live under
`~/.inference-fast`. Files that can contain credentials are written with
owner-only permissions.

For local development, these environment variables override the defaults:

| Variable                       | Purpose                                           |
| ------------------------------ | ------------------------------------------------- |
| `INFERENCE_FAST_CONFIG_DIR`    | Move CLI state and backups to another directory.  |
| `INFERENCE_FAST_RELAY_URL`     | Override the authorization and tRPC relay.        |
| `INFERENCE_FAST_DASHBOARD_URL` | Override the browser approval dashboard.          |
| `INFERENCE_FAST_API_URL`       | Override the inference gateway.                   |
| `INFERENCE_FAST_MODEL`         | Change the default model used by new connections. |

<Callout title="Credentials stay out of command history" tone="info">

The CLI creates and stores its machine key itself. You do not pass raw API keys
as command-line arguments.

</Callout>

## Disconnect safely

Restore one agent without signing out:

```bash
fast claude off
fast claude status
```

Or restore every connected agent, disable the machine-scoped key, and close the
session in one step:

```bash
fast logout
```