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:
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
Defaults to the package found in the Proton file if not specified
-t, --type string Proto message type
Defaults to the first message type in the Proton file if not specified
Proto file from URL with input message as argument
proton json -f https://raw.githubusercontent.com/protocolbuffers/protobuf/master/examples/addressbook.proto testdata/out.bin
Proto file from local with input message as argument
proton json -f ./testdata/addressbook.proto 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
Proto file from local with input message piped
cat testdata/out.bin | proton json -f ./testdata/addressbook.proto