The buf
CLI is a tool for working with Protocol Buffers.
- The ability to manage Protobuf assets on the Buf Schema Registry (BSR).
- A linter that enforces good API design choices and structure.
- A breaking change detector that enforces compatibility at the source code or wire level.
- A generator that invokes your plugins based on configurable templates.
- A formatter that formats your Protobuf files in accordance with industry standards.
- Integration with the Buf Schema Registry, including full dependency management.
You can install buf
using Homebrew (macOS or Linux):
brew install bufbuild/buf/buf
This installs:
- The
buf
,protoc-gen-buf-breaking
, andprotoc-gen-buf-lint
binaries - Shell completion scripts for Bash, Fish, Powershell, and zsh
For other installation methods, see our official documentation, which covers:
- Installing
buf
via npm - Installing
buf
on Windows - Using
buf
as a Docker image - Installing as a binary, from a tarball, and from source through GitHub Releases
- Verifying releases using a minisign public key
Buf's help interface provides summaries for commands and flags:
buf --help
For more comprehensive usage information, consult Buf's documentation, especially these guides:
buf breaking
buf build
buf generate
buf lint
buf format
buf registry
(for using the BSR)
We will never make breaking changes within a given major version of the CLI. Once buf
reaches v1.0, you can expect no breaking changes until v2.0. But as we have no plans to ever release a v2.0, we will likely never break the buf
CLI.
This breaking change policy does not apply to commands behind the
buf beta
gate, and you should expect breaking changes to commands likebuf beta registry
. The policy does go into effect, however, when those commands or flags are elevated out of beta.