# Protobuf.Generate

An Elixir mix task that generates Elixir code from Protocol Buffers definitions by calling protoc directly, running in the local project's context instead of as a global protoc-gen-elixir plugin.

protobuf.generate is a mix task that generates Elixir code from .proto files without going through the protoc-gen-elixir plugin. It calls protoc with descriptor_set_out to produce a FileDescriptorSet in a temporary file, which it then feeds to the Protobuf library to generate code, running inside the local project's context rather than protoc-gen-elixir's global plugin context.

Because it runs locally, extensions that need to be populated during code generation are picked up automatically through Protobuf.load_extensions, which protoc-gen-elixir cannot do, and generator plugins can hook into the codegen process through a documented plugin behaviour.

It requires the protoc compiler to be installed separately, is added to a project's mix.exs dependencies, and supports the same command-line options as protoc-gen-elixir, including output and include paths, a transform module for custom encoding and decoding, a package prefix, raw descriptor inclusion, one-file-per-module output, documentation visibility, and a gRPC generator plugin.

Website: https://github.com/drowzy/protobuf_generate
