Skip to main content

CLI reference

All RBS commands run on your branch server via the integrated terminal in your code editor or through the command palette. Commands execute on the server, not on your local machine.

Global options

These options can be used with any RBS command:
OptionDescription
--help, -hShow help for any command.
--verbose, -vEnable verbose output.
--versionPrint the RBS version.

rbs build

Build one or more targets.

Syntax

rbs build [target_pattern...] [options]

Target patterns

PatternDescriptionExample
nameTarget in current package (natural syntax).rbs build hello
:nameTarget in current package (traditional).rbs build :hello
pkg nameTarget in a sub-package (natural).rbs build services/api server
//pkg:nameTarget in a sub-package (traditional).rbs build //services/api:server
//...All targets in entire workspace.rbs build //...
:allAll targets in current package.rbs build :all

Examples

# Build a single target
rbs build hello

# Build a target in a sub-package
rbs build services/api server

# Build all targets in the workspace
rbs build //...

# Build multiple targets
rbs build :hello :world :greet

rbs run

Build and execute a single target.

Syntax

rbs run [target] [options] [-- args...]

Examples

# Run a target in the current package
rbs run hello

# Run a target in a sub-package
rbs run services/api server

# Pass arguments to the target
rbs run :server -- --port 8080 --debug

rbs test

Build and run test targets.

Syntax

rbs test [target_pattern...] [options]

Options

OptionDescription
--test_tag_filters=TAGSFilter tests by tags (e.g., unit, integration).

Examples

# Run all tests in the workspace
rbs test //...

# Run tests in a specific package
rbs test services/api server_test

# Run only unit tests
rbs test //... --test_tag_filters=unit

# Run only integration tests
rbs test //... --test_tag_filters=integration

Test output

Test results are displayed inline in your editor and stored on the server:
.rbs/testlogs/{platform}/
├── services/api/
│   └── server_test/
│       ├── test.log          # Full test output
│       └── test_result.xml   # JUnit XML report
└── libs/common/
    └── utils_test/
        ├── test.log
        └── test_result.xml

rbs coverage

Run tests with code coverage analysis.

Syntax

rbs coverage [target_pattern...] [options]

Options

OptionDescription
--format=FORMATOutput format (text, html, json). Default: text.
--threshold=NMinimum coverage percentage required (fails if below).

Examples

# Run coverage for all tests
rbs coverage //...

# Require minimum 80% coverage
rbs coverage //... --threshold=80

# Generate HTML coverage report
rbs coverage //... --format=html
Coverage results are highlighted directly in your editor — green for covered lines, red for uncovered.

rbs workspace

Display workspace information including targets, configurations, and server status.

Syntax

rbs workspace [options]

Sample output

📦 RBS Workspace Information
============================
📍 Root: /workspace/my-project
🖥️  Server: rbs-server-feature-auth-abc123
🌿 Branch: feature/auth
👥 Connected: 2 developers

⚙️  Configuration:
   project_name = "my-project"
   version = "1.0.0"

🎯 Targets:
   //:hello (task)
   //services/api:server (java_binary)
   //services/api:server_test (java_test)
   //services/api:server_image (oci_image)

🔧 Toolchains:
   java: JDK 17.0.11 (ready)
   nodejs: Node.js 20.11.0 (ready)

📦 External Dependencies:
   spring_boot_web: 3.2.0 (cached)
   express_repo: 4.18.2 (cached)

🤖 Agents:
   review_bot: active (last triggered 2h ago)
   deploy_bot: active (idle)

rbs ci

Run CI workflows.

Syntax

rbs ci [options]

Options

OptionDescription
--workflow=NAMERun a specific workflow.
--affectedRun only on targets affected by recent changes.
--base=REFGit reference for computing affected targets (default: HEAD~1).
--distributedEnable distributed execution across workers.
--dry-runShow execution plan without running.
--verboseShow detailed execution output.

Examples

# Run default CI workflow
rbs ci

# Run only affected targets (ideal for PRs)
rbs ci --affected --base=origin/main

# Run a specific workflow
rbs ci --workflow=build_and_test

# Dry run to see what would execute
rbs ci --dry-run

rbs infra

Manage infrastructure provisioning.

Syntax

rbs infra [subcommand] [options]

Subcommands

SubcommandDescription
planGenerate an execution plan for infrastructure changes.
applyApply infrastructure changes.
destroyDestroy managed infrastructure.
showDisplay current infrastructure state.
refreshUpdate state from actual infrastructure.
importImport existing resources into state.
outputShow output values.
graphGenerate dependency graph.

Options

OptionDescription
--workspace=NAMEUse a specific infrastructure workspace (e.g., dev, prod).
--auto-approveSkip interactive approval for apply/destroy.

Examples

# Plan infrastructure changes
rbs infra plan //...

# Apply with a specific workspace
rbs infra apply --workspace=prod --auto-approve

# Show current state
rbs infra show

# Import an existing resource
rbs infra import aws_instance.web i-0abc123

rbs agent

Start the built-in AI coding agent — an interactive assistant that can read, edit, build, test, and deploy your codebase through natural language. See Coding agent for full documentation.

Syntax

rbs agent [flags] [prompt]

Flags

FlagDescription
-m, --modelModel to use (auto-detects provider).
-f, --filesComma-separated list of context files.
-s, --systemCustom system prompt.
-n, --non-interactiveRun once without interactive mode.
--full-docsEnable full documentation access.

Examples

# Start interactive mode
rbs agent

# Run with a prompt
rbs agent "Add a /health endpoint that returns JSON status"

# Use a specific model
rbs agent --model "claude-sonnet-4" "Explain this codebase"

# With context files
rbs agent --files "main.py,config.py" "Explain the entry point"

# Non-interactive (single prompt, then exit)
rbs agent -n "What targets are available?"

rbs agent-builder

Build, serve, and test custom AI agents defined in your BUILD.rbs files. See Agent Builder SDK for full documentation.

Syntax

rbs agent-builder [subcommand] [target] [options]

Subcommands

SubcommandDescription
serveStart an agent system.
testTest an agent with events.
listList registered agent components.
dag showDisplay DAG workflow structure.
dag validateValidate a DAG workflow.
dag exportExport DAG as Mermaid or DOT diagram.

Examples

# Serve an agent system
rbs agent-builder serve //support:customer_support

# Serve on a custom port with hot reload
rbs agent-builder serve //support:customer_support --port 9000 --watch

# Test with a single event
rbs agent-builder test //support:customer_support \
    --event "user.message" \
    --data '{"content": "I need help with my order"}'

# Interactive testing
rbs agent-builder test //support:customer_support --interactive

# List registered components
rbs agent-builder list --verbose

# Show DAG structure
rbs agent-builder dag show order_workflow

# Export DAG as Mermaid diagram
rbs agent-builder dag export order_workflow --format mermaid

rbs distributed

Manage distributed build execution.

Syntax

rbs distributed [subcommand] [options]

Subcommands

SubcommandDescription
statusShow status of distributed workers.

Examples

# Check worker status
rbs distributed status

Exit codes

CodeDescription
0Success.
1Build or test failure.
2Command-line usage error.
3Workspace configuration error.

Common workflows

Development cycle

# 1. View available targets
rbs workspace

# 2. Build your target
rbs build services/api server

# 3. Run your target
rbs run services/api server

# 4. Run tests
rbs test services/api server_test

# 5. Check coverage
rbs coverage services/api server_test --threshold=80

PR workflow

# 1. Build and test only affected targets
rbs ci --affected --base=origin/main

# 2. Build container images
rbs build //services/api:server_image

# 3. View results (also visible inline in editor)
rbs workspace