Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Buck2

$ buck2 Official Low Risk
Meta · Code & DevOps · MIT OR Apache-2.0 · macos / linux / windows

Buck2 (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.

FCRS-1.0 Score
87 /100
Good
Medium Confidence
Zero-Friction Install
https://github.com/facebook/buck2/releases
CLI vs MCP Decision CLI Preferred vs MCP

buck2 evaluates Starlark build graphs locally via its Rust daemon and runs incremental builds/tests directly in the workspace.

Agent-Readiness Checklist

✓ JSON Output
✓ Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 22 / 25

First-class buck2 targets --json, --json-lines, buck2 cquery --output-attribute ... --json, and --console=none / --console=simple to disable superconsole ANSI UI.

  • buck2 targets --json and buck2 cquery --json emit structured graph JSON
  • --console=none / --console=simple eliminates dynamic TUI progress redraws
Trust & Safety 21 / 25

Hermetic action execution model, Starlark deterministic configuration, and build artifacts isolated under buck-out/.

  • Hermetic build graph outputs stay isolated inside buck-out/
Setup & Portability 12 / 15

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
Utility & Efficiency 14 / 15

Ultra-fast Rust daemon (dice) incremental graph evaluation and optional remote execution/caching scale to massive polyglot monorepos.

  • Parallel incremental Rust build graph engine
Maintenance & Lineage 9 / 10

Official Meta open-source project (facebook/buck2) dual-licensed MIT/Apache-2.0.

  • Official Meta repository (facebook/buck2)
Docs & Verifiability 9 / 10

Comprehensive official docs at buck2.build/docs/ covering queries, Starlark prelude, and CLI options.

  • Official documentation at buck2.build/docs

Security, Auth & Guardrails

Auth Modes
No Auth Config File Env API Key
Credential Storage

Local builds need no auth; optional remote execution (REAPI) reads TLS certs or tokens configured in .buckconfig / environment.

Side Effects
Read-Only Local Write Remote Write
Cost & Quotas

MIT OR Apache-2.0 open-source CLI; free to use locally (remote execution infra is optional).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

List build targets as JSON
buck2 targets //app/... --json --console=none

Queries unconfigured targets under //app/... and outputs structured JSON without UI redraws.

Run configured graph query with selected JSON attributes
buck2 cquery "//app/..." --output-attribute name --output-attribute srcs --json --console=none

Evaluates configured target attributes with field projection in JSON.

Controlled Writes & Previews

Build and test a target with clean console output
buck2 test //app/... --console=simple

Executes incremental target builds and tests using simple non-ANSI line output.

Strengths for Agents

  • + buck2 targets --json and buck2 cquery --output-attribute ... --json provide crisp target graph introspection.
  • + --console=none / --console=simple cleanly suppresses Buck2's dynamic TUI superconsole.
  • + Hermetic Starlark build rules and fast Rust incremental daemon.

Caveats & Pitfalls

  • ! Background buck2 daemon persists across invocations (stop with buck2 kill if cleaning up sandboxes).
  • ! Steeper initial setup and prelude configuration than Cargo or CMake for small repos.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI