Skip to content

About

gRPC client for Emacs based on beautiful grpcurl

Resources

Stars

13 stars

Watchers

1 watching

Forks

Latest commit

 

History

35 Commits

Folders and files

Repository files navigation

GRPClient

https://melpa.org/packages/grpclient-badge.svg

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

Install by Melpa

Ensure that you have melpa in your package-archives varaible.

Evaluate M-x package-install RET grpclient or add following configuration in your init.el or .emacs file

(use-package grpclient
  :ensure t
  :init
  (add-to-list 'auto-mode-alist '("\\.grpc\\'" . grpclient-mode)))

Install manually

  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-completion-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-completion-completeC-c C-cInsert gRPC request at point
grpclient-completion-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-completion-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

Stars

13 stars

Watchers

1 watching

Forks

Contributors

Languages