REPROTO(1) User Commands REPROTO(1)

reproto - reconstruct .proto source files from compiled protobuf descriptor sets

reproto [OPTIONS] DESCRIPTOR_FILES...

reproto reads one or more binary or text-format protobuf descriptor sets and regenerates the original .proto source files with correct syntax, field types, and options.

It supports proto2, proto3, and editions syntax, and accepts both .pb (binary FileDescriptorSet) and .textpb (text-format) descriptor files as input.

One or more descriptor files to process. Accepts binary FileDescriptorSet, binary FileDescriptorProto, #@ prototext-format descriptors, or directories (processed recursively). Any file extension is accepted; .pb and .desc are conventional. Paths are resolved relative to directories given by -I (--desc-root), or relative to the current working directory if -I is not provided.

Root directory for resolving relative DESCRIPTOR_FILES paths and for locating imports (repeatable; like protoc -I).

Output directory for generated .proto files (created if absent). Not required when using --schema-db-out, --scoring-html-out, or --dry-run.
Also write binary descriptor files (.pb) alongside .proto output
Do not actually create .proto files

Path to a variant specification YAML file. If omitted, $REPROTO_VARIANT is used; otherwise the built-in google.protobuf default applies.
Use the variant´s embedded copy of a well-known file instead of whatever the input .pb files contain. Accepts: any, empty, timestamp, duration, struct, wrappers, descriptor, all. May be repeated.
Keep the variant descriptor import path as-is (do not rewrite to google/protobuf/descriptor.proto)
Write descriptor.proto to the output directory (suppressed by default)

FQDN or glob pattern to treat as an output root. Plain FQDN: desc:my.pkg.MyMsg or file:foo.proto. Glob: file:borg/common/*.proto (one level), file:borg/** (recursive), desc:my.pkg.* (one level).
FQDN or glob pattern to exclude from output. Plain FQDN: desc:my.pkg.MyMsg or file:foo.proto. Glob: file:borg/common/*.proto (one level), file:borg/** (recursive), desc:my.pkg.* (one level).

Force all output to proto2 syntax, regardless of the input syntax. Without this flag, output syntax matches the input (polyglot mode).
Translate editions-syntax files to proto2 in output and binary descriptors. Symmetric with --force-proto2-output but limited to editions files only. --schema-db-out forces this unconditionally.
Redact comments from reconstructed .proto files
Redact orphans from reconstructed .proto files
Force go_package option in reconstructed .proto files

Write the schema DB to FILE (must end in .desc). Writes FILE (FileDescriptorSet of all loaded FDPs), FILE-stem/hopcroft.rkyv (compiled scoring graph), and FILE-stem/index.rkyv (lazy-loading FDS index).
Write per-file scoring-graph YAML files alongside .proto output under --proto-out
Write scoring-graph HTML visualisations to FILE; requires --schema-db-out
Include leaf (wire-type sink) nodes in --scoring-html-out graphs (hidden by default)
FQDN or glob pattern to hide from --scoring-html-out graphs (same syntax as --prune). Matched nodes and their incident edges are dropped from the HTML; no effect on the schema DB.
Print detailed debug information (development only)
Python file executed as a transformation hook during phase 2. Must define phase2_plugin(ctx, fdp).
Do not prune files whose symbols conflict with already-loaded files (legacy behaviour; by default conflicting files are silently pruned and a warning is emitted).

Print every warning occurrence immediately as it is emitted (default: squash repeated warnings and show a count summary at the end).
Suppress progress messages and warnings. Errors are always printed.
Print detailed information about FQDNs (development only)
Print version and exit.
Show a help message and exit.

Path to a variant YAML file used when --proto-variant is not given.
_REPROTO_COMPLETE
When set to bash_complete, emit shell completion candidates and exit. Used internally by the bash completion script.

reproto does not support multi-file FileDescriptorSet inputs (i.e. .pb files produced with protoc --include_imports). Each .pb file must contain exactly one FileDescriptorProto. Pass all .pb files together on the command line and let reproto resolve cross-file imports.

Compile each .proto to its own descriptor set (without --include_imports), then pass all .pb files to reproto:

protoc --descriptor_set_out=phone_number.pb --proto_path=. phone_number.proto
protoc --descriptor_set_out=address_book.pb --proto_path=. address_book.proto
reproto --use-variant descriptor -I . -O out/ phone_number.pb address_book.pb

reproto --use-variant descriptor -I . -O out/ --seed desc:.tutorial.Person \

phone_number.pb address_book.pb

The --use-variant descriptor flag supplies descriptor.proto from the built-in variant bundle, so no separate descriptor .pb is needed:

reproto --use-variant descriptor -I . -O out/ phone_number.pb address_book.pb

source <(cat /path/to/reproto/completions.sh)

protoc(1), prototext(1)

2026 reproto dev