Buf provides stub generation capability using it's high-performance, internal
buf generate uses a template file of the following shape:
By default, buf generate will look for a file of this shape named
buf.gen.yaml in your current directory. This can be thought of as a template
for the set of plugins you want to invoke.
The first argument is the source, module, or image to generate from. If no argument is specified, defaults to ".".
The paths in the template and the
-o flag will be interpreted as relative to your
current directory, so you can place your template files anywhere.
If you only want to generate stubs for a subset of your input, you can do so via the
Note that all paths must be contained within a root. For example, if you have the single
proto, you cannot specify
--path proto, however
--path proto/foo is allowed
proto/foo is contained within
Plugins are invoked in the order they are specified in the template, but each plugin
has a per-directory parallel invocation, with results from each invocation combined
before writing the result. This is equivalent behavior to
buf protoc --by_dir.