Plugins

The work plugins refers to both protoc plugins (standalone binary tool that communicate with the protoc tool over stdin/stdout) or gazelle plugin (go implementation of the Plugin interface). The latter is used by gazelle to predict what files will be generated by the former.

Gazelle protobuf plugins are installed into a global registry via a golang init() function.

Naming of plugins is reminiscent of maven coordinates. The name is just a string, but by convention it should follow the pattern OWNER:REPO:TOOL. For example, the protoc-gen-mypy tool that exists in the repo at https://github.com/dropbox/mypy-protobuf would have the name dropbox:mypy-protobuf:protoc-gen-mypy. The top-level domain is not used.

Built-in plugins

These plugins are part of the protoc tool itself, no additional plugins or dependencies are required.

plugin name description
builtin:java Mirrors --java_out
builtin:cpp Mirrors --cpp_out
builtin:python Mirrors --python_out
builtin:objc Mirrors --objc_out
builtin:php Mirrors --php_out
builtin:csharp Mirrors --csharp_out
builtin:ruby Mirrors --ruby_out
builtin:js:common Mirrors --js_out=import_style=commonjs
builtin:js:closure Mirrors --js_out=import_style=closure

Third-party plugins

plugin name description
gogo/protobuf/protoc-gen-combo Mirrors https://github.com/gogo/protobuf/protoc-gen-gogo
gogo/protobuf/protoc-gen-gogo Mirrors https://github.com/gogo/protobuf/protoc-gen-gogo
gogo/protobuf/protoc-gen-gogofast Mirrors https://github.com/gogo/protobuf/protoc-gen-gogo
gogo/protobuf/protoc-gen-gogofaster Mirrors https://github.com/gogo/protobuf/protoc-gen-gogo
gogo/protobuf/protoc-gen-gogoslick Mirrors https://github.com/gogo/protobuf/protoc-gen-gogo
gogo/protobuf/protoc-gen-gogotypes Mirrors https://github.com/gogo/protobuf/protoc-gen-gogo
gogo/protobuf/protoc-gen-gostring Mirrors https://github.com/gogo/protobuf/protoc-gen-gogo
grpc-ecosystem:grpc-gateway:protoc-gen-grpc-gateway Mirrors https://github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
grpc-ecosystem:grpc-gateway:protoc-gen-openapiv2 Mirrors https://github.com/grpc-ecosystem/grpc-gateway/protoc-gen-openapiv2
grpc:grpc-go:protoc-gen-go-grpc Mirrors https://github.com/grpc/grpc-go/protoc-gen-go-grpc
golang:protobuf:protoc-gen-go Mirrors https://github.com/golang/protobuf/protoc-gen-go
grpc:grpc-web:protoc-gen-grpc-web Mirrors https://github.com/grpc/grpc-java/grpc_java_plugin
grpc:grpc-java:protoc-gen-grpc-java Mirrors https://github.com/grpc/grpc-java/grpc_java_plugin
grpc:grpc:grpc_cpp_plugin Mirrors https://github.com/grpc/grpc/grpc_cpp_plugin
grpc:grpc:grpc_objc_plugin Mirrors https://github.com/grpc/grpc/grpc_objc_plugin
grpc:grpc:grpc_python_plugin Mirrors https://github.com/grpc/grpc/grpc_python_plugin
dropbox:mypy-protobuf:protoc-gen-mypy Mirrors https://github.com/dropbox/mypy-protobuf:protoc-gen-mypy
stackb:grpc.js:protoc-gen-grpcjs Mirrors https://github.com/dropbox/mypy-protobuf:protoc-gen-mypy
protobufjs/protobuf.js:pbjs* Mirrors https://github.com/protobufjs/protobuf.js/pbjs
protobufjs/protobuf.js:pbts* Mirrors https://github.com/protobufjs/protobuf.js/pbts
  • pbjs and pbts are not actual protoc plugins. Rather, they are standalone tools that work in conjunction with the protobufjs_compile rule.

TODO: Haskell, scala, d, dart, kotlin, android (protobuf-lite), other typescript, grpc-tools, rust.


Table of contents


Copyright © 2021 Stack.Build.