protoc-gen-doc

What protoc-gen-doc is
protoc-gen-doc is a documentation generator plugin for the Google Protocol Buffers compiler. It turns comments in .proto files into HTML, JSON, DocBook, or Markdown documentation. It supports proto2 and proto3, including their use in the same context, and can document files, messages, fields, services, methods, enums, values, and extensions.
The plugin is invoked through protoc with the --doc_out and --doc_opt options. Users can exclude files by path patterns and omit comments marked with the @exclude prefix. Output placement can be set with the source_relative flag to keep generated files in the input's relative directory. Custom Go templates can define output, and stylesheet.css can adjust HTML styling. Installation options include Go, prebuilt releases, Docker, and Maven Central. The project is free under the MIT License, which permits use, copying, modification, distribution, sublicensing, and sale subject to its terms; it is provided without warranty. It runs on Linux, macOS, and Windows and is self-hosted. The repository has no SECURITY.md policy or published security advisories.
Who it suits
It suits developers and teams documenting Protocol Buffers schemas from comments in .proto files. It is a fit for workflows that can invoke protoc and handle self-hosted tooling.
What it does well
- Generates HTML, JSON, DocBook, and Markdown.
- Supports proto2 and proto3 together.
- Custom Go templates and CSS can customize output.
- Installation options include Docker and Maven Central.
- MIT License permits distribution and modification under its terms.
What to know first
- The project has no SECURITY.md policy.
- No published security advisories are listed.
- The MIT License provides the software without warranty.
Plans
| Plan | Billed and limits | Price |
|---|---|---|
| MIT-licensed software | Use, copy, modify, merge, publish, distribute, sublicense, and sell under the MIT License · provided “AS IS” without warranty | Free |
As github.com lists them, read 8 Oct 2026. The maker's own page has the final word.
Getting started
- Choose an installation route: Go, a prebuilt release, Docker, or Maven Central.
- Prepare the .proto files whose comments should become documentation.
- Invoke the plugin through protoc with --doc_out and --doc_opt.
- Use source_relative if output should follow the input files’ relative directories.
- For Docker, provide proto inputs at /protos and documentation output at /out.
protoc-gen-doc is a plugin for generating reference documentation from Google Protocol Buffers source files. It is best suited to teams that already use protoc and want documentation to grow from comments in their definitions. Its range of output and customization options is useful, provided the team is comfortable running and maintaining a self-hosted tool.
Overview
The generator converts comments in .proto files into HTML, JSON, DocBook, or Markdown. It supports proto2 and proto3, including projects that use both, and can document files, messages, fields, services, methods, enums, values, and extensions. That makes it a practical fit for keeping reference material close to the definitions it describes, rather than maintaining a separate document by hand.
It runs as a protoc plugin through the --doc_out and --doc_opt options. The source_relative flag places generated files in a relative directory matching the input, which can help preserve a project's source layout. This is a documentation generator, not a graphical client for calling or testing gRPC services.
Key features
Four built-in formats cover common publishing needs: HTML for browser-readable references, JSON for structured output, DocBook for document workflows, and Markdown for text-based publishing. If those outputs do not suit a project's needs, a custom Go template can define another format. HTML appearance can also be adjusted with a stylesheet.css file beside the output. These options offer control without changing the source comments, but teams choosing custom templates or styles take on their upkeep.
Documentation can be filtered by excluding files with path patterns or omitting comments prefixed with @exclude. That gives maintainers a way to keep internal or irrelevant material out of generated output. Installation choices include Go, prebuilt releases, Docker, and a Maven Central package; the Docker image uses /out and /protos volumes for output and input files.
Pricing
protoc-gen-doc is free and open source. Its MIT-licensed software plan costs free and permits use, copying, modification, distribution, sublicensing, and sale under the license terms. The license provides the software “AS IS” without warranty. There are no paid tiers to weigh against the free option; teams should instead account for operating the tool themselves.
Platforms
The project supports Linux, macOS, and Windows, and is self-hosted. Its Docker image provides one deployment route, while Go installation, prebuilt releases, and Maven Central offer other ways to add it to a workflow.
Who it's for
This is a strong fit for developers maintaining Protocol Buffers definitions who want to generate reference docs from source comments and control the resulting format or presentation. It is less suitable for readers seeking a hosted documentation service or a broader gRPC tool for interactively exploring services: the deployment model is self-hosted and the purpose is documentation generation.
Pros and cons
- Pros: HTML, JSON, DocBook, and Markdown outputs support different publishing workflows from the same .proto comments.
- Pros: Support for proto2 and proto3, plus coverage of services, methods, and other major schema elements, suits mixed and detailed projects.
- Pros: File and comment filtering, custom templates, and stylesheet customization give maintainers control over what appears and how it looks.
- Cons: Self-hosted deployment means teams must incorporate and maintain the generator in their own environment.
- Cons: The repository has no SECURITY.md security policy and no published security advisories, a limitation for teams that require a published security policy.
Alternatives
For adjacent gRPC tools, see gRPC Tools. Choose gRPC CLI instead if you need a free tool for unary RPC calls and are comfortable building from source. grpcui is another free, MIT-licensed option with Linux, macOS, Windows, web, and self-hosted platforms; choose it if those platform options better match your needs.
Kreya is a freemium, non-open-source option with a free plan for individuals that limits request history to the latest request. ProtoCall offers a free app for GitHub imports and manually created workspaces. sabledocs is a free open-source static generator that requires Python 3.11+ and a Protobuf descriptor file, making it an alternative for teams whose workflow meets those requirements.
Bandura offers a free plan for personal and commercial use with no account, paid seats, or feature tiers. Evans is a free open-source gRPC client. FintX has a free/open-source plan with unlimited gRPC clients, request autosave, import/export, tabs per method, a JSON editor, and projects. These are alternatives when a gRPC client workflow matters more than generating documentation from .proto comments.
Verdict
Choose protoc-gen-doc if your team maintains Protocol Buffers files and wants flexible reference output generated from their comments, without license fees. Its main advantage is the combination of multiple formats, filtering, and template customization; look elsewhere if you need hosted deployment, a published security policy, or an interactive gRPC client.
Verdict
protoc-gen-doc offers multiple documentation formats, filtering, and output customization for Protocol Buffers projects. Teams should account for self-hosted deployment and the absence of a published security policy.
Questions
How much does protoc-gen-doc cost?
It is free. The listed plan is free.
Which output formats does it generate?
It generates HTML, JSON, DocBook, and Markdown from comments in .proto files.
Which Protocol Buffers versions does it support?
It supports proto2 and proto3, including both in the same context.
How can I install it?
The project offers Go installation, prebuilt releases, a Docker image, and a Maven Central package.
Is protoc-gen-doc open source?
Yes. It is distributed under the MIT License, which permits use, copying, modification, distribution, sublicensing, and sale subject to its terms.
Facts from protoc-gen-doc's own pages
- Comment filtering
- Comments prefixed with @exclude can be omitted from generated documentation. · github.com, 8 Oct 2026
- Customization
- Users can supply a custom Go template and can customize HTML output with a stylesheet.css file. · github.com, 4 Oct 2026
- Custom templates
- The output format can be a custom Go template, and CSS placed beside the output file can customize HTML appearance. · github.com, 8 Oct 2026
- Deployment
- The README describes a Docker image with /out and /protos volumes for documentation output and proto inputs. · github.com, 8 Oct 2026
- Documentable elements
- Comments can document files, messages, fields, services and methods, enums and values, and extensions. · github.com, 8 Oct 2026
- Filtering
- The plugin supports excluding files by path patterns and excluding comments with the @exclude prefix. · github.com, 4 Oct 2026
- Installation
- The project offers a Docker image, Go installation, prebuilt releases, and a Maven Central package. · github.com, 4 Oct 2026
- Install options
- The README documents installation with Go, prebuilt releases, a Docker image, and Maven Central. · github.com, 8 Oct 2026
- Integration
- The plugin is invoked through protoc using the --doc_out and --doc_opt options. · github.com, 8 Oct 2026
- License
- The software is distributed under the MIT License, which permits use, copying, modification, distribution, sublicensing, and sale subject to its terms. · github.com, 4 Oct 2026
- License and warranty
- The project uses the MIT License, which provides the software “AS IS” without warranty. · github.com, 8 Oct 2026
- Maintainer
- The GitHub profile identifies the maintainer as David Muto and lists Ottawa, Ontario, Canada. · github.com, 8 Oct 2026
- Output formats
- It can generate HTML, JSON, DocBook, and Markdown documentation from comments in .proto files. · github.com, 8 Oct 2026
- Output path option
- The source_relative flag writes generated output in the same relative directory as the input file. · github.com, 4 Oct 2026
- Proto support
- It supports proto2 and proto3, including both in the same context. · github.com, 8 Oct 2026
- Purpose
- protoc-gen-doc is a documentation generator plugin for the Google Protocol Buffers compiler. · github.com, 8 Oct 2026
- Release
- The releases page lists v1.5.1 as the latest release and shows its tag as signed with a verified committer signature. · github.com, 8 Oct 2026
- Release platforms
- The v1.0.0 release notes say the program was ported to Go and precompiled for Linux, OSX, and Windows. · github.com, 8 Oct 2026
- Release signature
- The v1.5.1 release page says its tag was signed with the committer’s verified signature. · github.com, 4 Oct 2026
- Security
- GitHub reports that the project has no SECURITY.md policy and no published security advisories. · github.com, 8 Oct 2026
Where protoc-gen-doc stands on Freedom251
- gRPC Tools#16 of 24