The bufā CLI is a tool for working with Protocol Buffersā .
You can install buf using Homebrewā (macOS or Linux):
brew install bufbuild/buf/buf
This installs:
buf, protoc-gen-buf-breakingā , and protoc-gen-buf-lintā binariesFor other installation methods, see our official documentationā , which covers:
buf via npmā buf on Windowsā buf as a Docker imageā 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 betagate, 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.
Bufā 's goal is to replace the current paradigm of API development, centered around REST/JSON, with a schema-driven paradigm. Defining APIs using an IDLā provides numerous benefits over REST/JSON, and Protobufā is by far the most stable and widely adopted IDL in the industry. We've chosen to build on this widely trusted foundation rather than creating a new IDL from scratch.
But despite its technical merits, actually using Protobuf has long been more challenging than it needs to be. The Buf CLI and the BSRā are the cornerstones of our effort to change that for good and to make Protobuf reliable and easy to use for service owners and clients alikeāin other words, to create a modern Protobuf ecosystem.
While we intend to incrementally improve on the buf CLI and the BSRā , we're confident that the basic groundwork for such an ecosystem is already in place.
The Buf Schema Registryā (BSR) is a SaaS platform for managing your Protobuf APIs. It provides a centralized registry and a single source of truth for all of your Protobuf assets, including not just your .proto files but also remote pluginsā . Although the BSR provides an intuitive browser UI, buf enables you to perform most BSR-related tasks from the command line, such as pushingā Protobuf sources to the registry and managing usersā and repositoriesā .
The BSR is not required to use
buf. We've made the core featuresā of thebufCLI available to all Protobuf users.
While buf's core featuresā should cover most use cases, we've included some more advanced features to cover edge cases:
.proto files in accordance with your supplied build configurationā , which means that you no longer need to manually specify --proto_paths. You can still, however, specify .proto files manually through CLI flags in cases where file discovery needs to be disabled.buf outputs information in file:line:column:message form by default for each lint error and breaking change it encounters, but you can also select JSON and, in the near future, JUnit output.buf's granular error output. We currently provide linting integrations for both Vim and Visual Studio Codeā but we plan to support other editors, such as Emacs and JetBrains IDEsā like IntelliJ and GoLand, in the future..proto files but also against a broad range of other Inputsā , such as tarballs and ZIP files, remote Git repositories, and pre-built imageā files.protoc. This allows for near-instantaneous feedback, which is of special importance for features like editor integrationā .Once you've installed buf, we recommend completing the Tour of Bufā , which provides a broad but hands-on overview of the core functionality of both the CLI and the BSRā . The tour takes about 10 minutes to complete.
After completing the tour, check out the remainder of the docsā for your specific areas of interest.
For help and discussion around Protobuf, best practices, and more, join us on Slackā .
For updates on the Buf CLI, follow this repo on GitHubā .
For feature requests, bugs, or technical questions, email us at [email protected]ā . For general inquiries or inclusion in our upcoming feature betas, email us at [email protected]ā .
Content type
Image
Digest
sha256:927c45fb3ā¦
Size
27.1 MB
Last updated
4 days ago
docker pull bufbuild/buf:edge