Buf(1)

NAME
buf-source-edit-deprecate - Deprecate Protobuf types

SYNOPSIS
buf source edit deprecate [flags]

DESCRIPTION
Deprecate Protobuf types by adding the 'deprecated = true' option.

The --prefix flag is required and specifies the fully-qualified name prefix of the types to deprecate. All types whose fully-qualified name starts with this prefix will have the 'deprecated = true' option added. For fields and enum values, only exact matches are deprecated.

Returns an error if no types match the specified prefixes. If matching types are already deprecated, no changes are made and the command succeeds.

By default, the source is the current directory and files are formatted and rewritten in-place.

Examples:

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

--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

--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.

OPTIONS INHERITED FROM PARENT COMMANDS
--debug[=false]
    Turn on debug logging

--log-format="color"
    The log format [text,color,json]

--timeout=0s
    The duration until timing out, setting it to 0 means no timeout

SEE ALSO
buf-source-edit(1)

HISTORY
2026-04-29 Auto generated by spf13/cobra