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

# Coding plans in the CLI

> Read your workspace's coding plan, open Billing, and see what pays from the RunInfra CLI.

Use `runinfra plan` to read your signed-in workspace's coding plan. Complete purchases and settings changes in your browser.

## Install and connect

Install version 0.3.0 or later, sign in, then connect your agents:

```bash theme={"dark"}
npm install -g @runinfra/cli
runinfra login
runinfra connect --detected --preview
```

`--detected` connects every supported agent found on this machine, and `--preview` allows preview agents. One approval covers the whole batch before anything is applied, and each connection sends one small test request.

## Sign in

`runinfra login` signs this terminal in through the browser. Plan commands require terminal account access. A shared key saved with `runinfra login --paste` does not grant that access.

Terminal sign-in lists only workspaces you own. Other members of a Team workspace use an API key an owner creates.

## Read your plan

```bash theme={"dark"}
runinfra plan
```

The command reads the plan without changing it. It shows the monthly plan, 5-hour and weekly usage bars, local reset times, what happens at a limit, and credits. Before your first plan request, it says that the 5-hour window has not started. Last-known data includes its age and a notice that plan data could not be refreshed.

If the workspace has no plan, the command says **No coding plan on this workspace.** It suggests `runinfra plan buy <starter|pro|team>` only while plans are on sale. While plans are not on sale, `runinfra plan buy` stops with **Coding plans cannot be chosen for this workspace right now.** and exits 4.

### JSON output

```bash theme={"dark"}
runinfra plan --json
```

This returns one final JSON resource with `schema: "runinfra.cli.plan/1"`. Its fields are `workspace_id`, `snapshot`, `sales_enabled`, and `settings_url`. Read `snapshot.availability` before using the plan state in `snapshot.current`. A missing plan is `null`.

The snapshot reports the same plan windows and policy described in [Plan usage and funding](/docs/api-reference/usage#current-plan-state). The CLI names the snapshot `snapshot`; `/v1/usage` names it `coding_plan`.

## Buy a plan or open settings

Choose `starter`, `pro`, or `team`:

```bash theme={"dark"}
runinfra plan buy pro
```

To open settings for your plan:

```bash theme={"dark"}
runinfra plan settings
```

Both commands request a link to [**Billing**](https://runinfra.ai/settings/cost?section=plan). The CLI opens the exact returned URL, including the workspace and intent, and the selected tier for `buy`. If no browser can open, use the full link printed in the terminal.

Complete your change in the browser. The CLI waits read-only for up to 10 minutes, checking every 3 to 10 seconds and honoring longer rate-limit waits. It stops when a plan or settings change is confirmed. Changes in usage alone do not count as confirmation.

Press **Ctrl-C** to stop waiting. This does not cancel a change in the browser. After an interruption or timeout, run `runinfra plan` to check again. The command exits 0 when a change is confirmed, 5 when none is confirmed within 10 minutes, and 130 when you press Ctrl-C.

See [Coding plan](/docs/introduction/coding-plan) for prices, coverage, limits, and change or cancellation rules.

## See what pays

After a successful `runinfra login`, and in online `runinfra status` and `runinfra doctor`, the CLI includes the current funding sentence when plan information is available. It describes the plan, credits, Standby, or the reason requests are stopped. Reset and refill times use your local time.

`status --offline` and `doctor --offline` do not fetch plan funding information. If plan information cannot be read, the CLI omits the funding sentence.

## Connect with no credits

A workspace authorized through terminal sign-in can connect and verify with \$0 credits when its plan is serving. Other account holds still apply. A shared pasted key does not qualify for this plan check. Without a serving plan, the CLI requires credits for verification.

Requests still follow the workspace's funding policy and plan limits. Read the refusal message if verification is stopped. In Messages clients such as [Claude Code](/docs/tools-sdks/claude-code), the Anthropic envelope carries no `error.code`; the message states the limit, reset time, Standby condition, and next step. See [Messages funding and refusals](/docs/api-reference/anthropic-messages#coding-plan-funding).
