prototool: Lint, Format and Compile Proto (Legacy)
prototool wraps protoc to lint, format, and compile .proto files driven by a prototool.yaml; it is deprecated in favor of buf but still appears in older CI.
prototool was an early all-in-one proto tool. It is no longer actively developed (buf is its successor), but you still meet it in legacy pipelines, so knowing its commands helps you maintain or migrate them.
What it does
prototool downloads and drives protoc, resolving import paths from prototool.yaml so you do not pass -I manually. prototool lint checks style, prototool format rewrites files, and prototool compile validates that everything compiles. prototool generate runs configured plugins.
Common usage
prototool compile
prototool lint
prototool format -w
prototool generate
# prototool.yaml
# protoc:
# version: 3.20.1
# lint:
# group: uber2Flags and options
| Command / flag | What it does |
|---|---|
| compile | Compile all protos to check they are valid |
| lint | Lint against the configured rule group |
| format -w | Format files; -w writes in place, -d shows a diff |
| generate | Run the configured code generation plugins |
| --protoc-bin-path <path> | Use a specific protoc binary |
| lint.group (yaml) | Rule group such as uber1 or uber2 |
In CI
For new work, prefer buf: buf lint, buf format, buf build, buf generate cover the same ground and are maintained. If you must keep prototool, pin the protoc.version in prototool.yaml so a runner without internet access does not fail trying to download a protoc release.
Common errors in CI
"unable to download protoc" (or a TLS/timeout fetching the release) hits air-gapped runners; set --protoc-bin-path to a preinstalled protoc or pre-cache the download. "prototool.yaml: ... unknown field" usually means a config written for a different prototool version. Lint errors look like "<file>:<line>:<col>:<message>" tied to the configured rule group.