gRPC

Buf does not provide any gRPC functionality directly. We feel such CLI functionality is better left to gRPC-specific tools for now, as they are concentrated on the specific issues associated with gRPC.

However, Buf can be useful when gRPC Reflection is not available on a server, which is the general case. Buf can provide FileDescriptorSets usable by gRPC CLI tools on the fly.

Use buf build to produce Images, which are FileDescriptorSets. See the build documentation for more details. The below commands assume you have a valid build.

grpcurl

We recommend using grpcurl for gRPC operations from the command line. We feel that grpcurl is the most reliable gRPC CLI tool while providing most necessary functionality. Additionally, grpcurl actually uses the same Protobuf library that Buf's internal compiler is derived from.

To use Buf-produced FileDescriptorSets with grpcurl on the fly:

$ grpcurl -protoset <(buf build -o -) ...

ghz

ghz is another CLI tool we can recommend. It has a host of features, including various output formats and benchmarking functionality.

To use Buf-produced FileDescriptorSets with ghz on the fly:

$ ghz --protoset <(buf build -o -) ...