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

Buf

$ buf Official Low Risk
Buf · Code & DevOps · Apache-2.0 · macos / linux / windows

Official Buf CLI replacing brittle protoc invocations with deterministic Protobuf linting, backward-compatibility breaking checks, formatting, and managed code generation. Native --error-format=json and buf format --diff --exit-code make Protobuf workflows reliable for agents.

FCRS-1.0 Score
95 /100
Excellent
Medium Confidence
Zero-Friction Install
brew install buf
CLI vs MCP Decision CLI Preferred vs MCP

Runs local Protobuf linting, breaking checks, and codegen directly in the workspace via buf.

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

First-class --error-format=json, buf format --diff --exit-code, buf config ls-lint-rules --format json, and predictable subcommands.

  • --error-format=json supported across lint, breaking, and build
  • buf format --diff --exit-code provides clean dry-run verification
Trust & Safety 23 / 25

Local lint, breaking, and format --diff are strictly read-only; remote buf push and local generate/format -w are explicit subcommands/flags.

  • Clear separation between read-only checks and -w / generate / push
Setup & Portability 15 / 15

Static Go binary distributed via Homebrew, npm, go install, Docker, and GitHub Releases.

  • Zero external protoc dependency required for linting and breaking checks
Utility & Efficiency 14 / 15

Replaces fragile protoc flag chains with reproducible buf.yaml / buf.gen.yaml workflows.

  • Fast Protobuf parsing, breaking-change detection, and remote/local codegen
Maintenance & Lineage 10 / 10

Official Buf CLI (bufbuild/buf) under Apache-2.0 license with active releases.

  • Official bufbuild/buf repository
Docs & Verifiability 9 / 10

Excellent CLI reference and rule catalog at buf.build/docs.

  • Official CLI reference at buf.build/docs/reference/cli/buf/

Security, Auth & Guardrails

Auth Modes
No Auth Env API Key Config File
Credential Storage

Offline for local lint/format/generate; optional Buf Schema Registry (BSR) credentials live in ~/.netrc or BUF_TOKEN.

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

Apache-2.0 open-source CLI; free locally (BSR private registry tiers are optional).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Buf (buf) Agent Rules
- Always pass `--error-format=json` to `buf lint` and `buf breaking`.
- Run `buf format --diff --exit-code` before `buf format -w`, and never push to BSR (`buf push`) without explicit user consent.

Agent-Ready Command Recipes

Safe Read-Only Queries

Lint Protobuf schemas with JSON error output
buf lint --error-format=json

Validates .proto files against buf.yaml rules and emits one JSON diagnostic per line.

Check backward compatibility against main branch
buf breaking --against '.git#branch=main' --error-format=json

Detects wire/source breaking .proto changes against main in JSON without modifying files.

Controlled Writes & Previews

Preview formatting diff then format .proto files
buf format --diff --exit-code && buf format -w

Checks formatting diff first and applies -w in-place formatting when desired.

Strengths for Agents

  • + Consistent --error-format=json across lint, breaking, and build with self-contained Protobuf compiler.
  • + Git-aware buf breaking --against '.git#branch=main' catches subtle wire-compatibility regressions.

Caveats & Pitfalls

  • ! Remote BSR dependencies or remote plugins in buf.gen.yaml require network access (and BUF_TOKEN for private modules).
  • ! buf.yaml v1 vs v2 config syntax differs slightly across older and newer repos.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI