To verify that Buf can build your repository:
If you've followed this tour this command should have exit code 0 and no output.
buf image build command can be used:
- For verifying that your Protobuf files compile, as we did above.
- For storing the current state of your Protobuf files, for use with the breaking change detector. With the currently released feature set, this will be the primary use case of this command.
- As input to
An output location is required, but Buf stops short if you specify
/dev/null as the output location, and will stop short if
nul is specified on Windows when we
have Windows Support.
Images can be outputted in one of two formats:
Either format can be compressed using Gzip or Zstandard.
Buf parses the file extension to determine the output format, however the option
format can be
given to override this default behavior. The value
- is special-cased to mean stdout. See the
Input documentation for more details (however we recommend deferring this until the
end of the tour).
When combined with jq,
buf image build allows for introspection. For example, to see a list
of all packages:
To strip the Buf-specific metadata and only output a FileDescriptorSet:
However, we recommend outputting full Images as it helps Buf do it's job in other areas, and
Images are wire-compatible with FileDescriptorSets -
protoc will happily process Images
and ignore the extra metadata.