{"id":13741363,"url":"https://github.com/googleapis/gapic-generator-kotlin","last_synced_at":"2026-03-07T01:01:26.268Z","repository":{"id":33663625,"uuid":"146018544","full_name":"googleapis/gapic-generator-kotlin","owner":"googleapis","description":"Generate Kotlin gRPC client libraries from Protocol Buffer definitions.","archived":false,"fork":false,"pushed_at":"2024-07-15T12:29:51.000Z","size":37529,"stargazers_count":59,"open_issues_count":18,"forks_count":16,"subscribers_count":49,"default_branch":"main","last_synced_at":"2025-06-09T05:46:03.527Z","etag":null,"topics":["android","client-library","coroutines","experimental","grpc","grpc-client","kotlin","protoc","protocol-buffers"],"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/googleapis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-24T17:03:17.000Z","updated_at":"2025-04-04T04:09:20.000Z","dependencies_parsed_at":"2024-11-06T19:20:47.147Z","dependency_job_id":null,"html_url":"https://github.com/googleapis/gapic-generator-kotlin","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/googleapis/gapic-generator-kotlin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fgapic-generator-kotlin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fgapic-generator-kotlin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fgapic-generator-kotlin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fgapic-generator-kotlin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/googleapis","download_url":"https://codeload.github.com/googleapis/gapic-generator-kotlin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleapis%2Fgapic-generator-kotlin/sbom","scorecard":{"id":438380,"data":{"date":"2025-08-11","repo":{"name":"github.com/googleapis/gapic-generator-kotlin","commit":"e117e779c6a0c3fe741596518ab2e259b66334f2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":2,"reason":"Found 6/28 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":3,"reason":"binaries present in source code","details":["Warn: binary detected: example-api-cloud-clients-android/gradle/wrapper/gradle-wrapper.jar:1","Warn: binary detected: example-api-cloud-clients/gradle/wrapper/gradle-wrapper.jar:1","Warn: binary detected: example-client/gradle/wrapper/gradle-wrapper.jar:1","Warn: binary detected: example-server/gradle/wrapper/gradle-wrapper.jar:1","Warn: binary detected: generator-docker-runner/gradle/wrapper/gradle-wrapper.jar:1","Warn: binary detected: generator/gradle/wrapper/gradle-wrapper.jar:1","Warn: binary detected: showcase-test/gradle/wrapper/gradle-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 21 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Info: Possibly incomplete results: error parsing shell code: invalid UTF-8 encoding: generator/src/main/resources/ktlint:0","Warn: containerImage not pinned by hash: Dockerfile:5","Warn: containerImage not pinned by hash: Dockerfile:27","Warn: containerImage not pinned by hash: Dockerfile:44","Warn: containerImage not pinned by hash: example-api-cloud-clients-android/Dockerfile.android:1: pin your Docker image by updating openjdk:8 to openjdk:8@sha256:86e863cc57215cfb181bd319736d0baf625fe8f150577f9eb58bd937f5452cb8","Info:   0 out of   4 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}}]},"last_synced_at":"2025-08-19T05:09:40.621Z","repository_id":33663625,"created_at":"2025-08-19T05:09:40.621Z","updated_at":"2025-08-19T05:09:40.621Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30204446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["android","client-library","coroutines","experimental","grpc","grpc-client","kotlin","protoc","protocol-buffers"],"created_at":"2024-08-03T04:00:58.295Z","updated_at":"2026-03-07T01:01:26.222Z","avatar_url":"https://github.com/googleapis.png","language":"Kotlin","readme":"# Kgen\n\nKgen creates idiomatic coroutine-based gRPC Kotlin client libraries from a [protocol buffer](https://developers.google.com/protocol-buffers/docs/proto3) description of an API.\n\nIt supports full-stack Kotlin development on the server and in Android applications.\n\n[![CircleCI](https://circleci.com/gh/googleapis/gapic-generator-kotlin/tree/master.svg?style=svg)](https://circleci.com/gh/googleapis/gapic-generator-kotlin/tree/master)\n[![codecov](https://codecov.io/gh/googleapis/gapic-generator-kotlin/branch/master/graph/badge.svg)](https://codecov.io/gh/googleapis/gapic-generator-kotlin)\n[![Release](https://jitpack.io/v/googleapis/gapic-generator-kotlin.svg)](https://jitpack.io/#googleapis/gapic-generator-kotlin)\n\n*Note* This project is a preview. Please try it out and let us know what you think, but there \nare currently no guarantees of any form of stability or support.\n\n## Why Kgen?\n\nProtocol buffers and gRPC have great tool chains, but they do not have first class support for Kotlin and \nthey do not provide many configuration options for generated code. Kgen generates idiomatic Kotlin clients\nfor protobuf APIs and introduces new configuration options to make the code even more enjoyable to use.\n\nClients generated using Kgen can also take advantage of the Kotlin [API extension library](https://github.com/googleapis/gax-kotlin)\nthat simplifies common operations like customizing request and response metadata, handling paged responses, and\nusing client-side gRPC interceptors with with your API.\n\n## Quick Start\n\nKgen can be used with [docker](https://www.docker.com/), [gradle](https://gradle.org/), \nor as a [protoc plugin](https://developers.google.com/protocol-buffers/). \n\n### Docker\n\nTo get started with docker, clone the project and run the following to generate a client for the [example service](example-server).\n\n```bash\n$ mkdir my-output \n$ docker run --rm \\\n             --mount type=bind,source=\"$(pwd)\"/example-server/src/main/proto,target=/proto \\\n             --mount type=bind,source=\"$(pwd)\"/my-output,target=/generated \\\n         gcr.io/gapic-images/gapic-generator-kotlin\n```\n\n### Gradle\n\nTo use gradle put all of your `.proto` files in `app/src/main/proto` (Android) or `src/main/proto` (non-Android)\nand let the [Protobuf plugin for gradle](https://github.com/google/protobuf-gradle-plugin) take care\nof the rest. For example, add the following sections to your application's `build.gradle`:\n\n```groovy\nrepositories {\n   // jitpack releases are required until we start publishing to maven\n   maven { url 'https://jitpack.io' }\n}\n\nplugins {\n    id \"com.google.protobuf\" version \"0.8.8\"\n}\n\ndependencies {\n    // pick the ONE dependency that is appropriate for your platform (server or Android) \n    implementation 'com.github.googleapis.gax-kotlin:kgax-grpc:master-SNAPSHOT'\n    //implementation 'com.github.googleapis.gax-kotlin:kgax-grpc-android:master-SNAPSHOT'\n}\n\nprotobuf {\n    protoc {\n        artifact = 'com.google.protobuf:protoc:3.7.1'\n    }\n    plugins {\n        // For android projects, uncomment the lines below\n        //javalite {\n        //    artifact = 'com.google.protobuf:protoc-gen-javalite:3.0.0'\n        //}\n        client {\n            artifact = 'com.github.googleapis:gapic-generator-kotlin:master-SNAPSHOT:core@jar'\n        }\n    }\n    generateProtoTasks {\n        all().each { task -\u003e\n            // For android projects, uncomment the lines below\n            //task.builtins {\n            //    remove java\n            //}\n            task.plugins {\n                // For android projects, uncomment the lines below\n                //javalite {}\n\n                // this generates your client library and helper Kotlin builders!\n                client {}\n            }\n        }\n    }\n}\n\n```\n\nEnjoy your new client library! The generated source code will available on the classpath\nfor your application to use, and you can find it at `app/build/generated/source/proto`\n(Android) or `build/generated/source/proto` (standalone application).\n\nSee the [RUNNING.md](RUNNING.md) for more details, configuration, and command line options.\n\n## Example\n\nA simple \"hello world\" style example is in the [example-server](example-server)\nand [example-client](example-client) directories. Here's how it works:\n\nFirst, describe the API like this ([complete proto file](example-server/src/main/proto/google/example/hello.proto)):\n    \n```proto\nservice HelloService {\n  rpc HiThere (HiRequest) returns (HiResponse);\n}\n\nmessage HiRequest {\n    string query = 1;\n}\n\nmessage HiResponse {\n    string result = 1;\n}\n```\n\nNext, run Kgen on the proto files and it will produce Kotlin code that you can use to call\nthe API, like this ([complete example](example-client/src/main/kotlin/example/Client.kt)):\n    \n```kotlin\nfun main() = runBlocking\u003cUnit\u003e {\n    // create a client with an insecure channel\n    val client = HelloServiceClient.create(\n        channel = ManagedChannelBuilder.forAddress(\"localhost\", 8080)\n            .usePlaintext()\n            .build()\n    )\n\n    // call the API\n    val response = client.hiThere(hiRequest {\n        query = \"Hello!\"\n    })\n\n    // print the result\n    println(\"The response was: ${response.result}\")\n\n    // shutdown\n    client.shutdownChannel()\n}\n```\n\nThe generator creates three things from the proto files:\n1. A client for each `service` declared\n1. A type-safe builder for each `message` declared\n1. Unit tests for each generated client\n\nFinally, you can add annotations to the proto to customize the way Kgen generates code. For example:\n\n```proto\nrpc HiThere (HiRequest) returns (HiResponse) {\n  option (google.api.method_signature) = {\n    fields: [\"result\"]\n  };\n}\n```\n\nwill change the client so that you can call the example API like this instead:\n\n```kotlin\n// call the API\nval response = client.hiThere(\"Hello!\")\n```\n\nOf course, don't forget to implement the API ([example implementation](example-server/src/main/kotlin/example/ExampleServer.kt)).\n\nYou can run this example locally by using gradle:\n\n```bash\n$ cd example-server \u0026\u0026 ./gradlew run\n$ cd example-client \u0026\u0026 ./gradlew run\n```\n\nMore complex examples, using Google Cloud APIs, can be found in the examples directories:\n  + [Server side examples](example-api-cloud-clients/README.md).\n  + [Android examples](example-api-cloud-clients-android/README.md).\n\n## Configuration\n\nKgen can be configured to produce Kotlin code that's easy to use in various flavors. See the\n[CONFIGURATION.md](CONFIGURATION.md) to learn about these additional features.\n\n## Contributing\n\nContributions to this library are always welcome and highly encouraged.\n\nSee the [CONTRIBUTING](CONTRIBUTING.md) documentation for more information on how to get started.\n\n## Versioning\n\nThis library is currently a *preview* with no guarantees of stability or support. Please get involved and let us know\nif you find it useful and we'll work towards a stable version.\n\n## Disclaimer\n\nThis is not an official Google product.\n","funding_links":[],"categories":["Language-Specific"],"sub_categories":["Kotlin"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogleapis%2Fgapic-generator-kotlin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogleapis%2Fgapic-generator-kotlin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogleapis%2Fgapic-generator-kotlin/lists"}