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

# RedPill CLI

> Manage RedPill organizations, workspaces, models, billing, API keys, and usage from a terminal or script.

The RedPill CLI manages your RedPill account. It is for people, shell scripts, and local agents
that need a command-line interface; it does not send inference requests or replace
[Private AI Proxy](/get-started/private-ai-proxy).

## Choose an account interface

| Host                                                           | Use                             |
| -------------------------------------------------------------- | ------------------------------- |
| Agent host with remote MCP support                             | [Account MCP](/get-started/mcp) |
| Terminal, script, or agent host with a shell but no MCP client | RedPill CLI                     |

Use one account interface on a given host, not both. Each keeps its own OAuth grant. MCP is the
preferred agent integration because it provides typed tools and keeps API key creation in the
browser; use the CLI when MCP is unavailable.

## Install

Install Node.js 22.12 or newer, then install the CLI from npm. Node.js 24 LTS is recommended.

```bash theme={null}
npm install --global @redpillai/cli
redpill --version
```

npm is the supported installation channel. Standalone binaries and install scripts are not
currently published.

## Sign in

```bash theme={null}
redpill auth login
redpill auth status
```

The CLI opens RedPill in your browser and uses OAuth Authorization Code with PKCE. One login grants
access to your user account and discovers every organization you can use. Choosing an organization
or workspace changes local command context; it does not start another OAuth authorization.

```bash theme={null}
redpill org list
redpill org use acme
redpill workspace list
redpill workspace use production
```

Flags override saved defaults for a single command:

```bash theme={null}
redpill --org personal billing balance
redpill --org acme --workspace sandbox usage summary
```

## Capabilities

| Area       | Commands                                                                                                            |
| ---------- | ------------------------------------------------------------------------------------------------------------------- |
| Account    | `account`, `org list`, `org current`, `org use`                                                                     |
| Workspaces | `workspace list`, `workspace current`, `workspace use`, `workspace create`, `workspace update`, `workspace archive` |
| Models     | `model list`, `model get`, `model uptime`                                                                           |
| Billing    | `billing balance`, `billing history`                                                                                |
| API keys   | `key list`, `key get`, `key create`, `key update`, `key revoke`                                                     |
| Usage      | `usage summary`, `usage logs`, `usage facets`                                                                       |

Run `redpill --help` or `redpill <command> --help` for options.

## Automation and confirmations

Human-readable output is the default. Use `--json` for one complete JSON document on stdout;
diagnostics and errors stay on stderr.

```bash theme={null}
redpill --json model list | jq '.data[] | .id'
redpill --json --org acme usage summary
```

Commands that change remote data show a preview and ask for confirmation in an interactive
terminal. In reviewed automation, use both `--json` and `--yes`:

```bash theme={null}
redpill --json --org acme key revoke 42 --yes
```

`--json` disables prompts and fails before a mutation unless `--yes` is present. Use `--no-input`
or `REDPILL_NO_INPUT=1` to disable prompts while retaining human-readable output. OAuth login is
interactive, so an agent should ask the user to run `redpill auth login` before continuing.

## Configuration and credentials

The CLI stores local state in the RedPill configuration directory, following the XDG convention
on Unix systems:

| Platform        | Default directory                           |
| --------------- | ------------------------------------------- |
| Linux and macOS | `${XDG_CONFIG_HOME:-$HOME/.config}/redpill` |
| Windows         | `%APPDATA%\\redpill`                        |

Set `REDPILL_CONFIG_HOME` to override the directory. `config.json` contains organization and
workspace defaults. `credentials.json` contains the OAuth grant and must not be shared or
committed. On Unix systems, the directory is written with mode `0700` and both files with mode
`0600`; credential updates use atomic replacement.

The CLI does not store RedPill API key secrets. A newly created key is shown once in command
output, so treat that output as a secret. Agents must not run `redpill key create` because the
secret would enter model context; ask the user to create the key in the
[dashboard](https://www.redpill.ai/keys) instead.

## Limits

Payments, subscriptions, organization membership, and administrator operations are intentionally
not available through the CLI. Receipt verification must run in the client that sent the request.

## Related

<CardGroup cols={2}>
  <Card title="Onboard your agent" icon="robot" href="/get-started/introduction#onboard-your-agent" />

  <Card title="Account MCP" icon="plug" href="/get-started/mcp" />
</CardGroup>
