Skip to content

Prikaz98/grpclient.el

Repository files navigation

GRPClient

gRPCurl query builder from plain-text sheets havily inspired by restclient.el

Install

  1. Install gRPCurl
  2. Clone repository to your local directory
  3. Add following configuration in your init.el or .emacs file
(use-package grpclient
  :ensure nil
  :load-path "~/path/to/grpclient.el/"
  :init
  (add-to-list 'auto-mode-alist '("\\.grpc\\'" . grpclient-mode)))
  1. Check example file

Quick Insert (gRPC Reflection)

Insert complete gRPC requests using server reflection. Uses standard completing-read (works with consult, vertico, icomplete, fido, ido, helm, ivy).

Call grpclient-complete (C-c C-c in grpclient-mode) or M-x. It prompts for a server address and method name, then inserts:

# Call SayHello
GRPC grpcb.in:9000 hello.HelloService/SayHello
{<message template>}
CommandBindingDescription
grpclient-completeC-c C-cInsert gRPC request at point
grpclient-refresh-cacheM-x <cmd>Force-refetch reflection data

Running the Example gRPC Server

To test the Emacs mode, you can start a local Python gRPC server serving both Proto2 and Proto3 examples.

The easiest way to start the server is to use the provided shell script. It will automatically create a virtual environment, install dependencies, compile the Protocol Buffers, and start the server.

./examples/start_server.sh

The server will start on port 9000 with gRPC reflection enabled, making it easy to query using grpcurl and grpclient-mode.

Key-map

kdbfunction
C-c C-vgrpclient-send-current
C-c C-ugrpclient-copy-grpcurl-to-clipboard
C-c C-lgrpclient-describe
C-c C-cgrpclient-complete
<tab>grpclient-toggle-pretty-body

Screenshot

examples/grpclient-el.png

Demo

examples/grpclient-el.gif

About

gRPC client for Emacs based on beautiful grpcurl

Resources

License

Stars

Watchers

Forks

Contributors