protoc

Parse Google Protobuf .proto files and generate output in the specified language. More information: <https://developers.google.com/protocol-buffers>.

Install

All systems
curl cmd.cat/protoc.sh
Debian Debian
apt-get install protobuf-compiler
Ubuntu
apt-get install protobuf-compiler
Alpine
apk add protobuf
Arch Arch Linux
pacman -S protobuf
image/svg+xml Kali Linux
apt-get install protobuf-compiler
CentOS
yum install protobuf-compiler
Fedora
dnf install protobuf-compiler
Windows (WSL2)
sudo apt-get update sudo apt-get install protobuf-compiler
OS X
brew install protobuf
Raspbian
apt-get install protobuf-compiler
Docker
docker run cmd.cat/protoc protoc powered by Commando

Parse Google Protobuf .proto files and generate output in the specified language. More information: <https://developers.google.com/protocol-buffers>.

  • Generate Python code from a `.proto` file:
    protoc --python_out=path/to/output_directory input_file.proto
  • Generate Java code from a `.proto` file that imports other `.proto` files:
    protoc --java_out=path/to/output_directory --proto_path=path/to/import_search_path input_file.proto
  • Generate code for multiple languages:
    protoc --csharp_out=path/to/c#_output_directory --js_out=path/to/js_output_directory input_file.proto

© tl;dr; authors and contributors