Installation
Installation
Section titled “Installation”ContextBrew’s CLI is not yet published to npm, Homebrew, or Docker Hub — the package is built and the release pipeline exists, but the public name claim and first publish are still pending. Today, install it from source.
System Requirements
Section titled “System Requirements”| Requirement | Minimum | Recommended |
|---|---|---|
| Runtime | Node.js 20+ (to run the build) | Bun 1.0+ (to build) |
| OS | macOS, Linux, Windows (WSL2) | macOS, Linux |
| Disk space | 100 MB | 200 MB |
| Memory | 512 MB | 1 GB |
Install from source (the only way that works today)
Section titled “Install from source (the only way that works today)”# 1. Clone the repositorygit clone <repository-url> contextbrewcd contextbrew
# 2. Install dependencies (Bun)bun install
# 3. Build the CLIcd apps/clibun run build # bundles src/index.ts → dist/index.js
# 4. Run it directlynode dist/index.js --version
# 5. Optional: put the ctxbrew / ctx / contextbrew commands on your PATHbun link # links this package (per package.json `bin`) globallyctxbrew --versionAfter bun link, all three command names point at the same binary:
ctxbrew (primary brand), ctx (power-user shortcut), and
contextbrew (full name).
Coming soon: npm / Bun global install
Section titled “Coming soon: npm / Bun global install”The package name and first public publish are not finalized yet, so
npm install -g … / bun add -g … instructions would be false advertising —
they will appear here as soon as the package is actually on npm.
Coming soon: Homebrew
Section titled “Coming soon: Homebrew”# Not available yet — no tap exists. Placeholder shown only so you# recognize it when it ships:# brew install contextbrewComing soon: Docker
Section titled “Coming soon: Docker”There is no published CLI image yet (docker pull contextbrew/cli would
fail today). If you want to self-host the full ContextBrew platform
(Studio, database, auth) rather than the CLI, a community one-command
Docker Compose path already exists — see the self-host guide.
Verify Installation
Section titled “Verify Installation”# After `bun link`:ctxbrew --versionctx --versioncontextbrew --version
# Or without linking, from apps/cli/:node dist/index.js --versionCLI Commands Overview
Section titled “CLI Commands Overview”Once installed, the primary commands are:
ctxbrew init --name <name> # Create a new projectctx ddd validate <file> # Validate a model file (per-format commands: # ddd, usm, cbrl, scm, dsm, sim, absl, c4, # context-map, esdm)ctxbrew generate # Generate tests and artifactsctxbrew recipe create # Create a recipe from modelsctxbrew recipe export # Export recipe for AI agentsctxbrew recipe init # Version-control recipes on a Recipe ServerFor the full command reference, see the CLI Reference.
Shell Completion
Section titled “Shell Completion”The TypeScript CLI (ctx / contextbrew) has no completion command.
The Rust CLI (built in-tree from the Cargo workspace under cli/,
binary also named ctxbrew; not yet published to crates.io) does — it
ships two commands the TypeScript side doesn’t have:
completions <shell>— emit a completion script forbash,zsh,fish,powershell, orelvish. Redirect it into your shell’s completion directory, for example~/.config/fish/completions/ctxbrew.fishfor fish.man— generate the man page into an output directory (default./man).
Restart your shell after installing completions.
Updating
Section titled “Updating”With the from-source install, update by pulling and rebuilding:
git pullbun installcd apps/cli && bun run buildTroubleshooting
Section titled “Troubleshooting”bun: command not found: Install Bun first — curl -fsSL https://bun.sh/install | bash.
Command not found after bun link: Ensure Bun’s global bin directory is on your PATH (typically ~/.bun/bin). Check with which bun.
node dist/index.js fails right after a pull: Re-run bun run build in apps/cli/ — dist/ is a build artifact, not committed.
Permission denied on macOS/Linux: Do not use sudo with global installs. Configure a user-owned prefix as shown in npm’s guide if you later switch to npm.
Next steps: Continue to Quick Start or First Project.
