The Buf CLI

Generate code, prevent breaking changes, lint Protobuf schemas, enforce best practices, and invoke APIs with the Buf CLI.

Protobuf API management made easy

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.

Safely evolve APIs across platforms

Validates API changes both locally and in CI.

Worry-free code generation

No need to manage compiler versions and plugins.

Consistency & best practices

Automatically reformat files to correct violations.

Invoke gRPC and Connect APIs with ease

Call gRPC and Connect APIs using Buf's cURL-like interface.

Your one-stop shop

Generate code
2x faster than protoc while offering better clarity (easily edit/reference from source control) and greater flexibility (more input types).
Detect breaking changes
Evolve schemas without breaking existing code. Buf's breaking change rules maximize your evolution options to do exactly that.
Lint Protobuf files
npm install, go get, or cargo add buf.build/acme/users and you’re done. No protoc setup, no plugin configuration, no “works on my machine” problems.
Format Protobuf files
Reformat your Protobuf files according to best practices for file layout and style, so you can focus on more business-critical problems.
Call Protobuf APIs
Better usability than standard curl. The buf curl command handles aspects of the relevant protocol for you — no need to define headers and craft message envelopes.
Build your Protobuf schema
Compiles .proto files into a single binary file you can easily share and store so you can verify that an input successfully compiles.

Protobuf works better with Buf

Safely evolve your APIs across platforms

Ensure you never cause an outage by shipping a breaking, backward-incompatible change to production by using the Buf CLI to validate API changes both locally and in continuous integration (CI).

Learn more
$ buf breaking --against .git#branch=main
proto/acme/notification/v1/notification.proto:6:3:
Field "1" with name "id" on message "Notification"
changed type from "string" to "uint32".
$ buf generate
$ tree gen
gen
└── foobarcorp
   └── notification
       └── v1
           ├── notification_service.pb.go
           ├── notification.pb.go
           └── notificationv1connect
               └── notification_service.connect.go

Generate code without managing a Protobuf environment

Generate code locally using the Buf CLI or remotely in an isolated environment on the BSR without worrying about managing compiler versions and plugins.

‍Learn more

Enforce consistency and best practices

Guarantee best practices across all your APIs by running Buf's Protobuf linter and automatically reformatting files to correct violations.

‍Learn more
$ buf lint
proto/acme/notification/v1/notification.proto:7:10:
Field name "recipientId" should be
lower_snake_case, such as "recipient_id".
$ buf curl --data '{"sentence": "Hi, Eliza!"}' \
https://demo.connectrpc.com/\
connectrpc.eliza.v1.ElizaService/Say
{
  "sentence": "Hi there...how are you today?"
}

Invoke gRPC and Connect APIs with ease

Call your gRPC and Connect APIs using Buf's cURL-like interface which automatically handles headers and message-enveloping while providing a readable JSON representation of binary responses.

‍Explore the tool

Leverage the BSR from the command line

Interact with the Buf Schema Registry to push your schemas, create branches, and release tags — all from the CLI.

‍Learn more
$ buf registry module create \
  buf.build/your-organization/your-module
Created buf.build/your-organization/your-module.
$ buf push
buf.build/your-organization/your-module:0fb0f1

Get started with the Buf CLI

Put the all-in-one Protobuf toolchain to work. We’re here to help.