Skip to content

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.

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)”
Terminal window
# 1. Clone the repository
git clone <repository-url> contextbrew
cd contextbrew
# 2. Install dependencies (Bun)
bun install
# 3. Build the CLI
cd apps/cli
bun run build # bundles src/index.ts → dist/index.js
# 4. Run it directly
node dist/index.js --version
# 5. Optional: put the ctxbrew / ctx / contextbrew commands on your PATH
bun link # links this package (per package.json `bin`) globally
ctxbrew --version

After bun link, all three command names point at the same binary: ctxbrew (primary brand), ctx (power-user shortcut), and contextbrew (full name).

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.

Terminal window
# Not available yet — no tap exists. Placeholder shown only so you
# recognize it when it ships:
# brew install contextbrew

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.

Terminal window
# After `bun link`:
ctxbrew --version
ctx --version
contextbrew --version
# Or without linking, from apps/cli/:
node dist/index.js --version

Once installed, the primary commands are:

Terminal window
ctxbrew init --name <name> # Create a new project
ctx 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 artifacts
ctxbrew recipe create # Create a recipe from models
ctxbrew recipe export # Export recipe for AI agents
ctxbrew recipe init # Version-control recipes on a Recipe Server

For the full command reference, see the CLI Reference.

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 for bash, zsh, fish, powershell, or elvish. Redirect it into your shell’s completion directory, for example ~/.config/fish/completions/ctxbrew.fish for fish.
  • man — generate the man page into an output directory (default ./man).

Restart your shell after installing completions.

With the from-source install, update by pulling and rebuilding:

Terminal window
git pull
bun install
cd apps/cli && bun run build

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.