Buck2
$ buck2 Official Low RiskBuck2 (buck2) is Meta's open-source, Rust-powered polyglot build and test system built with Starlark rules and an async incremental daemon (dice). It provides strong agent ergonomics including buck2 targets --json, --json-lines, buck2 cquery --json, and --console=none.
https://github.com/facebook/buck2/releases buck2 evaluates Starlark build graphs locally via its Rust daemon and runs incremental builds/tests directly in the workspace.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
First-class buck2 targets --json, --json-lines, buck2 cquery --output-attribute ... --json, and --console=none / --console=simple to disable superconsole ANSI UI.
buck2 targets --jsonandbuck2 cquery --jsonemit structured graph JSON--console=none/--console=simpleeliminates dynamic TUI progress redraws
Hermetic action execution model, Starlark deterministic configuration, and build artifacts isolated under buck-out/.
- Hermetic build graph outputs stay isolated inside
buck-out/
Single Rust binary across macOS, Linux, and Windows, though not packaged in core Homebrew formulas (installed via GitHub releases or Nix/dotslash).
- Distributed via GitHub release tarballs rather than Homebrew core
Ultra-fast Rust daemon (dice) incremental graph evaluation and optional remote execution/caching scale to massive polyglot monorepos.
- Parallel incremental Rust build graph engine
Official Meta open-source project (facebook/buck2) dual-licensed MIT/Apache-2.0.
- Official Meta repository (
facebook/buck2)
Comprehensive official docs at buck2.build/docs/ covering queries, Starlark prelude, and CLI options.
- Official documentation at buck2.build/docs
Security, Auth & Guardrails
Local builds need no auth; optional remote execution (REAPI) reads TLS certs or tokens configured in .buckconfig / environment.
MIT OR Apache-2.0 open-source CLI; free to use locally (remote execution infra is optional).
# Buck2 (buck2) Agent Rules - Always pass `--console=none` or `--console=simple` to suppress Buck2's dynamic superconsole. - Use `buck2 targets --json` or `buck2 cquery --output-attribute <attr> --json` to inspect targets before running builds.
Agent-Ready Command Recipes
Safe Read-Only Queries
buck2 targets //app/... --json --console=none
Queries unconfigured targets under //app/... and outputs structured JSON without UI redraws.
buck2 cquery "//app/..." --output-attribute name --output-attribute srcs --json --console=none
Evaluates configured target attributes with field projection in JSON.
Controlled Writes & Previews
buck2 test //app/... --console=simple
Executes incremental target builds and tests using simple non-ANSI line output.
Strengths for Agents
- +
buck2 targets --jsonandbuck2 cquery --output-attribute ... --jsonprovide crisp target graph introspection. - +
--console=none/--console=simplecleanly suppresses Buck2's dynamic TUI superconsole. - + Hermetic Starlark build rules and fast Rust incremental daemon.
Caveats & Pitfalls
- ! Background
buck2daemon persists across invocations (stop withbuck2 killif cleaning up sandboxes). - ! Steeper initial setup and prelude configuration than Cargo or CMake for small repos.