Buf(1)

πŸ“¦
version 1.75.0 Β· 3 versions
, in arch rolling

🌸 Buf(1) β€” the buf convert era 🌸

okay bestie, welcome to the Buf manual, page Buf(1). this one's all about buf convert and honestly? it's giving transformation station ✨


✨ NAME ✨

buf-convert β€” converts a message between binary, text, or JSON πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

buf convert  [flags]

πŸ¦‹ DESCRIPTION πŸ¦‹

so the whole vibe is: you hand it an input proto, it interprets a proto/json message, and it converts that message into a different format. that's it. that's the main character energy πŸ”₯

Examples:

$ buf convert <input> --type=<type> --from=<payload> --to=<output>

the input can be a local .proto file, binary output of buf build, a bsr module, or a local buf module β€” literally all of those, no cap:

$ buf convert example.proto --type=Foo.proto --from=payload.json --to=output.binpb

all of input, --from and to accept formatting options πŸ‘‘

$ buf convert example.proto#format=binpb --type=buf.Foo --from=payload#format=json --to=out#format=json

both input and --from accept stdin redirecting 🫢

$ buf convert <(buf build -o -)#format=binpb --type=foo.Bar --from=<(echo "{\"one\":\"55\"}")#format=json

redirect from stdin to --from:

$ echo "{\"one\":\"55\"}" | buf convert buf.proto --type buf.Foo --from -#format=json

redirect from stdin to input:

$ buf build -o - | buf convert -#format=binpb --type buf.Foo --from=payload.json

and use a module on the bsr, obviously 🌈

$ buf convert <buf.build/owner/repository> --type buf.Foo --from=payload.json

πŸ’– OPTIONS πŸ’–

  • --disable-symlinks[=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 (so don't come for the BSR, it plays by its own rules πŸ’€)
  • --error-format="text" β€” the format for build errors printed to stderr. must be one of [text,json,msvs,junit,github-actions,gitlab-code-quality]
  • --from="-" β€” the location of the payload to be converted. supported formats are [binpb,json,txtpb,yaml]
  • -h, --help[=false] β€” help for convert πŸ₯Ί
  • --to="-" β€” the output location of the conversion. supported formats are [binpb,json,txtpb,yaml]
  • --type="" β€” the full type name of the message within the input (e.g. acme.weather.v1.Units) β€” like, the whole entire name, not a nickname
  • --validate[=false] β€” validate the message specified with --from by applying protovalidate rules to it. see https://github.com/bufbuild/protovalidate for more details. she checks your work, respectfully πŸ’…

🌟 OPTIONS INHERITED FROM PARENT COMMANDS 🌟

these come from the parent command, so they're not even this command's kids, they're just hanging around being iconic:

  • --debug[=false] β€” turn on debug logging (env BUF_DEBUG) πŸ›
  • --log-format="color" β€” the log format text,color,json ⟨env BUF_LOG_FORMAT⟩
  • --timeout=0s β€” the duration until timing out, setting it to 0 means no timeout (env BUF_TIMEOUT) ⏳
ngl, --timeout=0s meaning no timeout is such a mood. she waits. patiently. forever.

🧚 SEE ALSO 🧚

buf(1) β€” go say hi to the parent, she raised this one 🫢


πŸ“œ HISTORY πŸ“œ

2026-10-22 β€” auto generated by spf13/cobra


and that's the whole page!! auto generated by spf13/cobra, dated 2026-10-22, straight out of the Buf(1) manual πŸ’œ slay, bye πŸ¦‹

πŸ“¦ where this page comes from