Buf(1)

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

πŸ’… BUF(1) β€” the buf-source-edit-deprecate glow-up πŸ’…

okay so bestie, you're looking at Buf(1), and more specifically the buf-source-edit-deprecate page β€” yes that's a whole mouthful, but it's giving "niche tool, main character energy" and honestly? obsessed. let's get into it 🫢


✨ NAME ✨

buf-source-edit-deprecate β€” literally just: Deprecate Protobuf types πŸ’€

🌸 SYNOPSIS 🌸

buf source edit deprecate  [flags]

(yes there are two spaces before [flags], no we're not fixing it, it's canon πŸŽ€)

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does this lil command do? it deprecates Protobuf types by adding the 'deprecated = true' option. that's it. that's the vibe ✨

the --prefix flag is required β€” like, the command will not run without it, no cap. it specifies the fully-qualified name prefix of the types you wanna deprecate. every type whose fully-qualified name starts with this prefix gets the 'deprecated = true' option added. but β€” and this is the plot twist β€” for fields and enum values, only exact matches are deprecated. iykyk 🌈

it returns an error if no types match the prefixes you gave. but if the matching types are already deprecated? no changes are made and the command still succeeds β€” it's like, "been there, done that, still slaying" πŸ’…

by default, the source is the current directory, and files are formatted and rewritten in-place. so yeah, it's editing your actual real files, not playing around πŸ™ˆ


πŸ“ examples (aka the fun part) πŸ“

Deprecate all types under a package prefix:

$ buf source edit deprecate --prefix foo.bar

Deprecate a specific message and all nested types:

$ buf source edit deprecate --prefix foo.bar.MyMessage

Deprecate a specific field:

$ buf source edit deprecate --prefix foo.bar.MyMessage.my_field

Multiple --prefix flags can be specified:

$ buf source edit deprecate --prefix foo.bar --prefix baz.qux

Display a diff of the changes instead of rewriting files:

$ buf source edit deprecate --prefix foo.bar -d

🌟 OPTIONS 🌟

  • --config="" β€” the buf.yaml file or data to use for configuration πŸ’–
  • -d, --diff[=false] β€” display diffs instead of rewriting files. like, look before you leap, queen πŸ‘‘
  • --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 yeah, different rules for different vibes 🧚
  • --error-format="text" β€” the format for build errors printed to stderr. must be one of [text,json,msvs,junit,github-actions,gitlab-code-quality] ⭐
  • --exclude-path=[] β€” exclude specific files or directories, e.g. "proto/a/a.proto", "proto/a". if specified multiple times, the union is taken πŸŽ€
  • -h, --help[=false] β€” help for deprecate 🫢
  • --path=[] β€” limit to specific files or directories, e.g. "proto/a/a.proto", "proto/a". if specified multiple times, the union is taken 🌸
  • --prefix=[] β€” Required. the fully-qualified name prefix of types to deprecate. may be specified multiple times. this is the whole point bestie, don't forget it πŸ’€

πŸ’œ OPTIONS INHERITED FROM PARENT COMMANDS πŸ’œ

  • --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) ⏳

πŸ”₯ SEE ALSO πŸ”₯


πŸ‘‘ HISTORY πŸ‘‘

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

ok that's the whole page, no crumbs left behind πŸ“ every flag, every default, every env var, all accounted for. slay.

and that's a wrap, bestie πŸ’– this lil page was Auto generated by spf13/cobra, dated 2026-10-22, and it's part of the Buf(1) manual β€” periodt. go deprecate some types, you're gonna do amazing πŸŒŸπŸŽ€πŸ¦‹

πŸ“¦ where this page comes from