Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

The Buf logo

Local plugin execution

Note

You need to have the buf CLI installed to follow along with this example. You will also need to have protoc-gen-go and protoc-gen-rust installed locally.

This directory contains example code for Buf's code generation quickstart, where you can learn to generate code stubs from a Buf input using local Protobuf plugins.

Here, we'll use two locally installed plugins:

Plugin Language
protoc-gen-go Go
protoc-gen-rust Rust

Once those executables are installed, you can use the buf CLI, in conjunction with the configuration in buf.gen.yaml, to generate code stubs from any valid Buf input. Let's try it with the buf.build/buf-examples/observabilityapi module from the workspace example:

buf generate buf.build/buf-examples/observabilityapi

One drawback of this local plugin approach is that you need to install the executables on your own, make sure that they're on your PATH, and so on. To see how to generate code stubs without needing to install any plugins locally, see the remote plugin execution example project.