proton
cli protobuf to json converter.
Installation
Execute:
$ go get github.com/beatlabs/proton
Or download from Releases
Or using Homebrew 🍺
brew tap beatlabs/proton https://github.com/beatlabs/proton
brew install proton
Usage
Usage:
proton json [flags]
Flags:
-f, --file string Proto file path or url
-h, --help help for json
--indent Indent output json
-p, --package string Proto package
-t, --type string Proto message type
Examples
Proto file from URL with input message as argument
proton json -f https://raw.githubusercontent.com/protocolbuffers/protobuf/master/examples/addressbook.proto -p tutorial -t AddressBook testdata/out.bin
Proto file from local with input message as argument
proton json -f ./testdata/addressbook.proto -p tutorial -t AddressBook testdata/out.bin
Proto file from URL with input message piped
cat testdata/out.bin | proton json -f https://raw.githubusercontent.com/protocolbuffers/protobuf/master/examples/addressbook.proto -p tutorial -t AddressBook
Proto file from local with input message piped
cat testdata/out.bin | proton json -f ./testdata/addressbook.proto -p tutorial -t AddressBook