Protobuf Debugging Suite
protobug is a schema-aware CLI for inspecting and rewriting protobuf payloads. It can decode binary, hex, and base64 payloads, project them into canonical JSON, apply jaq filters to that JSON, and re-encode the result back into protobuf bytes.
- Inspect protobuf payloads with a schema-aware TUI.
- Print protobuf payloads as canonical JSON, raw binary, hex, or base64.
- Edit messages by applying
jaqfilters to their JSON representation. - Rewrite files in place while preserving their original encoding.
- Work with line-delimited hex/base64 files as multiple independent messages.
- Navigate multiple messages in the inspector one at a time.
inspect is the interactive path. It loads a protobuf payload with a schema and either opens the TUI or prints the decoded message in another format.
Supported input formats:
autobinaryhexbase64
Supported print formats:
jsonbinaryhexbase64
edit is the non-interactive transformation path. It loads a message, converts it to JSON, optionally runs a jaq filter, and emits the result in the requested format or writes it back in place.
Supported input formats:
autojsonbinaryhexbase64
Supported output formats:
jsonbinaryhexbase64
Print a protobuf payload as canonical JSON:
protobug inspect \
--schema protogen/proto/system-event.proto \
--message SystemEvent \
--file event.bin \
--input-format binary \
--print-format jsonOpen the interactive inspector:
protobug inspect \
--schema protogen/proto/system-event.proto \
--message SystemEvent \
--file event.hex \
--input-format hexInspect a line-delimited base64 file as multiple messages:
protobug inspect \
--schema protogen/proto/system-event.proto \
--message SystemEvent \
--file events.b64 \
--input-format base64 \
--multipleConvert JSON back into protobuf bytes:
protobug edit \
--schema protogen/proto/system-event.proto \
--message SystemEvent \
--file event.json \
--input-format json \
--print-format binary > event.binApply a jaq filter and print the edited message as JSON:
protobug edit \
--schema protogen/proto/system-event.proto \
--message SystemEvent \
--file event.bin \
--input-format binary \
--filter '.click |= (.x as $x | .y as $y | .x = $y | .y = $x)' \
--print-format jsonRewrite a protobuf file in place:
protobug edit \
--schema protogen/proto/system-event.proto \
--message SystemEvent \
--file event.hex \
--input-format hex \
--filter '.reason = "updated"' \
--in-placeRewrite each message in a line-delimited base64 file independently:
protobug edit \
--schema protogen/proto/system-event.proto \
--message SystemEvent \
--file events.b64 \
--input-format base64 \
--multiple \
--filter '.click.x += 10' \
--in-placeUse the bundled just helpers during development:
just proto-json protogen/proto/system-event.proto event.bin SystemEvent binary
just proto-jq protogen/proto/system-event.proto event.bin '.click.x += 10' SystemEvent binary
just proto-jq-rewrite protogen/proto/system-event.proto event.hex '.reason = "updated"' SystemEvent hexIn the inspector:
Ctrl-Ssaves configured outputs.Ctrl-Xtoggles the hex pane.Ctrl-Atoggles the ASCII pane.[and]adjust bytes-per-row.Ctrl-JandCtrl-Kmove between messages in multi-message mode.Ctrl-Gopens the message picker.
In the message picker:
Enterjumps to a specific message number.Ctrl-Bjumps to the first message.Ctrl-Ejumps to the last message.Esccancels.