ProtoMerge
ProtoMerge is a lightweight CLI tool written in Go for merging multiple Protobuf fragment files into a single consolidated .proto file. It is designed to simplify and automate the combination of partial protobuf service definitions, messages, enums, and RPCs from scattered fragment files.
Developer
•
Aug 7, 2025
ProtoMerge is a CLI tool I wrote in Go that compiles a directory of .partial.proto files into a single .proto output. It automatically merges RPC services with matching names and copies over the relevant message, enum, and other definitions.
It handles deduplication and merging using regular expressions and buffered scanners from Go’s bufio package. It’s very much a hobby project, and it can be a bit fragile if any of the input files are invalid, but it gets the job done.
ProtoMerge also supports minifying the processed protobuf definitions and includes several CLI flags and modes, for example, the --unify flag merges all RPC services into one monolithic service. The name for that unified service is either taken from the first service encountered during processing or from the value of the --service flag if one is provided.
