Skip to main content

Buf CLI distributed via PyPI

Project description

The Buf logo

Buf

License Release CI Docker Homebrew Slack

Buf is the modern toolchain for Protobuf. It replaces day-to-day protoc use with a fast compiler, module-aware workspaces, formatting, linting, breaking-change detection, code generation, dependency management, API calls, and a client for the Buf Schema Registry.

If you are still driving Protobuf with shell scripts around protoc -I ..., Buf is the upgrade you want: the same schema language, the same generated-code plugin model, fewer moving parts, and a direct path from local .proto files to governed, versioned APIs.

Start

Install buf with Homebrew:

brew install bufbuild/buf/buf

Initialize a workspace and run the checks you should expect every Protobuf repository to pass:

buf config init
buf build
buf format -w
buf lint
buf breaking --against '.git#branch=main'

Generate code from a checked-in buf.gen.yaml instead of a hand-maintained shell command:

buf generate

For a guided walkthrough from an empty workspace to a working Connect service, run the Buf CLI quickstart.

Why Buf wins

Protobuf work With protoc and scripts With Buf
Finding files Maintain -I paths and hope import order does not change behavior. Declare modules once in buf.yaml; Buf discovers files and rejects ambiguous imports.
Compiling Manage a local protoc install and parse changing stderr output. Use Buf's internal compiler, tested against protoc descriptor output and built for deterministic parallel compilation.
Style Rely on review comments or separate tooling. Run buf lint locally, in editors, in CI, and on the BSR with 40+ built-in rules plus custom plugins.
Compatibility Find breakage after generated code fails, clients fail, or serialized data becomes unreadable. Run buf breaking against Git, a BSR module, a tarball, a zip file, or a Buf image before merge.
Code generation Keep plugin binaries installed on every machine and encode behavior in long commands. Put plugins, outputs, options, inputs, and managed-mode settings in buf.gen.yaml; use local or remote plugins.
Dependencies Copy .proto files between repositories or vendor them by hand. Declare BSR module dependencies in buf.yaml and pin them in buf.lock.
API consumers Send people your schemas and generation instructions. Publish to the BSR and let consumers install generated SDKs with go get, npm install, Maven, Gradle, pip install, NuGet, Cargo, SwiftPM, CMake, or an archive.
Governance Reimplement checks in every repository and hope every team keeps them enabled. Enforce breaking-change, uniqueness, and custom policies at the BSR layer.

Core CLI features work without a BSR account. Signing in to the registry adds distribution, remote plugins, generated SDKs, hosted docs, dependency resolution for private modules, and server-side checks when you need them.

Core workflow

Buf treats a directory tree of .proto files as a module, and a project as a workspace. A small buf.yaml is enough to make build, lint, breaking-change detection, generation, dependency resolution, and publishing agree on the same input.

version: v2
modules:
  - path: proto
lint:
  use:
    - STANDARD
breaking:
  use:
    - FILE

From there, the useful commands are deliberately boring:

buf build
buf format -w
buf lint
buf breaking --against '.git#branch=main'
buf generate
buf push

buf build compiles the workspace. buf lint catches API-shape problems while the author is still editing. buf breaking compares the current schema against a previous version and flags source, JSON, or wire-format incompatibilities. buf generate runs protoc plugins from a checked-in template. buf push publishes named modules to the BSR.

Code generation

buf generate is compatible with the normal protoc plugin model, but it moves generation into versioned configuration. This example generates Go Protobuf types and ConnectRPC handlers from proto/ using remote plugins hosted on the BSR:

version: v2
clean: true
managed:
  enabled: true
  override:
    - file_option: go_package_prefix
      value: github.com/acme/weather/gen/go
plugins:
  - remote: buf.build/protocolbuffers/go
    out: gen/go
    opt: paths=source_relative
  - remote: buf.build/connectrpc/gosimple
    out: gen/go
    opt:
      - paths=source_relative
      - simple
inputs:
  - directory: proto

Remote plugins remove the need to install and maintain generator binaries on every developer machine or CI runner. Managed mode lets API producers keep language-specific file options out of .proto files while consumers still get correct generated package names for their target language.

Local plugins work too. If a plugin speaks the standard Protobuf plugin protocol, Buf can run it.

Breaking changes

Protobuf compatibility is not one thing. Renaming a field can break generated source code while preserving the binary wire format; changing a field from int32 to string breaks every existing serialized message. buf breaking makes that distinction explicit with rule categories for FILE, PACKAGE, WIRE_JSON, and WIRE compatibility.

buf breaking --against '.git#branch=main'

--against accepts a Git branch, a BSR module, a tarball, a zip file, a local directory, or a prebuilt Buf image. That matters in real repositories: the same command works on a laptop, in CI, and in release automation.

Buf Schema Registry

Buf Schema Registry is a Protobuf-aware registry. It stores modules, verifies they compile, renders documentation, resolves dependencies, hosts remote plugins, produces generated SDKs, and can enforce schema checks before a breaking change reaches consumers.

buf push

Pushing a module to the BSR gives your organization a source of truth for Protobuf APIs. Consumers can depend on the schema as a BSR module, install generated SDKs from their normal package manager, or use the BSR docs to inspect services, messages, fields, enums, references, and historical commits.

Related projects

Buf is most useful when schemas drive more than code generation. ConnectRPC uses Protobuf schemas to build simple HTTP APIs that support Connect, gRPC, and gRPC-Web without separate service definitions. Protobuf-ES gives JavaScript and TypeScript users a modern Protobuf runtime and generator. Protovalidate puts validation rules in the schema and runs them consistently across languages.

One contract should drive the whole workflow: compile, lint, compatibility checks, generated clients and servers, validation, API calls, package publishing, and governed changes.

Installation

Homebrew installs the buf, protoc-gen-buf-breaking, and protoc-gen-buf-lint binaries, plus shell completion scripts for Bash, Fish, PowerShell, and zsh.

brew install bufbuild/buf/buf

Other supported installation methods include npm, Windows, Docker, binary downloads, tarballs, source builds, and minisign verification. See the installation docs for the full list.

CLI stability

Buf CLI releases do not make breaking changes within a major version. Since buf reached v1.0, you can expect no breaking changes until v2.0. We have no plans to release v2.0.

This policy does not apply to commands behind the buf beta gate. Expect breaking changes for beta commands until they are promoted.

Documentation

Community

For help and discussion around Protobuf, best practices, and Buf, join us on Slack.

For bugs, feature requests, and technical questions, open an issue in this repository or email dev@buf.build. For general inquiries, email info@buf.build.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

buf_bin-1.71.0-py3-none-win_arm64.whl (14.6 MB view details)

Uploaded Python 3Windows ARM64

buf_bin-1.71.0-py3-none-win_amd64.whl (16.4 MB view details)

Uploaded Python 3Windows x86-64

buf_bin-1.71.0-py3-none-manylinux_2_17_riscv64.musllinux_1_2_riscv64.whl (14.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ riscv64musllinux: musl 1.2+ riscv64

buf_bin-1.71.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.musllinux_1_1_x86_64.whl (16.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64musllinux: musl 1.1+ x86-64

buf_bin-1.71.0-py3-none-manylinux2014_s390x.manylinux_2_17_s390x.musllinux_1_1_s390x.whl (15.5 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ s390xmusllinux: musl 1.1+ s390x

buf_bin-1.71.0-py3-none-manylinux2014_ppc64le.manylinux_2_17_ppc64le.musllinux_1_1_ppc64le.whl (14.2 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ppc64lemusllinux: musl 1.1+ ppc64le

buf_bin-1.71.0-py3-none-manylinux2014_armv7l.manylinux_2_17_armv7l.musllinux_1_1_armv7l.whl (14.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARMv7lmusllinux: musl 1.1+ ARMv7l

buf_bin-1.71.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.musllinux_1_1_aarch64.whl (14.5 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64musllinux: musl 1.1+ ARM64

buf_bin-1.71.0-py3-none-macosx_11_0_x86_64.whl (16.5 MB view details)

Uploaded Python 3macOS 11.0+ x86-64

buf_bin-1.71.0-py3-none-macosx_11_0_arm64.whl (15.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file buf_bin-1.71.0-py3-none-win_arm64.whl.

File metadata

  • Download URL: buf_bin-1.71.0-py3-none-win_arm64.whl
  • Upload date:
  • Size: 14.6 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for buf_bin-1.71.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 5172e2068819c2954fe5626fa02aaeeb1b631f0e154ef24dadfeff14f12f547a
MD5 5a9db886d0357efa70e32fab001fd9cf
BLAKE2b-256 010177553cba45fe4a769fb6fa44ee25961580b87a95fb47c95f2638bd8cf145

See more details on using hashes here.

Provenance

The following attestation bundles were made for buf_bin-1.71.0-py3-none-win_arm64.whl:

Publisher: pypi-publish.yaml on bufbuild/buf-pypi-publish

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file buf_bin-1.71.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: buf_bin-1.71.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 16.4 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for buf_bin-1.71.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 bb815768b2b86a17bcf6897995d06fb33f465cc67e7e1fd4298365617e91e50c
MD5 6bb9d745b66da40df17ce8c132b0236f
BLAKE2b-256 97a4c071c15b1419960e3f7f2c06628d092c0b1166b97a3ac335c4f8e50cfe55

See more details on using hashes here.

Provenance

The following attestation bundles were made for buf_bin-1.71.0-py3-none-win_amd64.whl:

Publisher: pypi-publish.yaml on bufbuild/buf-pypi-publish

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file buf_bin-1.71.0-py3-none-manylinux_2_17_riscv64.musllinux_1_2_riscv64.whl.

File metadata

File hashes

Hashes for buf_bin-1.71.0-py3-none-manylinux_2_17_riscv64.musllinux_1_2_riscv64.whl
Algorithm Hash digest
SHA256 0ab282c3f0c7e4b02130ad54fa0be6896a1b44210bca181d6e6cc8006e2825c3
MD5 09611a39a3094bbafeff3128bf983dae
BLAKE2b-256 55f7e3af059c0840ea70bdcd04237403fe12d5ba1c56166cdee21e03bc227844

See more details on using hashes here.

Provenance

The following attestation bundles were made for buf_bin-1.71.0-py3-none-manylinux_2_17_riscv64.musllinux_1_2_riscv64.whl:

Publisher: pypi-publish.yaml on bufbuild/buf-pypi-publish

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file buf_bin-1.71.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for buf_bin-1.71.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 7f584ebfea1b3e2d3dfa20487255bbce8af1b624fc4aa881652429acd9b72329
MD5 f5ae2b4c0beeb2b32a46426c28bc6e57
BLAKE2b-256 89698ec0f2341c663a20fa9a84a88830952812e7b3362a447e21f38e51bf0eee

See more details on using hashes here.

Provenance

The following attestation bundles were made for buf_bin-1.71.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.musllinux_1_1_x86_64.whl:

Publisher: pypi-publish.yaml on bufbuild/buf-pypi-publish

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file buf_bin-1.71.0-py3-none-manylinux2014_s390x.manylinux_2_17_s390x.musllinux_1_1_s390x.whl.

File metadata

File hashes

Hashes for buf_bin-1.71.0-py3-none-manylinux2014_s390x.manylinux_2_17_s390x.musllinux_1_1_s390x.whl
Algorithm Hash digest
SHA256 187a766486877932e3bbeafe1e027d8dca1cca13463b62c4e4cdd3e971ed7354
MD5 fc4bdd2e6e415e1ee41dbb7166b442ba
BLAKE2b-256 123aedaac8bfccec34dd701edf5c9246d7d9bbbae70ce335f365bf04b8509ea1

See more details on using hashes here.

Provenance

The following attestation bundles were made for buf_bin-1.71.0-py3-none-manylinux2014_s390x.manylinux_2_17_s390x.musllinux_1_1_s390x.whl:

Publisher: pypi-publish.yaml on bufbuild/buf-pypi-publish

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file buf_bin-1.71.0-py3-none-manylinux2014_ppc64le.manylinux_2_17_ppc64le.musllinux_1_1_ppc64le.whl.

File metadata

File hashes

Hashes for buf_bin-1.71.0-py3-none-manylinux2014_ppc64le.manylinux_2_17_ppc64le.musllinux_1_1_ppc64le.whl
Algorithm Hash digest
SHA256 ec8f577bc27cbe430c1553afec966d62a004c75a94806eb5f69b5e71f32dd65c
MD5 ac990e721eda9899ecc5a6e6e7aafcff
BLAKE2b-256 ee065fca974b1ca94219a1b494774fa36996f6b05fc58f2cf995b61622176a4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for buf_bin-1.71.0-py3-none-manylinux2014_ppc64le.manylinux_2_17_ppc64le.musllinux_1_1_ppc64le.whl:

Publisher: pypi-publish.yaml on bufbuild/buf-pypi-publish

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file buf_bin-1.71.0-py3-none-manylinux2014_armv7l.manylinux_2_17_armv7l.musllinux_1_1_armv7l.whl.

File metadata

File hashes

Hashes for buf_bin-1.71.0-py3-none-manylinux2014_armv7l.manylinux_2_17_armv7l.musllinux_1_1_armv7l.whl
Algorithm Hash digest
SHA256 ddd89de0a29910a0d1d0049ec9cf6085b3c41a21f54fe11842932f90c0b652c3
MD5 ac8ccc43f1510a559a9a8555a6a3ea70
BLAKE2b-256 407f7d85a957fabcba1533287d7c7c264c7d641fac9a6d274c749789ac300de0

See more details on using hashes here.

Provenance

The following attestation bundles were made for buf_bin-1.71.0-py3-none-manylinux2014_armv7l.manylinux_2_17_armv7l.musllinux_1_1_armv7l.whl:

Publisher: pypi-publish.yaml on bufbuild/buf-pypi-publish

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file buf_bin-1.71.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.musllinux_1_1_aarch64.whl.

File metadata

File hashes

Hashes for buf_bin-1.71.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 cd03ef27d6874407baf27fd83359223941c514a5c7c6c8f0116c47d8030c2ae3
MD5 e0495b7088ead6b9de4984bbfd0a590b
BLAKE2b-256 f8aecaea3914db4c7e9e19e5bc87f4ad1d5d5d6dead6ee51f6abb33699b1042c

See more details on using hashes here.

Provenance

The following attestation bundles were made for buf_bin-1.71.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.musllinux_1_1_aarch64.whl:

Publisher: pypi-publish.yaml on bufbuild/buf-pypi-publish

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file buf_bin-1.71.0-py3-none-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for buf_bin-1.71.0-py3-none-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 3da45766828c277deb8f7b299890c92c83c15c05edc59e109b015f55865b2685
MD5 920a382e54db57f2d9ee8ac1c1abfa2b
BLAKE2b-256 a2a15365d82d3e43b39a1a0fc5b82a1266733cf4dd8c0347c863df724e7b283c

See more details on using hashes here.

Provenance

The following attestation bundles were made for buf_bin-1.71.0-py3-none-macosx_11_0_x86_64.whl:

Publisher: pypi-publish.yaml on bufbuild/buf-pypi-publish

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file buf_bin-1.71.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for buf_bin-1.71.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b12c5400f23c0279f14be83a226dad4db369cabab15b3a8172c935f7601966be
MD5 129c3c41c1b4bcf25cff8ed20b17f9fe
BLAKE2b-256 1129a5437ab4f63c0fea0ff02f4c8a876f282740dcbcc51e4c641e1519b8c302

See more details on using hashes here.

Provenance

The following attestation bundles were made for buf_bin-1.71.0-py3-none-macosx_11_0_arm64.whl:

Publisher: pypi-publish.yaml on bufbuild/buf-pypi-publish

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page