gitmyhub

grpcurl

Go ★ 13k updated 5d ago

Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers

A command-line tool for calling gRPC server endpoints from the terminal, like cURL for HTTP. It converts human-readable JSON to binary protobuf format and back automatically.

Gosetup: easycomplexity 2/5

gRPCurl is a command-line tool for talking to gRPC servers, named after the popular cURL utility that developers use to send HTTP requests from the terminal. gRPC is a way for programs to communicate with each other over a network, but it uses a compact binary data format called protocol buffers (protobuf) that is not human-readable and cannot be sent with regular HTTP tools. gRPCurl translates between the JSON format humans can read and write and the binary format that gRPC servers expect.

With gRPCurl you can call any method on a gRPC server, including streaming methods where the server sends back multiple responses over time, or where both sides exchange data back and forth in an ongoing conversation. You write the request data as JSON in the terminal or pipe it in from another command, and the tool handles the conversion automatically. Custom headers and metadata can be added to each request with a flag.

To know what methods and data shapes a server accepts, gRPCurl can ask the server directly if it supports a feature called server reflection. If the server does not support reflection, you can point gRPCurl at the source files that define the service (proto files) or pre-compiled descriptor files. This lets you list available services and describe what fields each method expects before making a call.

Installation options include downloading a pre-built binary, using Homebrew on macOS, running it as a Docker container, installing via the Snap package manager, or building from source if you have Go installed. The tool supports servers that use TLS encryption, plain unencrypted connections, or mutual TLS where both the client and server present certificates to each other.

The repository also includes a Go library package that other developers can use as a base for building their own gRPC command-line clients.

Where it fits