Appearance
Build the CLI from source
Take a fresh clone of the bakers.build repository to a bakers built from your own checkout, so you can change the CLI and run it.
You probably do not need this
To use bakers.build, install the published CLI with npm install -g @bakers-build/bakers and follow Install and sign in. Build from source only to work on the CLI itself.
You need: a clone of the repository, Node 20.19 or later, and pnpm.
Check the prerequisites. If pnpm is missing, enable it through corepack.
shnode --version pnpm --version corepack enable pnpmBuild every package once, then bootstrap from the repository root. On a fresh clone the bootstrap alone stops at the addon build (see Troubleshooting). The bootstrap is idempotent, so run it again after any pull that touches
bakers-cli/.sh(cd bakers-cli && pnpm install --config.minimumReleaseAge=0 && pnpm -r run build) bakers-cli/scripts/setup.shThe same script runs from
bakers-cli/aspnpm run bootstrap.Run the checkout's own build by explicit path.
sh./bakers-cli/bin/bakers --version ./bakers-cli/bin/bakers --helpSign in as described in Install and sign in, calling
./bakers-cli/bin/bakersin place ofbakers.
Done when: ./bakers-cli/bin/bakers --help lists conductor, ui, dropsh, deployment, agents, info and ports. A source build reports the workspace version, currently 0.0.1.
Rebuild after an edit
The CLI runs the compiled dist/ folders, so an edit has no effect until you rebuild. From bakers-cli/:
sh
pnpm install && pnpm -r run buildpnpm run build:all is the same command under another name. The recursive build orders the packages by their workspace dependencies. Once every package has been built, re-running the bootstrap also rebuilds them and refreshes the resolution farm and the shim.
What the bootstrap does
bakers-cli/scripts/setup.sh finds the repository root from its own path and runs eight steps.
- Prerequisites. It checks that pnpm exists and that Node is 20.19 or later.
- Install. It runs
pnpm install --config.minimumReleaseAge=0inbakers-cli/. The flag avoids the workspace's supply-chain age policy, which would fail a plain install on a fresh tree. - Build. It calls
tscfor each package in dependency order:core, thenconductor, then every folder underaddons/, thenui, thenhost. The conductor comes before the addons because every conductor addon imports its contract. The addonworkspace-gitis forced first becauseherdrdepends on it. - Resolution farm. It links every package into the repository's
node_modules/@bakers-build/under its real package name, and the@dropsh/*packages beside it, so a.bakers/conductor.config.jscan resolve its bare imports. - PATH shim. It copies
bakers-cli/templates/bakers.pathshim.shto~/.local/bin/bakers. This writes outside the repository. A differentbakersalready there is left untouched and the script prints the command that replaces it. - Local scaffold. It writes
.bakers/conductor.config.local.jsfrom a template, asking for a machine id and an OAuth client id in an interactive shell. The file is gitignored. See the warning below. - herdr plugin. When
herdris on the PATH it links the repository'sspiceeditplugin. This is best effort and never fails the bootstrap. - Summary. It prints next steps. They are out of date; use
bakers initfrom Install and sign in instead.
The scaffold and the printed next steps are retired
bakers config check reports the oauth keys that step 6 writes as dead keys, because sign-in is now bakers init and bakers dropsh auth login. Ignore the printed instructions to export a consumer secret, and delete the scaffold's oauth block if a check warns about it.
Monorepo layout
bakers-cli/
core/ @bakers-build/core surface-agnostic kernel, no @bakers-ai dependency
conductor/ @bakers-build/conductor run engine, the conductor command, the conductor contract
ui/ @bakers-build/ui the bakers ui command
host/ @bakers-build/bakers the bakers binary, config, init, update, validate
addons/* @bakers-build/addon-* one package per addon
scripts/ setup.sh, prepare-publish.mjs, release.mjs, verify-package.mjs, assert-acyclic.mjs
templates/ config and path-shim templatesbakers-cli/ is a private workspace root and is never published. Its pnpm workspace covers core, host, conductor, ui and addons/*. How the packages may depend on each other is described in architecture, and how to add an addon in addon contracts.
Which bakers runs
Two launchers exist, and a bare bakers runs the released CLI unless you are inside a test workspace.
bakers-cli/bin/bakersis the dev launcher. It loads the built host fromhost/dist/src/host.js, which mounts only the command you invoke. From a checkout, call it by path.~/.local/bin/bakersis the shim from step 5. Inside a skill-test workspace, found by a.bakers-testbuildmarker file at or above the working directory, it runs the checkout that marker names and fails loudly if that checkout is unbuilt. Everywhere else, including inside a plain clone, it runs the globally installed@bakers-build/bakers.
The shim wins only when ~/.local/bin comes before the directory where npm install -g places bakers. Put it first if the bootstrap warns about shadowing.
sh
export PATH="$HOME/.local/bin:$PATH"The bootstrap never overwrites a different shim. To adopt the current template, diff first and then copy it.
sh
diff ~/.local/bin/bakers bakers-cli/templates/bakers.pathshim.sh
cp bakers-cli/templates/bakers.pathshim.sh ~/.local/bin/bakers && chmod 0755 ~/.local/bin/bakersTests and checks
Run these from bakers-cli/.
| Command | What it does |
|---|---|
pnpm run test:vitest | Unit tests of every package under */tests/ |
pnpm run test:tui | Terminal UI tests of bakers ui, run with bun |
pnpm test | Both of the above |
pnpm run test:integration | The conductor integration tests, strictly one file at a time |
pnpm lint | The Biome check |
pnpm run typecheck | Builds every package, then type-checks it |
For one file, use vitest directly, for example pnpm exec vitest run core/tests/workflow/repository-contracts.test.ts.
Check the publish shape
The CLI ships as a set of npm packages: the @bakers-build/bakers binary package, core, conductor, ui, and every addon except the private @bakers-build/addon-fake, which is a test fixture. The set is discovered from the workspace, never listed by hand: every package that is not marked "private": true is published, in the order of its workspace dependencies.
To reproduce what npm users get, build first, then run the gate.
sh
pnpm -r run build
pnpm run verify:packageThe gate stages a fresh manifest per package, packs each one, installs the whole set into a throwaway project with plain npm install, and asserts that:
- no published manifest ships a
scriptsblock; bakers --helpworks and lists the command plugins;bakers deployment tickets --helpmounts from its own package;- the
configcommands work on a broken checkout; - an engine config and a connection config resolve their addons;
bakers ui --print-configruns on plain Node.
It needs network access to the npm registry. pnpm run prepare:publish alone writes the manifests into each package's publish/ folder, with every workspace: dependency rewritten to the release version. Publishing is CI's job: on a v tag it builds, type-checks, tests and verifies, then runs pnpm run release:semver. Do not run the release scripts from a laptop.
Troubleshooting
ERR_MODULE_NOT_FOUNDfor@bakers-build/bakers, an addon or@dropsh/*. The resolution farm or a build is missing or stale. Re-run the bootstrap, or rebuild as shown above.- The bootstrap stops at the addon build with a
TS2307error naming@bakers-build/addon-name-refs. It builds the addons in directory order, andessentialscomes beforename-refs, which it needs. Build once with the recursive command instead, then run the bootstrap again:cd bakers-cli && pnpm install && pnpm -r run build. bakers: command not found.~/.local/binis not on the PATH; use theexportline above.- `bakers: test workspace ... names checkout ..., which is not built. This is deliberate. The message prints the rebuild command to run.
bakers: no global bakers on PATH, and no .bakers-testbuild workspace above .... You are outside every test workspace and have no global CLI. Install@bakers-build/bakersor call./bakers-cli/bin/bakers.- A bare
bakersruns the released CLI inside your clone. That is the rule, not a fault. Call./bakers-cli/bin/bakersto run your build.
For connecting, signing in and migrating configuration, see Install and sign in and Connect a project by hand.