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

Bazel

$ bazel Official Low Risk
Bazel Authors · Code & DevOps · Apache-2.0 · macos / linux / windows

Google's hermetic, reproducible build and test tool for large multi-language repositories. Provides expressive dependency query commands and --build_event_json_file structured JSON build events, though JVM server warm-up and verbose output require careful flag tuning.

FCRS-1.0 Score
83 /100
Good
Medium Confidence
Zero-Friction Install
brew install bazelisk
CLI vs MCP Decision CLI Only

Runs sandboxed local builds, dependency queries, and test suites directly against workspace BUILD files.

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 20 / 25

Supports aquery --output=jsonproto, --build_event_json_file, --color=no, and --noshow_progress, though stdout is chatty without flags.

  • bazel aquery --output=jsonproto emits JSON action graphs
  • --build_event_json_file writes structured BEP JSON
Trust & Safety 22 / 25

Hermetic sandboxing isolates build actions from host state and never mutates source files.

  • Sandboxed action execution prevents stray host writes
Setup & Portability 11 / 15

Heavy JVM server binary (bazelisk wrapper recommended) with slow cold startup and large disk cache (~/.cache/bazel).

  • Requires JVM server spin-up and substantial cache space
Utility & Efficiency 13 / 15

Unmatched incrementality and query power in massive polyglot monorepos.

  • bazel query / cquery / aquery analyze exact dependency graphs
Maintenance & Lineage 9 / 10

Official Google-led Apache-2.0 build system.

  • Active bazelbuild/bazel LTS releases
Docs & Verifiability 8 / 10

Detailed reference docs at bazel.build, though Starlark/Bzlmod rules have a steep learning curve.

  • Official docs at bazel.build/docs

Security, Auth & Guardrails

Auth Modes
No Auth Config File Service Account
Credential Storage

Local builds need no auth; remote caching/execution uses .netrc or Google credential helpers configured via .bazelrc.

Side Effects
Read-Only Local Write
Cost & Quotas

Apache-2.0 open-source CLI; completely free (optional remote build farms are separate infrastructure).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Bazel (bazel) Agent Rules
- Always pass `--color=no --noshow_progress` in agent shells to prevent noisy progress output.
- Use `bazel query` or `bazel aquery --output=jsonproto` before running broad `//...` builds.
- Prefer `--build_event_json_file` for parsing test/build outcomes reliably.

Agent-Ready Command Recipes

Safe Read-Only Queries

Query reverse dependencies of a target
bazel query 'rdeps(//..., //pkg/core:lib)' --output=label

Lists all targets depending on //pkg/core:lib without compiling anything.

Inspect action graph in JSON
bazel aquery //app:bin --output=jsonproto

Emits the exact build action graph and command lines as JSON.

Controlled Writes & Previews

Run tests with structured JSON Build Event output
bazel test //pkg/... --color=no --noshow_progress --build_event_json_file=/tmp/bep.json

Executes sandboxed tests cleanly without ANSI spinners and writes machine-readable Build Event Protocol JSON.

Strengths for Agents

  • + --build_event_json_file and aquery --output=jsonproto provide rich structured build telemetry.
  • + Hermetic sandboxing makes test/build results highly reproducible.
  • + bazel query discovers impacted targets before building.

Caveats & Pitfalls

  • ! Background JVM server startup and memory usage are heavy in constrained containers.
  • ! Default stderr progress bars spam agent context unless --noshow_progress --color=no is passed.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI