mirror of
https://github.com/mountain-loop/yaak.git
synced 2025-12-23 22:48:55 -05:00
Copy as gRPCurl
An HTTP request action plugin that converts gRPC requests into gRPCurl commands, enabling easy sharing, debugging, and execution of gRPC calls outside Yaak.
Overview
This plugin adds a "Copy as gRPCurl" action to gRPC requests, converting any gRPC request
into its equivalent executable command. This is useful for debugging gRPC services,
sharing requests with team members, or executing gRPC calls in terminal environments where
grpcurl is available.
How It Works
The plugin analyzes your gRPC request configuration and generates a properly formatted
grpcurl command that includes:
- gRPC service and method names
- Server address and port
- Request message data (JSON format)
- Metadata (headers)
- Authentication credentials
- Protocol buffer definitions
Usage
- Configure a gRPC request as usual in Yaak
- Right-click on the request sidebar item
- Select "Copy as gRPCurl" from the available actions
- The command is copied to your clipboard
- Share or execute the command
Generated gRPCurl Examples
Simple Unary Call
grpcurl -plaintext \
-d '{"name": "John Doe"}' \
localhost:9090 \
user.UserService/GetUser
Call with Metadata
grpcurl -plaintext \
-H "authorization: Bearer my-token" \
-H "x-api-version: v1" \
-d '{"user_id": "12345"}' \
api.example.com:443 \
user.UserService/GetUserProfile
Call with TLS
grpcurl \
-d '{"query": "search term"}' \
secure-api.example.com:443 \
search.SearchService/Search
Call with Proto Files
grpcurl -import-path /path/to/protos \
-proto /other/path/to/user.proto \
-d '{"email": "user@example.com"}' \
localhost:9090 \
user.UserService/CreateUser
