1
Install rbs
rbs ships as a single self-contained binary — there is no runtime to install and no system toolchain to set up, since rbs manages its own toolchains from the first build onward. Get the binary from your organization’s distribution channel (for example a private Homebrew tap), place it on your PATH, and verify it:rbs --version — identifies the installed binary; expect its version string.There is no public package registry release yet — ask your team where they publish rbs internally.
2
Create a workspace
A workspace is any directory tree whose root contains a
WORKSPACE.rbs file. That file is the root marker and the place where workspace-wide configuration — most importantly toolchains — lives. It can start empty.mkdir hello-reasonos— creates the practice directory; expect no output on success.cd hello-reasonos— enters that directory; expect no output, with subsequent commands running there.touch WORKSPACE.rbs— creates the empty workspace marker; expect no output and a new file.
--workspace-root or the RBS_WORKSPACE_ROOT environment variable.)3
Define your first targets
Targets are declared in
BUILD.rbs files. A directory with a BUILD.rbs file is a package. Create one at the workspace root:4
Build, run, and query
rbs build :hello— builds the greeting target; expect a successful build summary.rbs run :show_greeting— runs the greeting-file target after its dependency; expectHello from rbs.rbs query //...— lists workspace targets without building; expecthello,write_greetingandshow_greeting.
:show_greeting depends on :write_greeting, so rbs builds the producer before the consumer. Run it twice: the second invocation is served from the shared cache.Labels name targets as //package/path:target_name. From inside a package you can abbreviate to :target_name, and rbs also accepts a natural syntax — rbs build path/to/pkg target_a target_b — when that reads better.5
Add a hermetic Go toolchain
So far the tasks used your shell. Now build something hermetically. Declare a Go toolchain in Write a small program and a test:Then add targets to
WORKSPACE.rbs — rbs downloads and caches the Go SDK on first use; no system Go installation is required:BUILD.rbs:6
Run and test it
rbs run :greet— builds and runs the Go program; expectHello, ReasonOS!after any first-use toolchain download.rbs test :greet_test— runs the greeting test; expect a passing test result.rbs test :greet_test --watch— keeps testing as sources change (--watchstays running); expect a test result followed by more runs after edits.
Where builds land
Build outputs, toolchain links, and other per-workspace state materialize under.rbs/ in the workspace root. That directory is disposable — action results live in the user-global shared cache, so deleting .rbs/ costs you nothing but a re-materialization. Add .rbs/ to your .gitignore.
Next steps
Core concepts
Understand packages, labels, the graph, the cache, and environments.
Example workspaces
A guided tour of runnable examples, from hello-world to full-platform demos.
Build commands
Everything build, run, test, query, and coverage can do.
Languages
Rules and toolchains for each supported language.