.nh .TH "Buf" "1" "2026-07-17" "Auto generated by spf13/cobra" "" .SH NAME buf-build - Build Protobuf files into a Buf image .SH SYNOPSIS \fBbuf build [flags]\fP .SH DESCRIPTION The first argument is the source or module to build or image to convert, which must be one of format [binpb,dir,git,json,mod,protofile,tar,txtpb,yaml,zip]. This defaults to "." if no argument is specified. .SH OPTIONS \fB--as-file-descriptor-set\fP[=false] Output as a google.protobuf.FileDescriptorSet instead of an image Note that images are wire compatible with FileDescriptorSets, but this flag strips the additional metadata added for Buf usage .PP \fB--config\fP="" The buf.yaml file or data to use for configuration .PP \fB--disable-symlinks\fP[=false] Do not follow symlinks when reading sources or configuration from the local filesystem By default, symlinks are followed in this CLI, but never followed on the Buf Schema Registry .PP \fB--error-format\fP="text" The format for build errors printed to stderr. Must be one of [text,json,msvs,junit,github-actions,gitlab-code-quality] .PP \fB--exclude-imports\fP[=false] Exclude imports. .PP \fB--exclude-path\fP=[] Exclude specific files or directories, e.g. "proto/a/a.proto", "proto/a" If specified multiple times, the union is taken .PP \fB--exclude-source-info\fP[=false] Exclude source info .PP \fB--exclude-source-retention-options\fP[=false] Exclude options whose retention is source .PP \fB-h\fP, \fB--help\fP[=false] help for build .PP \fB-o\fP, \fB--output\fP="/dev/null" The output location for the built image. Must be one of format [binpb,json,txtpb,yaml] .PP \fB--path\fP=[] Limit to specific files or directories, e.g. "proto/a/a.proto", "proto/a" If specified multiple times, the union is taken .PP \fB--type\fP=[] The types (package, message, enum, extension, service, method) that should be included in this image. When specified, the resulting image will only include descriptors to describe the requested types. A type name may end with ".**" to recursively include the named element and everything nested beneath it, such as a package and all of its sub-packages .SH OPTIONS INHERITED FROM PARENT COMMANDS \fB--debug\fP[=false] Turn on debug logging .PP \fB--log-format\fP="color" The log format [text,color,json] .PP \fB--timeout\fP=0s The duration until timing out, setting it to 0 means no timeout .SH SEE ALSO \fBbuf(1)\fP .SH HISTORY 2026-07-17 Auto generated by spf13/cobra