Skip to content

Latest commit

 

History

History

README.md

The Buf logo

Buf CLI examples

The Buf CLI is a crucial tool for managing Protobuf schemas. This directory supplements its [documentation][documentation] with examples and quickstart code showing how to use its features for code generation, breaking change detection, and linting tasks.

Buf CLI quickstart

Quickstart code for the Buf CLI's Quickstart introduces you to key features of the Buf CLI, including setting up a local workspace, generating code, breaking change detection, and linting. It contains a start directory with a starting state and finish directory with a working solution.

Breaking change detection

Quickstart code for the breaking change detection quickstart provides a walkthrough of using Buf's breaking change detection to ensure that your organization can evolve Protobuf schemas quickly and safely. It contains a start directory with a starting state and finish directory with a working solution.

Linting

Quickstart code for the lint quickstart provides a walkthrough of checking for lint errors, customizing your lint configuration, and temporarily ignoring errors. It contains a start directory with a starting state and finish directory with a working solution.

Code generation

Local plugin execution

Example code for local plugin execution provides an example of code generation using local protoc plugins.

Remote plugin execution

Example code for remote plugin execution provides an example of code generation using plugins hosted on the Buf Schema Registry (BSR).

Managed mode

Example code for generating code stubs using managed mode provides an example of controlling file and field options without adding language-specific options to Protobuf files.

Limiting output types

Example code for the buf build command showing how to limit output types with --type.

Workspaces

Example code for the Buf CLI provides an example of using one buf.gen.yaml file to manage multiple modules of Protobuf files in one repository.