What is grpcurl and how is it useful when working with gRPC services?
Last updated
grpcurl is a command-line tool that acts like curl for gRPC: it lets you invoke methods, explore services, and send requests without writing client code.
Service discovery via reflection:
If the server enables the reflection service,
grpcurl listandgrpcurl describeenumerate services, methods, and message types with no local.protofiles.Without reflection you point it at
.protofiles using-import-pathand-proto.
Invoking calls:
Send JSON request bodies with
-d; grpcurl marshals to protobuf and prints the JSON response.Pass metadata with
-Hand control TLS with-plaintextor-insecure.
Why it is useful: Quick manual testing and debugging of endpoints, and verifying auth or error behavior without building a client.
[lang:bash]
grpcurl -plaintext -d '{"id": 42}' localhost:50051 user.UserService/GetUser
- https://www.fullstory.com/blog/tale-of-grpcurl/
- https://github.com/fullstorydev/grpcurl/blob/master/README.md
- https://www.youtube.com/watch?v=RHWwMrR8LUs
- https://grpc.io/docs/guides/reflection/
- https://grpcurl.com/
- https://grpcurl.com/what-is-grpcurl-used-for/
- https://www.cheat-sheets.org/project/tldr/command/grpcurl/
- https://appscode.com/blog/post/grpcurl/