Skip to content

Install the Buf CLI

The Buf CLI is a developer tool that enables building and management of Protobuf APIs through the command line. It's easy to install, compatible with macOS, Windows, and Linux, and designed to improve the developer experience of working with Protobuf files. You can use the Buf CLI to:

  • Lint, format, and detect breaking changes in your Protobuf files
  • Generate code stubs for multiple languages
  • Manage dependencies on other Protobuf files
  • Integrate Protobuf management and maintenance with your workflow

To install the CLI, you can either use an installation script, or download and extract an archive file from the command line that corresponds to the version of your operating system.

You can install buf on macOS or Linux using Homebrew:

console
$ brew install bufbuild/buf/buf

This installs:

  • The binaries buf, protoc-gen-buf-breaking, protoc-gen-buf-lint.
  • Bash completion for buf.
  • Fish completion for buf.
  • Zsh completion for buf.

Next steps