Skip to content

Buf CLI#

The Buf CLI is the ultimate tool for modern, fast, and efficient Protobuf API management. It makes crucial tasks like code generation, breaking change detection, and linting easy to configure, and integrates seamlessly with your existing workflows, so you can focus on what matters most: writing great APIs.

Commands#

Buf's commands change Protobuf management from a chore into a workflow: generate code, safely evolve your schemas, test APIs, and collaborate with others through the Buf Schema Registry:

  • generate: Generate code stubs from Protobuf files using protoc plugins
  • breaking: Verify no breaking changes have been made, to guard against compatibility issues
  • lint : Lint your Protobuf files according to best practices
  • format: Format your Protobuf files for consistency
  • curl: Test your APIs by invoking an RPC endpoint, similar to using curl
  • convert: Convert a message from binary to JSON or vice versa—useful when debugging or testing
  • registry, push, and export: Manage your repositories in the Buf Schema Registry
  • config: Generate and manage Buf configuration files

See the Buf CLI reference for complete options and flags for each command.

Configuration#

The Buf CLI is configured through a few simple YAML files: buf.yaml for workspace and module settings, buf.gen.yaml for code generation, and buf.lock for dependency pinning. See the configuration reference for details.