• Stars
    star
    8,960
  • Rank 4,048 (Top 0.08 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created about 5 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The best way of working with Protocol Buffers.

The Buf logo

Buf

License Release CI Docker Homebrew AUR Slack

The buf CLI is a tool for working with Protocol Buffers.

Installation

Homebrew

You can install buf using Homebrew (macOS or Linux):

brew install bufbuild/buf/buf

This installs:

Other methods

For other installation methods, see our official documentation, which covers:

Usage

Buf's help interface provides summaries for commands and flags:

buf --help

For more comprehensive usage information, consult Buf's documentation, especially these guides:

CLI breaking change policy

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 beta gate, and you should expect breaking changes to commands like buf beta registry. The policy does go into effect, however, when those commands or flags are elevated out of beta.

Our goals for Protobuf

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

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 the buf CLI available to all Protobuf users.

More advanced CLI features

While buf's core features should cover most use cases, we've included some more advanced features to cover edge cases:

  • Automatic file discovery. Buf walks your file tree and builds your .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.
  • Fine-grained rule configuration for linting and breaking changes. While we do have recommended defaults, you can always select the exact set of rules that your use case requires, with 40 lint rules and 53 breaking change rules available.
  • Configurable error formats for CLI output. 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.
  • Editor integration driven by 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.
  • Universal Input targeting. Buf enables you to perform actions like linting and breaking change detection not just against local .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.
  • Speed. Buf's internal Protobuf compiler compiles your Protobuf sources using all available cores without compromising deterministic output, which is considerably faster than protoc. This allows for near-instantaneous feedback, which is of special importance for features like editor integration.

Next steps

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.

Community

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].

More Repositories

1

protoc-gen-validate

Protocol Buffer Validation - Being replaced by github.com/bufbuild/protovalidate
Go
3,764
star
2

protobuf-es

Protocol Buffers for ECMAScript. The only JavaScript Protobuf library that is fully-compliant with Protobuf conformance tests.
TypeScript
1,114
star
3

connect-es

Connect, gRPC, and gRPC-Web support for Protobuf and TypeScript.
TypeScript
980
star
4

protovalidate

Protocol Buffer Validation - Go, Java, Python, and C++ Beta Releases!
Go
876
star
5

protovalidate-go

Protocol Buffer Validation for Go
Go
268
star
6

protocompile

A parsing/linking engine for protobuf; the guts for a pure Go replacement of protoc.
Go
228
star
7

knit

GraphQL-like capabilities to services using Protocol Buffers, gRPC, and Connect
Go
148
star
8

buf-language-server

Archived: LSP support is being built into the Buf CLI
Go
126
star
9

connect-query

TypeScript-first expansion pack for TanStack Query that gives you Protobuf superpowers
TypeScript
109
star
10

makego

Makefile setup for our Golang projects.
Makefile
100
star
11

connect-opentelemetry-go

OpenTelemetry tracing and metrics for Connect
Go
81
star
12

buf-examples

Example repository that uses Buf.
C#
73
star
13

connect-es-integration

Examples for using Connect with various TypeScript web frameworks and tooling
TypeScript
71
star
14

connect-demo

An example service built with Connect.
Go
66
star
15

vscode-buf

Visual Studio Code integration for Buf.
TypeScript
60
star
16

knit-go

Knit standalone gateway and Go embeddable gateway
Go
49
star
17

plugins

Remote Protobuf plugins available on the BSR
Dockerfile
49
star
18

connect-swift

Idiomatic gRPC & Connect RPCs for Swift.
Swift
48
star
19

buf-gradle-plugin

Gradle plugin for the Buf CLI
Kotlin
48
star
20

buf-tour

Go
48
star
21

rules_buf

Bazel rules for Buf.
Starlark
47
star
22

protoyaml-go

Marshal and unmarshal Protobuf as YAML with rich error messages.
Go
47
star
23

httplb

Client-side load balancing for net/http
Go
46
star
24

prototransform

Client library for Buf Reflection API, for transforming Protobuf data.
Go
45
star
25

connect-kotlin

Idiomatic gRPC & Connect RPCs for Kotlin.
Kotlin
42
star
26

buf-setup-action

TypeScript
40
star
27

connect-grpcreflect-go

gRPC-compatible server reflection for any net/http server.
Go
39
star
28

protovalidate-java

Protocol Buffer Validation for Java.
Java
37
star
29

protovalidate-python

Protocol Buffer Validation for Python.
Python
37
star
30

vim-buf

Vim integration for Buf.
Vim Script
35
star
31

connect-grpchealth-go

gRPC-compatible health checks for any net/http server.
Go
32
star
32

protoplugin

The missing library to write protoc plugins.
Go
29
star
33

buf-lint-action

TypeScript
28
star
34

buf-breaking-action

TypeScript
26
star
35

knit-ts

TypeScript client for Knit
TypeScript
25
star
36

protobuf.com

Buf's Guide to Protobuf. Home of the language spec and grammar for the Protobuf IDL.
CSS
25
star
37

connect-crosstest

Connect's gRPC and gRPC-Web interoperability test suite.
C++
23
star
38

protobuf-conformance

A repository running the Protobuf conformance tests against various libraries
TypeScript
23
star
39

modules

Collection of third-party modules managed and synced by Buf.
Go
20
star
40

bufstream-demo

A demo of Bufstream, a drop-in replacement for Apache Kafka that's 10x less expensive to operate
Go
20
star
41

protoschema-plugins

Protobuf plugins that generate various schemas from protobuf files - JSON Schema, PubSub, etc.
Go
20
star
42

registry-proto

BSR's new public API. Currently in development.
Makefile
18
star
43

intellij-buf

IntelliJ plugin for Buf
Kotlin
18
star
44

protovalidate-cc

Protocol Buffer Validation for C++.
C++
15
star
45

buf-push-action

Shell
15
star
46

buf-action

Build, format, lint, and check for breaking changes in your Protobuf schemas, and automatically publish to the Buf Schema Registry.
TypeScript
15
star
47

bufplugin-go

The Go library for plugins to the Buf platform.
Go
13
star
48

homebrew-buf

Homebrew tap for Buf.
Shell
12
star
49

docs.buf.build

The source for https://docs.buf.build.
TypeScript
11
star
50

tree-sitter-cel

Tree sitter grammar for the Common Expression Language (CEL)
C
10
star
51

wellknowntypes

All the Well-Known Types stored in per-version directories.
Go
9
star
52

connect-envoy-demo

Demonstration of how to use the new Connect-gRPC Envoy filter, available in Envoy v1.26+.
Go
8
star
53

knit-proto

Protocol definition for Knit
7
star
54

reflect-proto

Protobuf reflection API.
7
star
55

bufisk

Bazelisk, but for Buf. A user-friendly launcher for Buf.
Go
7
star
56

knit-demo

An example service built with Knit
Go
6
star
57

protobuf-language-spec

Comprehensive language specification for Protocol Buffers
6
star
58

tools

A collection of tools written at Buf.
JavaScript
5
star
59

confluent-proto

Proto definitions for integrating Confluent Schema Registry with the BSR
Makefile
4
star
60

jest-environment-jsdom

A modern jsdom test environment for Jest
TypeScript
4
star
61

base-workflows

Shared Github Actions for BufBuild Organization.
3
star
62

spdx-go

A simple Golang library that contains license information from SPDX.
Go
2
star
63

bufplugin

The APIs for plugins to the Buf platform.
Makefile
2
star
64

.github

1
star