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

# CLI Overview

> Every rbs command, its global flags, and how target labels work.

RBS (ReasonOS Build System) is a self-contained build system that manages all
toolchains internally and provides hermetic builds. This is the exhaustive
command reference — every command and flag, exactly as the CLI reports them.

```bash theme={null}
rbs [command] [flags]
```

## Target labels and patterns

Most commands that operate on build targets accept labels in the same syntax:

| Pattern            | Meaning                                                                         |
| ------------------ | ------------------------------------------------------------------------------- |
| `//package:target` | The target `target` in the package at `package/` (path from the workspace root) |
| `:target`          | The target `target` in the current package (your working directory)             |
| `:all`             | Every target in the current package                                             |
| `//package/...`    | Every target under `package/`, recursively                                      |
| `//...`            | Every target in the workspace                                                   |

`build`, `test`, `run`, and `coverage` also accept a natural syntax — a package
path followed by one or more target names:

```bash theme={null}
rbs build examples/native-task-demo setup cleanup   # two targets in one package
rbs run examples/django runserver                   # same as //examples/django:runserver
```

## Global flags

These flags are accepted by every command. Per-command flag tables on the other
pages omit them (along with `-h, --help`, which every command supports).

| Flag               | Description                                                                                                |
| ------------------ | ---------------------------------------------------------------------------------------------------------- |
| `--config`         | Config file (default `$HOME/.rbs.yaml`)                                                                    |
| `-e, --env`        | Environment to build for, as declared by `env.environment()` in `.env.schema`. Also settable via `RBS_ENV` |
| `--platforms`      | Target platforms to build for (e.g. `linux-amd64`); accepts multiple values                                |
| `--workspace-root` | Explicit path to the workspace root, overriding auto-discovery. Also settable via `RBS_WORKSPACE_ROOT`     |
| `-v, --version`    | Print the rbs version (top-level `rbs` only)                                                               |
| `-t, --toggle`     | Placeholder flag reported by the CLI ("Help message for toggle"); not used by any command                  |

<Note>
  Inside `rbs infra`, `-e/--env` takes a different meaning: it is an alias for the
  infra workspace (`--workspace`), e.g. `dev`, `staging`, `prod`. See
  [rbs infra](/reference/cli/operations-commands#rbs-infra).
</Note>

## Shell completion

`rbs completion [bash|zsh|fish|powershell]` generates an autocompletion script for your shell.

`rbs help [command]` prints help for any command — equivalent to `rbs <command> --help`.

## All commands

### Build

| Command                                                      | Purpose                                            |
| ------------------------------------------------------------ | -------------------------------------------------- |
| [`rbs build`](/reference/cli/build-commands#rbs-build)       | Build one or more targets with dependency handling |
| [`rbs test`](/reference/cli/build-commands#rbs-test)         | Run test targets                                   |
| [`rbs run`](/reference/cli/build-commands#rbs-run)           | Run a target, or several targets in parallel       |
| [`rbs query`](/reference/cli/build-commands#rbs-query)       | List and inspect build targets matching a pattern  |
| [`rbs graph`](/reference/cli/build-commands#rbs-graph)       | Generate the unified workspace dependency graph    |
| [`rbs coverage`](/reference/cli/build-commands#rbs-coverage) | Generate coverage reports for test targets         |

### Workspace

| Command                                                          | Purpose                                                                       |
| ---------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| [`rbs scaffold`](/reference/cli/workspace-commands#rbs-scaffold) | Generate code from a scaffolding template                                     |
| [`rbs env`](/reference/cli/workspace-commands#rbs-env)           | Inspect and validate the workspace environment (`.env` files + `.env.schema`) |
| [`rbs cache`](/reference/cli/workspace-commands#rbs-cache)       | Manage the shared content-addressed store                                     |
| [`rbs sync`](/reference/cli/workspace-commands#rbs-sync)         | Sync external dependencies for targets to enable LSP support                  |
| [`rbs ext`](/reference/cli/workspace-commands#rbs-ext)           | Manage external rule packages (`ext.rbs`)                                     |
| [`rbs rules`](/reference/cli/workspace-commands#rbs-rules)       | Manage and test rules                                                         |

### Platform

| Command                                                             | Purpose                                                                   |
| ------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| [`rbs server`](/reference/cli/platform-commands#rbs-server)         | Start the RBS server with terminal, file API, AI agent, and proxy support |
| [`rbs agent`](/reference/cli/platform-commands#rbs-agent)           | Run the coding agent (graph-first, multi-provider)                        |
| [`rbs atlas`](/reference/cli/platform-commands#rbs-atlas)           | Symbol-level knowledge graph of the workspace                             |
| [`rbs mcp`](/reference/cli/platform-commands#rbs-mcp)               | MCP (Model Context Protocol) server and client management                 |
| [`rbs stack`](/reference/cli/platform-commands#rbs-stack)           | Work in stacks of small, dependent branches                               |
| [`rbs checkpoint`](/reference/cli/platform-commands#rbs-checkpoint) | Manage workspace checkpoints for reverting AI changes                     |
| [`rbs propose`](/reference/cli/platform-commands#rbs-propose)       | File a change proposal against another project                            |

### Operations

| Command                                                         | Purpose                                                    |
| --------------------------------------------------------------- | ---------------------------------------------------------- |
| [`rbs infra`](/reference/cli/operations-commands#rbs-infra)     | Manage infrastructure defined in .rbs files                |
| [`rbs ci`](/reference/cli/operations-commands#rbs-ci)           | Run CI workflows using RBS DAG execution                   |
| [`rbs job`](/reference/cli/operations-commands#rbs-job)         | Submit and manage cluster jobs (scheduler mode)            |
| [`rbs migrate`](/reference/cli/operations-commands#rbs-migrate) | Manage SQL database migrations                             |
| [`rbs remote`](/reference/cli/operations-commands#rbs-remote)   | Remote build services (REAPI cache; execution and workers) |
