explaingit

bufbuild/buf

11,111GoAudience · developerComplexity · 3/5Setup · moderate

TLDR

Buf is a CLI tool for Protocol Buffers that lints API definitions, detects breaking changes, generates code, and formats .proto files in one fast tool.

Mindmap

mindmap
  root((buf))
    What it does
      Lint proto files
      Detect breaking changes
      Generate code
      Format files
    Key features
      Fast parallel compile
      Breaking change detector
      Multi-language codegen
    Setup
      Homebrew npm Docker
      buf.yaml config
    Optional cloud
      Buf Schema Registry
      Schema versioning
      Cross-team sharing
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Lint .proto files to catch bad API design before code review

USE CASE 2

Detect breaking changes in Protobuf API definitions before deploying to prevent client breakage

USE CASE 3

Generate client and server code from .proto files across multiple programming languages

USE CASE 4

Share and version Protobuf schemas across teams using the optional Buf Schema Registry

Tech stack

GoDockerHomebrewnpm

Getting it running

Difficulty · moderate Time to first run · 30min

Requires existing .proto files and familiarity with Protocol Buffers concepts to use effectively.

In plain English

Buf is a command-line tool for working with Protocol Buffers, which is a format for defining the structure of data and the shape of APIs. When software systems need to talk to each other over a network, they need to agree on a common format. Protocol Buffers (often called Protobuf) is a widely used way to define that format in a structured file, and those definitions then get turned into code in whatever programming language the team uses. The challenge has historically been that the tooling around Protobuf was awkward to set up and use. Buf addresses that by providing a single tool that handles the most common tasks: checking that your API definitions follow good design practices, catching changes that would break existing clients, generating code from your definitions, and formatting definition files consistently. These are the kinds of checks that teams otherwise have to set up manually or skip entirely. One specific feature worth noting is the breaking change detector. When you update an API definition, Buf can compare the new version against the old one and flag any changes that would cause existing code depending on that API to stop working. This is useful for teams that maintain APIs used by other teams or external developers. Buf also connects to a cloud service called the Buf Schema Registry, which is a hosted place to store and share Protobuf definitions across teams or organizations. Using the registry is optional, the core command-line features work without it. The tool runs on Linux, Mac, and Windows, and can be installed via package managers like Homebrew or npm, or as a Docker image. It is built with speed as a priority, compiling Protobuf sources faster than the standard compiler by using all available CPU cores.

Copy-paste prompts

Prompt 1
Show me how to set up buf in a project with a buf.yaml config and run a lint check on my .proto files
Prompt 2
How do I use buf breaking to compare my updated API against the previous version and flag any breaking changes?
Prompt 3
How do I configure buf to generate Go and TypeScript client code from .proto files in a single command?
Prompt 4
How do I add buf lint and buf breaking checks to a GitHub Actions CI pipeline?
Prompt 5
How do I publish my Protobuf schemas to the Buf Schema Registry so other teams can depend on them?
Open on GitHub → Explain another repo

← bufbuild on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.