Brex — a compilable instruction language for AI coding agents.
Write a spec → get IR + Markdown prompts + policy.
Read the glossary first, then the guides.
| Language | Start here |
|---|---|
| Русский | Глоссарий · старт · индекс |
| English | Glossary · start · index |
Hub: docs/README.md
cargo install --path crates/brex-cli
brex --versionThe binary lands in ~/.cargo/bin. If the shell says brex: command not found, put it on PATH:
export PATH="$HOME/.cargo/bin:$PATH" # bash/zsh (add to ~/.bashrc or ~/.zshrc)
fish_add_path ~/.cargo/bin # fishOn Windows cargo uses %USERPROFILE%\.cargo\bin. Optional: brex completions <shell> prints a completion script to stdout.
Binaries for linux/mac/windows are in GitHub Releases (workflow .github/workflows/release.yml, tag v*). Change history: CHANGELOG.md.
brex update # pull (ff-only) + show new commits + cargo install the fresh CLIUnlike plain git pull, brex update refuses on a dirty tree, prints what came in, and rebuilds the binary (--no-rebuild to skip). If you prefer manual control: git pull && cargo install --path crates/brex-cli.
brex init -t web-api
brex build
brex doctor
brex explain scaffoldTemplates: brex packs. Std packs: brex add security.
Or use an example:
brex build examples/simple/project.brex -o out/simple
brex list examples/simple/project.brexPROJECT "hello-cli";
DESC "CLI that greets you";
STACK "rust", "clap";
ROLE "Senior backend developer";
CAN "code", "tests";
RULE "Write tests";
GOAL "Has --help and hello";
FILE "app" "src/main.rs";
TASK "bootstrap";
USE "senior_backend_developer";
MAKE "app";
SAY "Build a clap CLI with a hello command";
POLE = ROLE. Full dictionary: docs/en/LANGUAGE.md / docs/ru/LANGUAGE.md.
brex init [name] [-t default|cli|web-api|monorepo]
brex packs · add <pack> · completions · update
brex check · build · schema · policy · dump-ir
brex run · explain · list · score · graph · fmt · diff
brex blame · drift · replay · allow · hook · doctor
Flags: -o out, --emit ir|md|policy|schema|all, --prompt-style generic|cursor|claude.
examples/simple— simple syntaxexamples/shop-api— block formexamples/policy-hook— policy enforcement referenceexamples/zones-ns— import namespaces + write zones