Buf(1)
π
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=""β thebuf.yamlfile 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 (envBUF_DEBUG) π--log-format="color"β the log formattext,color,jsonβ¨envBUF_LOG_FORMATβ© π--timeout=0sβ the duration until timing out; setting it to0means no timeout (envBUF_TIMEOUT) β³
π₯ SEE ALSO π₯
buf-source-edit(1)β go read that one too, it's the parent and it ate π
π HISTORY π
2026-10-22β Auto generated byspf13/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
- arch rolling: buf 1.75.0-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms