Skip to content

gen:proto & rem:proto ​

Compile .proto definitions into Go stubs and wire gRPC service implementations into module.go.

Prerequisites ​

protoc, protoc-gen-go, and protoc-gen-go-grpc must be on your PATH.

goforge gen:proto [service] ​

If [service] is omitted, opens a TUI picker (All services or a specific service).

What It Does ​

  1. Runs protoc --go_out=. --go_opt=module=<module> --go-grpc_out=. --go-grpc_opt=module=<module> internal/proto/<svc>/<svc>.proto, outputting to internal/proto/<svc>/gen/.
  2. Parses rpc lines from the .proto file and writes internal/services/<svc>/grpc.go (<Type>GRPC, New<Type>GRPC, Register(*grpc.Server), RPC stubs).
  3. Inserts New<Type>GRPC into Providers: []any{...} in internal/services/<svc>/module.go.

goforge rem:proto ​

Partial Cleanup Behavior

goforge rem:proto deletes internal/proto/*/gen/ and internal/services/*/*.pb.go, but does not revert internal/services/<svc>/grpc.go or remove New<Type>GRPC from module.go. If you want to remove gRPC from a service completely, also clear grpc.go and remove New<Type>GRPC from module.go.

Released under the Apache-2.0 License.