Skip to content

Rex ​

Run each ticket's agent in its own Rex session. Rex is a terminal multiplexer whose server keeps sessions running whether or not a client is attached. Its preset brings Git workspace in project scope.

AI first ​

text
Read https://bakers.build/addons/rex.
Use Rex as this machine's executor. Check `rex version` (0.1.0 or later) and
that `rex ls` reaches the server, propose the machine.config.js executor entry
or a project addon entry and verify it with bakers conductor check.

Setup ​

Install Rex from superlogical.com/rex. bakers.build requires rex 0.1.0 or later on the conductor's PATH.

Run the Rex server as a service, so it keeps running without a client and comes back after a reboot:

sh
rex server install
rex version
rex ls

The executor never starts a Rex server itself: a server started by the conductor would take the run sessions down with it. A run fails at once with an install, upgrade or "server unreachable" message when rex is missing, older or its server is not running.

Configuration ​

Initialize a project with the executor choice:

sh
bakers config init --scope project --project <name> --executor @bakers-build/addon-rex

Its preset brings @bakers-build/addon-workspace-git; no separate worktree entry is needed. Existing projects can list it in .bakers/project.config.js:

js
addons: [
  '@bakers-build/addon-rex',
],

To use it on your machine only, while the project keeps its own executor, set it in ~/.bakers/machine.config.js:

js
executor: { use: '@bakers-build/addon-rex' },

The machine's executor wins for every project on that machine; the project keeps its workspace and hooks. Conductor slots explains the precedence. No with options are required; Options lists them.

The executor calls rex from the conductor, outside any agent sandbox.

Options ​

Generated from the options.schema.json of @bakers-build/addon-rex; change the schema, not this table.

OptionTypeDefaultRequiredEffect
commandstringclaudeFallback agent command when the agent addons supply none.
launch_watchobject—Launch-watch windows: how long a start may take and how soon an agent exit counts as a failed launch.
launch_watch.timeout_msinteger4000Window after start in which an immediate agent exit fails the launch; 0 skips it.
launch_watch.start_timeout_msinteger60000How long the launch waits for the wrapper to report the start.
launch_watch.poll_msinteger50Polling interval of both windows.

Run lifecycle ​

startRun creates one Rex session per run in the worktree (rex new --cwd <worktree> --shell none), labelled <identifier>-<run id> <branch>. The run's environment travels in a private launch script, never in the command line. stopRun does nothing. Cleanup kills (rex session kill), by session id, every session whose label ends in -<run id> <branch>; other sessions are untouched. Run state reaches bakers.build through the agent and the server, as with herdr.

Rex has no workspace of its own and opens no layout. Remote Rex servers (rex -S) are not used.

Verify ​

Run bakers conductor check, then a first ticket. The run appears in rex ls as <identifier>-<run id> <branch>; a Rex client shows its agent terminal. Close the client: the run keeps working. When the run is finalised, its session ends and disappears from rex ls.

Package source in a checkout: bakers-cli/addons/rex.