PROTOTEXT(1) General Commands Manual PROTOTEXT(1)

prototext - Lossless protobuf ↔ enhanced-textproto converter

prototext [-d|--decode] [-e|--encode] [-D|--descriptor] [-t|--type] [--annotations] [--no-annotations] [-o|--output] [-O|--output-root] [-I|--input-root] [-i|--in-place] [-q|--quiet] [-h|--help] [-V|--version] [PATH]

Lossless protobuf ↔ enhanced-textproto converter

Decode: treat input as binary protobuf, emit text
Encode: treat input as textual prototext, emit binary
Compiled .pb descriptor file
Fully-qualified root message type name (e.g. pkg.MyMessage). When given without --descriptor, uses the embedded descriptor (covers all google.protobuf.* types)
Emit inline wire-type/field-number comments (default). Required for lossless round-trip encode
Suppress inline wire-type/field-number comments. Output will not be losslessly round-trippable
Write output to PATH (single input only; exclusive with --output-root)
Root directory for output files in batch mode (exclusive with --output and --in-place)
Root directory: positional paths and globs are resolved relative to DIR. Absolute positional paths are an error when --input-root is given
Rewrite each input file in place (exclusive with --output-root). Each file is read fully into memory before being overwritten (sponge)
Suppress warnings on stderr (errors are always printed)
Print help
Print version
[PATH]
Input files, glob patterns, or directories (recursive). When absent, reads from stdin

v0.1.4

When set to bash, zsh, or fish, print a shell completion script to stdout and exit. Used by the shell completion setup described below.

prototext -d message.binpb

prototext -d -D descriptor.pb -t pkg.MyMessage message.binpb

prototext -e message.pb > message.binpb

protoc --encode=pkg.MyMessage descriptor.proto < input.txt | prototext -d -D descriptor.pb -t pkg.MyMessage

source <(PROTOTEXT_COMPLETE=bash prototext)

protoc(1)

prototext User Commands