.nh .TH "Buf" "1" "2026-05-25" "Auto generated by spf13/cobra" "" .SH NAME buf-convert - Convert a message between binary, text, or JSON .SH SYNOPSIS \fBbuf convert [flags]\fP .SH DESCRIPTION Use an input proto to interpret a proto/json message and convert it to a different format. .PP Examples: .EX $ buf convert --type= --from= --to= .EE .PP The can be a local .proto file, binary output of "buf build", bsr module or local buf module: .EX $ buf convert example.proto --type=Foo.proto --from=payload.json --to=output.binpb .EE .PP All of , "--from" and "to" accept formatting options: .EX $ buf convert example.proto#format=binpb --type=buf.Foo --from=payload#format=json --to=out#format=json .EE .PP Both and "--from" accept stdin redirecting: .EX $ buf convert <(buf build -o -)#format=binpb --type=foo.Bar --from=<(echo "{\\"one\\":\\"55\\"}")#format=json .EE .PP Redirect from stdin to --from: .EX $ echo "{\\"one\\":\\"55\\"}" | buf convert buf.proto --type buf.Foo --from -#format=json .EE .PP Redirect from stdin to : .EX $ buf build -o - | buf convert -#format=binpb --type buf.Foo --from=payload.json .EE .PP Use a module on the bsr: .EX $ buf convert --type buf.Foo --from=payload.json .EE .SH OPTIONS \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--from\fP="-" The location of the payload to be converted. Supported formats are [binpb,json,txtpb,yaml] .PP \fB-h\fP, \fB--help\fP[=false] help for convert .PP \fB--to\fP="-" The output location of the conversion. Supported formats are [binpb,json,txtpb,yaml] .PP \fB--type\fP="" The full type name of the message within the input (e.g. acme.weather.v1.Units) .PP \fB--validate\fP[=false] Validate the message specified with --from by applying protovalidate rules to it. See https://github.com/bufbuild/protovalidate for more details. .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-05-25 Auto generated by spf13/cobra