Under bazel --incompatible_enable_proto_toolchain_resolution flag, you could register buf CLI as a replacement of protoc See https://github.com/bazelbuild/rules_proto/discussions/213