> ## 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.

# Platform Commands

> The RBS server, coding agent, Atlas knowledge graph, MCP integration, stacked branches, checkpoints, and proposals.

Commands for the ReasonOS platform layer: the per-branch server, the coding
agent, the Atlas knowledge graph, MCP integration, stacked development,
checkpoints, and cross-project proposals. Global flags are documented in the
[CLI overview](/reference/cli/overview#global-flags).

## rbs server

Start the RBS server: a REST API for file operations, a WebSocket terminal, an
AI coding agent with streaming support, automatic port detection and proxying
for dev servers, plus real-time collaboration (collaborative editing, presence,
chat, and WebRTC meetings). The server is what web-based editors and
development environments connect to.

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

| Flag                     | Description                                                                                                                                                                                                                        |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--claude-binary`        | Path to the `claude` CLI for the claude-code agent engine (default: search `PATH`)                                                                                                                                                 |
| `--cors`                 | Enable CORS for cross-origin requests                                                                                                                                                                                              |
| `--filter-local-ip`      | Strip private/local IPs from ICE candidates (default `true`)                                                                                                                                                                       |
| `--force-relay`          | Force all WebRTC traffic through the TURN relay (hides peer IPs)                                                                                                                                                                   |
| `--host`                 | Host to bind to (default `0.0.0.0`)                                                                                                                                                                                                |
| `--managed-secrets-file` | JSON file of `NAME` → value the platform supplies to this node (or `RBS_MANAGED_SECRETS_FILE`). Read once into memory and unlinked; the values never enter this process's environment, so terminals and agents cannot inherit them |
| `--origins`              | Comma-separated list of allowed origins (use with `--cors`)                                                                                                                                                                        |
| `-p, --port`             | Port to listen on (default `8080`)                                                                                                                                                                                                 |
| `--proxy-host`           | Base host for port proxying, e.g. `localhost` or `host.com` (default `localhost`)                                                                                                                                                  |
| `--remote`               | Cluster address `host:port` for scheduler-mode jobs (or `$RBS_REMOTE`)                                                                                                                                                             |
| `--remote-token`         | Bearer token for the cluster (or `$RBS_REMOTE_TOKEN`)                                                                                                                                                                              |
| `--remote-workspace`     | Worker-side workspace path for schedulable-target jobs (default: this server's workspace; or `$RBS_REMOTE_WORKSPACE`)                                                                                                              |
| `--turn`                 | Start an embedded TURN relay on the same port (UDP) for full WebRTC IP privacy                                                                                                                                                     |
| `--turn-password`        | TURN server password                                                                                                                                                                                                               |
| `--turn-public-ip`       | Public IP for the embedded TURN relay (auto-detected if empty)                                                                                                                                                                     |
| `--turn-server`          | External TURN relay URL (e.g. `turn:turn.example.com:3478`)                                                                                                                                                                        |
| `--turn-user`            | TURN server username                                                                                                                                                                                                               |

The agent inside the server reads provider keys from the environment
(`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GOOGLE_API_KEY`) and the model from
`RBS_AGENT_MODEL`. Run `rbs server --help` for the full HTTP/WebSocket API
surface (files, search, terminals, proxies, agent sessions, collaboration,
meetings, chat).

```bash theme={null}
rbs server --port 3000
rbs server --cors --origins "http://localhost:3000,http://example.com"
```

### rbs server init

Clone a git repository and start the RBS server on it. Designed for
container/Kubernetes deployments that start from an empty container with only
rbs on the path. Inherits all `rbs server` flags (`--port`, `--host`, `--cors`,
and the rest above), plus:

```bash theme={null}
rbs server init [flags]
```

| Flag               | Description                                                                                                                                                |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--git`            | Git remote URL to clone (required)                                                                                                                         |
| `--path`           | Path to clone the repository to (required)                                                                                                                 |
| `--branch`         | Branch to checkout after cloning                                                                                                                           |
| `--depth`          | Clone depth (`0` for a full clone; use `1` for shallow)                                                                                                    |
| `--git-user-name`  | git `user.name` for commits made on this node (or `RBS_GIT_USER_NAME`)                                                                                     |
| `--git-user-email` | git `user.email` for commits made on this node (or `RBS_GIT_USER_EMAIL`)                                                                                   |
| `--ssh-key-file`   | Private SSH key for git auth on this node (or `RBS_GIT_SSH_KEY_FILE`; e.g. a k8s secret mount). Used for the clone and every later git command on the node |

```bash theme={null}
rbs server init --git https://github.com/org/repo.git --path /workspace --branch main --depth 1
```

## rbs agent

Run the interactive coding agent (graph-first, multi-provider). With a prompt
argument it runs one turn and exits — headless: nothing prompts, and mutations
are denied unless `--mode` allows them. Without arguments it starts an
interactive session with inline permission prompts. Alias: `rbs agent2`.

Providers come from the environment: `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`,
`XAI_API_KEY`, `GOOGLE_API_KEY`, and `REASONOS_LLM_URL`/`REASONOS_TOKEN` for
the hosted service.

```bash theme={null}
rbs agent [prompt] [flags]
```

| Flag             | Description                                                                  |
| ---------------- | ---------------------------------------------------------------------------- |
| `--effort`       | Reasoning effort: `low`, `medium`, `high`, `max`                             |
| `--max-steps`    | Cap model calls per turn                                                     |
| `--mode`         | Permission mode: `manual`, `accept_edits`, `auto`, `plan` (default `manual`) |
| `--model`        | Model reference (`claude-opus-5`, `hosted/fast`, `opus`, ...)                |
| `--no-graph`     | Skip loading the build graph                                                 |
| `--no-mcp`       | Skip connecting workspace MCP servers                                        |
| `--print-prompt` | Print the assembled system prompt and tool definitions with sizes, then exit |
| `--tui`          | Launch the full-screen terminal interface (interactive only)                 |
| `--worktree`     | Isolate edits in a git worktree with this name                               |

```bash theme={null}
rbs agent --tui                                        # interactive full-screen session
rbs agent "add error handling to main.go" --mode auto  # one headless turn, edits allowed
```

## rbs atlas

Atlas maps the workspace into a queryable knowledge graph: functions, types,
classes, and files connected by calls / imports / inherits edges, clustered
into communities. Query it instead of grepping. The build is pure-local — no
network, no LLM, no API key required (LLM enrichment is opt-in).

Two flags are shared by every atlas subcommand:

| Flag          | Description                                                                                                             |
| ------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `--graph`     | Path to `graph.json` (default `.rbs/atlas/graph.json`)                                                                  |
| `--workspace` | Query another repo without cloning: `@org/project-slug[@branch]` via the control plane, a workspace path, or a node URL |

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

### rbs atlas build

Build (or incrementally rebuild) the workspace knowledge graph.

```bash theme={null}
rbs atlas build [flags]
```

| Flag           | Description                                                                           |
| -------------- | ------------------------------------------------------------------------------------- |
| `--dedup-llm`  | LLM arbitration for ambiguous concept-dedup pairs                                     |
| `--exclude`    | Workspace-relative path prefix to skip (repeatable)                                   |
| `--force`      | Ignore the extraction cache and shrink guard                                          |
| `--html`       | Also write the interactive `graph.html`                                               |
| `--lsp`        | Enrich pattern-extracted languages with parser-exact symbols from language servers    |
| `--model`      | Model for `--semantic`/`--dedup-llm` (default: the agent default)                     |
| `--no-cluster` | Skip community detection                                                              |
| `--resolution` | Community resolution — higher means smaller communities (default `1`)                 |
| `--semantic`   | LLM concept extraction over documents (needs a provider key; cached per content hash) |

```bash theme={null}
rbs atlas build --html
rbs atlas build --lsp --exclude vendor
```

### rbs atlas query

Answer a plain-language question with a scoped subgraph.

```bash theme={null}
rbs atlas query <question> [flags]
```

| Flag        | Description                                                                        |
| ----------- | ---------------------------------------------------------------------------------- |
| `--budget`  | Token budget for the answer (default `2000`)                                       |
| `--context` | Edge-context filter (`call`, `import`, `field`, `parameter_type`, ...; repeatable) |
| `--depth`   | Traversal depth (default `2`)                                                      |
| `--dfs`     | Depth-first traversal (default: breadth-first)                                     |

```bash theme={null}
rbs atlas query "how does auth work"
```

### rbs atlas search

Ranked symbol search — hits with exact `file:line` locations.

```bash theme={null}
rbs atlas search <query> [flags]
```

| Flag      | Description             |
| --------- | ----------------------- |
| `--json`  | JSON output             |
| `--limit` | Max hits (default `20`) |

```bash theme={null}
rbs atlas search LSPManager --limit 5
```

### rbs atlas explain

Show one symbol: identity and connections, grouped by file.

```bash theme={null}
rbs atlas explain <symbol>
```

```bash theme={null}
rbs atlas explain LSPManager
```

### rbs atlas neighbors

List one symbol's immediate connections.

```bash theme={null}
rbs atlas neighbors <symbol> [flags]
```

| Flag         | Description                              |
| ------------ | ---------------------------------------- |
| `--budget`   | Token budget (default `2000`)            |
| `--relation` | Only edges of this relation (repeatable) |

```bash theme={null}
rbs atlas neighbors StartServer --relation call
```

### rbs atlas path

Trace the shortest path between two symbols.

```bash theme={null}
rbs atlas path <from> <to> [flags]
```

| Flag           | Description                   |
| -------------- | ----------------------------- |
| `--undirected` | Walk edges in both directions |

```bash theme={null}
rbs atlas path ServerStart Terminal
```

### rbs atlas affected

Blast radius: what breaks if this symbol changes.

```bash theme={null}
rbs atlas affected <symbol> [flags]
```

| Flag         | Description                                                       |
| ------------ | ----------------------------------------------------------------- |
| `--depth`    | Reverse-traversal depth (default `2`)                             |
| `--relation` | Relation filter (repeatable; default: the change-propagating set) |

```bash theme={null}
rbs atlas affected StartServer
```

### rbs atlas impact

Symbol-level blast radius of this branch's changes versus a base ref.

```bash theme={null}
rbs atlas impact [flags]
```

| Flag      | Description                               |
| --------- | ----------------------------------------- |
| `--base`  | Base ref to diff against (default `main`) |
| `--depth` | Blast-radius depth (default `2`)          |
| `--json`  | JSON output                               |

```bash theme={null}
rbs atlas impact --base main --json
```

### rbs atlas community

Show one community: label, cohesion, and members.

```bash theme={null}
rbs atlas community <id> [flags]
```

| Flag       | Description                   |
| ---------- | ----------------------------- |
| `--budget` | Token budget (default `2000`) |

```bash theme={null}
rbs atlas community 3
```

### rbs atlas god-nodes

The most-connected symbols — what everything flows through. Alias:
`god_nodes`.

```bash theme={null}
rbs atlas god-nodes [flags]
```

| Flag     | Description                     |
| -------- | ------------------------------- |
| `--json` | JSON output                     |
| `--top`  | How many to list (default `10`) |

```bash theme={null}
rbs atlas god-nodes --top 20
```

### rbs atlas export

Export the graph — `html` for an interactive visualization, `wiki` for one
markdown article per subsystem.

```bash theme={null}
rbs atlas export <html|wiki> [flags]
```

| Flag           | Description |
| -------------- | ----------- |
| `-o, --output` | Output path |

```bash theme={null}
rbs atlas export html -o atlas.html
```

### rbs atlas report

Print the graph report.

```bash theme={null}
rbs atlas report
```

### rbs atlas stats

Show graph size and the confidence split.

```bash theme={null}
rbs atlas stats
```

### rbs atlas save-result

Record a query outcome into the branch's work-memory (stored under
`.reasonos/`, so it travels with the branch).

```bash theme={null}
rbs atlas save-result <question> [flags]
```

| Flag           | Description                                             |
| -------------- | ------------------------------------------------------- |
| `--correction` | What was actually true (for `--outcome corrected`)      |
| `--file`       | Source file involved (repeatable)                       |
| `--node`       | Node id involved (repeatable)                           |
| `--outcome`    | `useful`, `dead_end`, or `corrected` (default `useful`) |

```bash theme={null}
rbs atlas save-result "where is auth enforced" --outcome useful --file internal/auth/middleware.go
```

### rbs atlas reflect

Aggregate work-memory into lessons that boost query ranking.

```bash theme={null}
rbs atlas reflect
```

## rbs mcp

Manage MCP (Model Context Protocol) integrations. RBS can act as an MCP server
— exposing its tools to Claude Desktop, ChatGPT, or other MCP clients — and as
an MCP client, connecting to external MCP servers for additional tools.

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

### rbs mcp serve

Start an MCP server that exposes RBS coding-agent tools, the agent's skill
corpus (as `rbs://skills/*` resources), and skill-composed prompts. By default
it runs in stdio mode with a curated tool surface: interactive tools,
agent-loop internals, LLM-spawning tools, and write tools are excluded.

```bash theme={null}
rbs mcp serve [flags]
```

| Flag              | Description                                                                                                                               |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `--allow-write`   | Include mutating tools (`write_file`, `str_replace`, `delete_file`, `run_command`, `rbs_run`, task/lesson writers) in the curated surface |
| `--exclude-tools` | Comma-separated tool names to exclude (applies in both modes)                                                                             |
| `--http`          | Listen address for HTTP transport (e.g. `:3001`). Omit for stdio                                                                          |
| `--tools`         | Tool surface to expose: `curated` (safe subset) or `full` (all runtime tools) (default `curated`)                                         |

Claude Desktop configuration (stdio):

```json theme={null}
{
  "mcpServers": {
    "rbs": {
      "command": "rbs",
      "args": ["mcp", "serve"]
    }
  }
}
```

```bash theme={null}
rbs mcp serve                  # stdio mode for Claude Desktop / Claude Code
rbs mcp serve --http :3001     # HTTP mode; point clients at http://localhost:3001/mcp
```

### rbs mcp list

List the tools the MCP server would expose. Honors the same flags as
`rbs mcp serve`, so the output matches what a connected client would see.

```bash theme={null}
rbs mcp list [flags]
```

| Flag              | Description                                                     |
| ----------------- | --------------------------------------------------------------- |
| `--allow-write`   | Include mutating tools in the curated surface                   |
| `--exclude-tools` | Comma-separated tool names to exclude (applies in both modes)   |
| `--tools`         | Tool surface to expose: `curated` or `full` (default `curated`) |

```bash theme={null}
rbs mcp list --tools full
```

## rbs stack

Stacked development. A stack is a chain of branches, each built on the one
below it — instead of one large pull request, you send several small ones that
review and land in order. rbs records each branch's parent in git itself
(`refs/branch-metadata/<branch>`), so a stack survives a clone and needs no
account anywhere. Alias: `rbs st`.

When a restack hits a conflict, resolve it and run `rbs stack continue`;
`rbs stack abort` unwinds it.

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

```bash theme={null}
rbs stack init                     # name this repo's trunk
rbs stack create add-api -m "..."  # branch off the current one and commit
rbs stack submit --stack           # push and open a change request per branch
```

### rbs stack init

Set up stacking for this repository: record which branch is trunk, and
optionally which control-plane project the repository maps to so
`rbs stack submit` can open change requests. Trunk is guessed from the
remote's HEAD when not given.

```bash theme={null}
rbs stack init [trunk] [flags]
```

| Flag              | Description                                   |
| ----------------- | --------------------------------------------- |
| `--control-plane` | Control-plane base URL                        |
| `--project`       | Control-plane project this repository maps to |
| `--remote`        | Remote to push stacks to (default `origin`)   |

```bash theme={null}
rbs stack init main
```

### rbs stack create

Start a branch on top of the current one and commit to it. Alias: `c`.

```bash theme={null}
rbs stack create <name> [flags]
```

| Flag            | Description                                                 |
| --------------- | ----------------------------------------------------------- |
| `-a, --all`     | Stage every change first                                    |
| `--empty`       | Create the branch with no commit — branch ahead of the work |
| `--insert`      | Insert between the current branch and its children          |
| `-m, --message` | Commit message                                              |

```bash theme={null}
rbs stack create add-api -am "Add the API layer"
```

### rbs stack modify

Amend the current branch's most recent commit with what is staged, then rebase
every branch stacked on top of it. Restacking is not optional: leaving the
branches above pointing at a commit that no longer exists is how a stack rots.
Alias: `m`.

```bash theme={null}
rbs stack modify [flags]
```

| Flag            | Description                                                   |
| --------------- | ------------------------------------------------------------- |
| `-a, --all`     | Stage every change first                                      |
| `-c, --commit`  | Add a new commit instead of amending                          |
| `--into`        | Amend the staged changes into this branch below, then restack |
| `-m, --message` | Commit message                                                |

```bash theme={null}
rbs stack modify -a
rbs stack modify -c -m "Address review feedback"
```

### rbs stack absorb

Look at what is staged, work out which branch below introduced the lines each
hunk touches, amend those branches, and restack — review feedback lands in the
change request being reviewed instead of a fixup commit on top. A hunk moves
only when its lines clearly belong to exactly one branch; everything else stays
staged, with the reason listed.

```bash theme={null}
rbs stack absorb [flags]
```

| Flag        | Description                                      |
| ----------- | ------------------------------------------------ |
| `--dry-run` | Show where each hunk would go and change nothing |

```bash theme={null}
rbs stack absorb --dry-run
```

### rbs stack log

Show the stack. Alias: `l`.

```bash theme={null}
rbs stack log [flags]
```

| Flag        | Description            |
| ----------- | ---------------------- |
| `--json`    | Emit the stack as JSON |
| `--reverse` | Draw trunk first       |

```bash theme={null}
rbs stack log
```

### rbs stack ls

List the stack, one line per branch. Alias: `list`.

```bash theme={null}
rbs stack ls
```

### rbs stack info

Show one branch's place in its stack (defaults to the current branch).

```bash theme={null}
rbs stack info [branch]
```

### rbs stack diff

Print the diff a reviewer of this branch sees: its changes against its parent,
not against trunk. The fourth branch in a stack shows its own change, not the
sum of the four.

```bash theme={null}
rbs stack diff [branch]
```

### rbs stack checkout

Switch to a branch in the stack. Alias: `co`.

```bash theme={null}
rbs stack checkout <branch>
```

### rbs stack up

Move up the stack, optionally by `n` branches.

```bash theme={null}
rbs stack up [n]
```

### rbs stack down

Move down the stack, optionally by `n` branches.

```bash theme={null}
rbs stack down [n]
```

### rbs stack top

Go to the top of the stack.

```bash theme={null}
rbs stack top
```

### rbs stack bottom

Go to the branch just above trunk.

```bash theme={null}
rbs stack bottom
```

### rbs stack restack

Rebase branches back on top of their parents.

```bash theme={null}
rbs stack restack [flags]
```

| Flag          | Description                                  |
| ------------- | -------------------------------------------- |
| `--branch`    | Apply to this branch only                    |
| `--downstack` | Apply to this branch and everything below it |
| `--stack`     | Apply to the whole stack (default)           |
| `--upstack`   | Apply to this branch and everything above it |

```bash theme={null}
rbs stack restack --upstack
```

### rbs stack continue

Carry on after resolving a rebase conflict.

```bash theme={null}
rbs stack continue [flags]
```

| Flag        | Description                          |
| ----------- | ------------------------------------ |
| `-a, --all` | Stage every change before continuing |

```bash theme={null}
rbs stack continue -a
```

### rbs stack abort

Undo an in-progress restack.

```bash theme={null}
rbs stack abort
```

### rbs stack submit

Push each branch of the stack and open (or update) a ReasonOS change request
for it, each targeting the branch below rather than trunk. The stack metadata
is pushed too, so the control plane and your teammates see the same graph you
do. Every branch must be restacked first: a change request whose base has moved
shows a diff nobody wrote.

```bash theme={null}
rbs stack submit [flags]
```

| Flag            | Description                                                        |
| --------------- | ------------------------------------------------------------------ |
| `--always`      | Push every branch even when the remote already matches             |
| `--body`        | Description for a new change request                               |
| `--branch`      | Apply to this branch only                                          |
| `--downstack`   | Apply to this branch and everything below it (default)             |
| `--draft`       | Open new change requests as drafts                                 |
| `--dry-run`     | Show what would happen and change nothing                          |
| `--force`       | Overwrite remote branches even if they moved since your last fetch |
| `--publish`     | Take existing drafts out of draft                                  |
| `--stack`       | Apply to the whole stack                                           |
| `--title`       | Title for a new change request                                     |
| `--update-only` | Update existing change requests, do not open new ones              |
| `--upstack`     | Apply to this branch and everything above it                       |

```bash theme={null}
rbs stack submit --stack
rbs stack submit --draft --title "Add the API layer"
```

### rbs stack sync

Bring the repository up to date: fast-forward trunk from the remote, refresh
what each branch's change request says, delete branches whose changes are
already in trunk (reparenting whatever was stacked on them), and restack what
remains. A branch counts as landed when its content is in trunk — squash- and
rebase-merges included, which plain ancestry misses.

```bash theme={null}
rbs stack sync [flags]
```

| Flag           | Description                                                          |
| -------------- | -------------------------------------------------------------------- |
| `-f, --force`  | Do not ask before deleting, and reset a diverged trunk to the remote |
| `--no-delete`  | Keep branches that have landed                                       |
| `--no-pull`    | Skip pulling trunk                                                   |
| `--no-restack` | Skip restacking                                                      |

```bash theme={null}
rbs stack sync
```

### rbs stack get

Download a stack from the remote: fetch a branch and every branch below it,
reconstructing the stack from the metadata the submitter pushed — no server
call involved. A local branch the remote is strictly ahead of is
fast-forwarded; one strictly ahead of the remote is kept. When the two have
truly diverged, `get` refuses unless told how to reconcile.

```bash theme={null}
rbs stack get <branch> [flags]
```

| Flag          | Description                                                                                           |
| ------------- | ----------------------------------------------------------------------------------------------------- |
| `--overwrite` | Discard your local copy of a diverged branch                                                          |
| `--rebase`    | Replay your local commits on top of a diverged remote copy (conflicts pause for `rbs stack continue`) |

```bash theme={null}
rbs stack get add-api
```

### rbs stack test

Check out each branch in turn and run a command there — the way to ask "does
every change request in this stack pass on its own?". The command runs through
`sh -c` at the repository root; the branch you started on is restored
afterwards.

```bash theme={null}
rbs stack test <command...> [flags]
```

| Flag          | Description                                  |
| ------------- | -------------------------------------------- |
| `--branch`    | Apply to this branch only                    |
| `--downstack` | Apply to this branch and everything below it |
| `--fail-fast` | Stop at the first failing branch             |
| `--stack`     | Apply to the whole stack (default)           |
| `--upstack`   | Apply to this branch and everything above it |

```bash theme={null}
rbs stack test 'rbs build //...'
rbs stack test --downstack --fail-fast 'go test ./...'
```

### rbs stack move

Rebase a branch and everything above it onto another branch. Alias: `mv`.

```bash theme={null}
rbs stack move <onto> [flags]
```

| Flag           | Description                                  |
| -------------- | -------------------------------------------- |
| `-s, --source` | Branch to move (defaults to the current one) |

```bash theme={null}
rbs stack move main -s add-api
```

### rbs stack reorder

Rearrange the branches of a stack. Names are given bottom-first: the first sits
on trunk, the second on the first, and so on. Every branch is then rebased into
its new position.

```bash theme={null}
rbs stack reorder <branch> [branch...]
```

```bash theme={null}
rbs stack reorder base-refactor add-api add-ui
```

### rbs stack split

Cut the current branch's commits into a stack. `--at` takes commit offsets from
the branch head, newest first: `--at 0 --at 2` means "one branch ending at the
head, one ending two commits back". `--names` takes the branch names oldest
first, one per cut.

```bash theme={null}
rbs stack split [flags]
```

| Flag      | Description                                          |
| --------- | ---------------------------------------------------- |
| `--at`    | Commit offsets from the head to cut at, newest first |
| `--names` | Branch names, oldest first                           |

```bash theme={null}
rbs stack split --at 0 --at 2 --names lower --names upper
```

### rbs stack squash

Collapse the current branch's commits into one.

```bash theme={null}
rbs stack squash [flags]
```

| Flag            | Description                     |
| --------------- | ------------------------------- |
| `-m, --message` | Message for the squashed commit |
| `--no-edit`     | Keep the first commit's message |

```bash theme={null}
rbs stack squash --no-edit
```

### rbs stack fold

Combine the current branch with the one below it. By default the parent's name
survives.

```bash theme={null}
rbs stack fold [flags]
```

| Flag     | Description                                            |
| -------- | ------------------------------------------------------ |
| `--keep` | Keep the current branch's name instead of its parent's |

```bash theme={null}
rbs stack fold
```

### rbs stack edit

Interactively rebase the current branch's own commits.

```bash theme={null}
rbs stack edit
```

### rbs stack rename

Rename the current branch.

```bash theme={null}
rbs stack rename <name>
```

### rbs stack delete

Delete a branch, reparenting whatever was stacked on it.

```bash theme={null}
rbs stack delete <branch> [flags]
```

| Flag          | Description           |
| ------------- | --------------------- |
| `-f, --force` | Delete without asking |

```bash theme={null}
rbs stack delete add-api
```

### rbs stack pop

Delete the current branch but keep its changes in the working tree.

```bash theme={null}
rbs stack pop
```

### rbs stack track

Add an existing branch to a stack.

```bash theme={null}
rbs stack track [branch] [flags]
```

| Flag           | Description                       |
| -------------- | --------------------------------- |
| `-p, --parent` | Parent branch (defaults to trunk) |

```bash theme={null}
rbs stack track feature-x -p add-api
```

### rbs stack untrack

Remove a branch from its stack, leaving its commits alone.

```bash theme={null}
rbs stack untrack [branch]
```

### rbs stack undo

Restore every branch and its stack metadata to how they were before the last
mutating stack command. Branches created since are kept (just untracked), so
undo never deletes commits. Running undo again redoes.

```bash theme={null}
rbs stack undo [flags]
```

| Flag        | Description                                     |
| ----------- | ----------------------------------------------- |
| `--dry-run` | Show what undo would restore and change nothing |

```bash theme={null}
rbs stack undo --dry-run
```

## rbs checkpoint

Manage workspace checkpoints that capture file state at a point in time.
Checkpoints work like save points — create one before making changes, then
revert back if needed (similar to Cursor and Claude Code's checkpoint systems
for undoing AI-generated changes). Alias: `rbs cp`.

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

### rbs checkpoint create

Create a checkpoint of the current file state. With no files specified, all
modified files (detected via `git status`) are included.

```bash theme={null}
rbs checkpoint create [files...] [flags]
```

| Flag            | Description                        |
| --------------- | ---------------------------------- |
| `-m, --message` | Checkpoint description             |
| `--session`     | Associate with an agent session ID |

```bash theme={null}
rbs checkpoint create -m "before refactor"
rbs checkpoint create src/main.go src/util.go
```

### rbs checkpoint list

List all checkpoints, most recent first.

```bash theme={null}
rbs checkpoint list [flags]
```

| Flag        | Description                              |
| ----------- | ---------------------------------------- |
| `--limit`   | Maximum number of results (default `50`) |
| `--session` | Filter by session ID                     |

```bash theme={null}
rbs checkpoint list --limit 10
```

### rbs checkpoint diff

Compare the current workspace state against a checkpoint — which files have
been modified, added, or deleted since it was created.

```bash theme={null}
rbs checkpoint diff <checkpoint-id>
```

```bash theme={null}
rbs checkpoint diff abc12345
```

### rbs checkpoint revert

Restore all files to their state at the given checkpoint. Files that did not
exist when the checkpoint was created are deleted; files modified since are
overwritten. The checkpoint ID can be a prefix, as long as it uniquely
identifies one checkpoint.

```bash theme={null}
rbs checkpoint revert <checkpoint-id>
```

```bash theme={null}
rbs checkpoint revert abc12345
```

### rbs checkpoint chain

Walk the parent links from a checkpoint back to the root of its session,
showing how checkpoints are stacked.

```bash theme={null}
rbs checkpoint chain <checkpoint-id>
```

```bash theme={null}
rbs checkpoint chain abc12345
```

### rbs checkpoint delete

Delete a checkpoint.

```bash theme={null}
rbs checkpoint delete <checkpoint-id>
```

### rbs checkpoint prune

Remove checkpoints older than a specified duration and garbage-collect
orphaned blobs.

```bash theme={null}
rbs checkpoint prune [flags]
```

| Flag      | Description                                                  |
| --------- | ------------------------------------------------------------ |
| `--hours` | Remove checkpoints older than this many hours (default `24`) |

```bash theme={null}
rbs checkpoint prune --hours 48
```

## rbs propose

File a change proposal against a project on the control plane. Public projects
accept proposals from anyone (with a claimed identity — defaults to your git
`user.name`/`user.email`); private projects require access. A proposal is
advisory: whether anything changes is entirely up to the project's
contributors.

```bash theme={null}
rbs propose <@org/project> [flags]
```

| Flag          | Description                                        |
| ------------- | -------------------------------------------------- |
| `--author`    | Claimed identity (default: git `user.name`)        |
| `--body`      | The argument for the change                        |
| `--body-file` | Read the body from a file                          |
| `--email`     | Contact email (default: git `user.email`)          |
| `--title`     | One-line summary of the proposed change (required) |

```bash theme={null}
rbs propose @acme/webapp --title "Support SSO re-auth" --body "Sessions currently drop on IdP re-auth..."
rbs propose @acme/webapp --title "Split the billing worker" --body-file proposal.md
```
