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
- Runs
protoc --go_out=. --go_opt=module=<module> --go-grpc_out=. --go-grpc_opt=module=<module> internal/proto/<svc>/<svc>.proto, outputting tointernal/proto/<svc>/gen/. - Parses
rpclines from the.protofile and writesinternal/services/<svc>/grpc.go(<Type>GRPC,New<Type>GRPC,Register(*grpc.Server), RPC stubs). - Inserts
New<Type>GRPCintoProviders: []any{...}ininternal/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.
