{"id":16662727,"url":"https://github.com/shsms/ob-grpc","last_synced_at":"2025-04-09T18:52:57.743Z","repository":{"id":188994610,"uuid":"403418259","full_name":"shsms/ob-grpc","owner":"shsms","description":"Grpc evaluation functions for Emacs org-babel","archived":false,"fork":false,"pushed_at":"2022-03-19T09:19:37.000Z","size":24,"stargazers_count":12,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-23T20:51:18.456Z","etag":null,"topics":["emacs","grpc","org-babel","org-mode"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shsms.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-09-05T21:42:12.000Z","updated_at":"2024-09-20T21:13:48.000Z","dependencies_parsed_at":"2023-08-17T20:24:55.521Z","dependency_job_id":null,"html_url":"https://github.com/shsms/ob-grpc","commit_stats":null,"previous_names":["shsms/ob-grpc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shsms%2Fob-grpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shsms%2Fob-grpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shsms%2Fob-grpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shsms%2Fob-grpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shsms","download_url":"https://codeload.github.com/shsms/ob-grpc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248093277,"owners_count":21046661,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emacs","grpc","org-babel","org-mode"],"created_at":"2024-10-12T10:38:44.032Z","updated_at":"2025-04-09T18:52:57.717Z","avatar_url":"https://github.com/shsms.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"* ob-grpc\nob-grpc provides functions for making grpc calls through org-babel,\nusing [[https://github.com/fullstorydev/grpcurl][grpcurl]].\n\n** Installation\n\nNot available on melpa yet.  Currently the easiest way to install is\nto use [[https://github.com/raxod502/straight.el][straight.el]]\n\n#+begin_src elisp\n(straight-use-package\n '(ob-grpc :type git :host github :repo \"shsms/ob-grpc\"))\n#+end_src\n\nOr with ~use-package~ + ~straight.el~\n\n#+begin_src elisp\n  (use-package ob-grpc\n    :straight (ob-grpc :type git :host github :repo \"shsms/ob-grpc\")\n    :bind (:map org-mode-map\n                (\"C-c g i\" . ob-grpc-init)\n                (\"C-c g b\" . ob-grpc-insert-block)))\n#+end_src\n\nAlso install [[https://github.com/fullstorydev/grpcurl][grpcurl]].\n\nOptionally, add the below to your ~init.el~ to prevent a confirmation request from\norg-babel every time you execute a block:\n\n#+begin_src elisp\n  (defun my-org-confirm-babel-evaluate (lang body)\n    (not (member lang '(\n                        \"grpc\"\n                        ;; other source languages\n                        ))))\n\n  (setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate)\n#+end_src\n\n** Usage\n\n*** Init\nIn an empty org buffer, run ~M-x ob-grpc-init~.  This would add these\nproperties to the buffer:\n\n#+begin_src org\n  :PROPERTIES:\n  :GRPC-ENDPOINT: [::1]:8080\n  :PROTO-FILE: ./proto/service.proto\n  :PROTO-IMPORT-PATH: proto\n  :PLAIN-TEXT: yes\n  :GRPC-BLOCK-PREFIX: * TODO ${method}\\n\\n# ${decl}\\n\n  :END:\n#+end_src\n\n*Notes:*\n- Update their values as necessary.\n- When using TLS, set ~:PLAIN-TEXT:~ to ~no~.\n- Separate multiple import paths by a space character.\n- The ~:GRPC-BLOCK-PREFIX:~ is a template for a prefix to the org-babel\n  block.  Check below for details on how to configure.\n\n*** Insert org-babel blocks\n\nRun ~M-x ob-grpc-insert-block~.  That would prompt for a method name,\nwith all the methods in the ~:PROTO-FILE:~ as completion options.\nChoose one, and it will automatically insert an org block, with the\nmethod name, and a template message for the request type of the\nmessage.  For example,\n\n#+begin_src org\n\u003e #+begin_src grpc :method echo.Echo.Echo\n\u003e {\n\u003e   \"str\": \"\"\n\u003e }\n\u003e #+end_src\n#+end_src\n\n*** Execute the block\n\nUpdate the request object as necessary, and press ~C-c C-c~ inside the block.\n\n*** Configure ~:GRPC-BLOCK-PREFIX:~\n\nIf you don't want any text to be added in front of each of your\norg-babel blocks, this can be set to ~:GRPC-BLOCK-PREFIX: nil~.  The\ndefault value ~:GRPC-BLOCK-PREFIX: * TODO ${method}\\n\\n# ${decl}\\n~ adds\na new TODO org-section, followed by a comment with the grpc declation\nof the selected method.  Here's a list of template arguments that can\nbe used here:\n\n- ~${method}~ :: the name of the method, without the name of the service.\n- ~${method-full}~ :: the name of the method including the service name.\n- ~${decl}~ :: the entire declaration of the grpc method, including the\n  name, request and return types.\n- ~${req-type}~ :: the name of the request type.\n- ~${resp-type}~ :: the name of the response type.\n\n** Troubleshooting\n\nThere is not a lot of error handling at the moment.  So when something\ndoesn't work as expected, visit the ~*Messages*~ buffer.  All the calls\nto ~grpcurl~ and responses are logged there.\n\nNo support for streaming grpc methods yet.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshsms%2Fob-grpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshsms%2Fob-grpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshsms%2Fob-grpc/lists"}