{"id":20086289,"url":"https://github.com/asarkar/okgrpc","last_synced_at":"2026-05-12T19:35:15.987Z","repository":{"id":67175252,"uuid":"315335222","full_name":"asarkar/okgrpc","owner":"asarkar","description":"gRPC Java client and CLI","archived":false,"fork":false,"pushed_at":"2020-12-07T23:47:33.000Z","size":212,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-13T02:18:39.238Z","etag":null,"topics":["cli","grpc","grpc-client","grpc-java","grpc-kotlin","grpc-reflect","protobuf","protobuf-java"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asarkar.png","metadata":{"files":{"readme":"README.md","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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-23T14:08:42.000Z","updated_at":"2024-03-10T05:30:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"85de8927-d9bb-4788-b019-822abcbd0dfc","html_url":"https://github.com/asarkar/okgrpc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asarkar%2Fokgrpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asarkar%2Fokgrpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asarkar%2Fokgrpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asarkar%2Fokgrpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asarkar","download_url":"https://codeload.github.com/asarkar/okgrpc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241518828,"owners_count":19975548,"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":["cli","grpc","grpc-client","grpc-java","grpc-kotlin","grpc-reflect","protobuf","protobuf-java"],"created_at":"2024-11-13T16:01:03.932Z","updated_at":"2026-05-12T19:35:15.584Z","avatar_url":"https://github.com/asarkar.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OkGRPC\n\ngRPC Java client and CLI based on [gRPC Server Reflection](https://github.com/grpc/grpc/blob/master/doc/server-reflection.md).\nCan be used to inspect gRPC services and execute RPC methods dynamically without needing a proto file. The client can\nbe directly used from any JVM source code, while the CLI can be executed on command line. No installation necessary,\nonly needs Java 8 or later.\n\n[![](https://github.com/asarkar/okgrpc/workflows/CI%20Pipeline/badge.svg)](https://github.com/asarkar/okgrpc/actions?query=workflow%3A%22CI+Pipeline%22)\n\n\n## CLI Usage\n\nYou can find the latest version on Bintray. [ ![Download](https://api.bintray.com/packages/asarkar/mvn/com.asarkar.grpc%3Aokgrpc-cli/images/download.svg) ](https://bintray.com/asarkar/mvn/com.asarkar.grpc%3Aokgrpc-cli/_latestVersion)\n\nIt's also on jcenter.\n\nIt's an executable JAR. Run with `--help` for main CLI usage, and `\u003ccommand\u003e --help` for specific command usage.\n\n\u003e For brevity, I show `java -jar okgrpc-cli-\u003cversion\u003e.jar` simply as `okgrpc-cli` below.\n\nGet all services:\n```\n$ okgrpc-cli -a localhost:64575 get\ncom.asarkar.okgrpc.test.GreetingService\ngrpc.reflection.v1alpha.ServerReflection\n```\n\nDescribe a service:\n```\n$ okgrpc-cli -a localhost:64575 desc -s com.asarkar.okgrpc.test.GreetingService\nname: \"com/asarkar/okgrpc/test/greeting_service.proto\"\npackage: \"com.asarkar.okgrpc.test\"\ndependency: \"com/asarkar/okgrpc/test/greeting.proto\"\nservice {\n  name: \"GreetingService\"\n  method {\n    name: \"Greet\"\n    input_type: \".com.asarkar.okgrpc.test.GreetRequest\"\n    output_type: \".com.asarkar.okgrpc.test.GreetResponse\"\n    options {\n    }\n  }\n  // more methods elided\n}\n```\nDescribe a method:\n```\n$ okgrpc-cli -a localhost:64575 desc -m com.asarkar.okgrpc.test.GreetingService.Greet\nname: \"Greet\"\ninput_type: \".com.asarkar.okgrpc.test.GreetRequest\"\noutput_type: \".com.asarkar.okgrpc.test.GreetResponse\"\noptions {\n}\n```\n\nDescribe a type:\n```\n$ okgrpc-cli -a localhost:64575 desc -t com.asarkar.okgrpc.test.GreetRequest\nname: \"GreetRequest\"\nfield {\n  name: \"greeting\"\n  number: 1\n  label: LABEL_OPTIONAL\n  type: TYPE_MESSAGE\n  type_name: \".com.asarkar.okgrpc.test.Greeting\"\n}\n```\n\nExecute a method:\n```\n$ okgrpc-cli -a localhost:64575 exec \\\n  \u003e -h \"key: value\" \\\n  \u003e com.asarkar.okgrpc.test.GreetingService.Greet \\\n  \u003e '{ \"greeting\": { \"name\" : \"test\" } }'\n{\n  \"result\": \"Hello, test\"\n}\n```\n\nIt is perfectly fine to send multiple requests for client streaming calls; each string needs to be a valid JSON \nrepresenting the Protobuf request object.\n\nBinary data may be sent in the request as valid UTF-8 encoded string (like Base64). Of course, the server needs to \nknow that and decode accordingly.\n\nIt is possible to use local `.proto` files if reflection isn't enabled on the server.\n```\n$ okgrpc-cli -a localhost:64575 exec \\\n  \u003e --proto-path=\u003cdirectory in which to search for proto file imports\u003e \\\n  \u003e --proto-file=\u003cservice proto file relative to the proto paths\u003e \\\n  \u003e com.asarkar.okgrpc.test.GreetingService.Greet \\\n  \u003e '{ \"greeting\": { \"name\" : \"test\" } }'\n{\n  \"result\": \"Hello, test\"\n}\n```\n\n## Client Usage\n\nYou can find the latest version on Bintray. [ ![Download](https://api.bintray.com/packages/asarkar/mvn/com.asarkar.grpc%3Aokgrpc-client/images/download.svg) ](https://bintray.com/asarkar/mvn/com.asarkar.grpc%3Aokgrpc-client/_latestVersion)\n\nIt's also on jcenter.\n\n```kotlin\nval client = OkGrpcClient.Builder()\n    .withChannel(ManagedChannelFactory.getInstance(address))\n    .build()\n```\n\nAll the methods are defined as extension functions in the `OkGrpcClientExtn` file, that from Java, will become `static`\nmethods in `OkGrpcClientExtnKt` class.\n\nSee KDoc for more details.\n\n## Contribute\n\nThis project is a volunteer effort. You are welcome to send pull requests, ask questions, or create issues.\nIf you like it, you can help by spreading the word!\n\n## License\n\nCopyright 2020 Abhijit Sarkar - Released under [Apache License v2.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasarkar%2Fokgrpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasarkar%2Fokgrpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasarkar%2Fokgrpc/lists"}