
A GitHub Action invoking the Gemini CLI.
run-gemini-cli is a GitHub Action that integrates [Gemini] into your development workflow via the [Gemini CLI]. It acts both as an autonomous agent for critical routine coding tasks, and an on-demand collaborator you can quickly delegate work to.
Use it to perform GitHub pull request reviews, triage issues, perform code analysis and modification, and more using [Gemini] conversationally (e.g., @gemini-cli fix this issue) directly inside your GitHub repositories.
@gemini-cli /review).gh).GEMINI.md file in your repository to provide
project-specific instructions and context to [Gemini CLI].Get started with Gemini CLI in your repository in just a few minutes:
Obtain your API key from [Google AI Studio] with generous free-of-charge quotas
Store your API key as a secret named GEMINI_API_KEY in your repository:
GEMINI_API_KEY, Value: your API keyAdd the following entries to your .gitignore file:
# gemini-cli settings
.gemini/
# GitHub App credentials
gha-creds-*.json
You have two options to set up a workflow:
Option A: Use setup command (Recommended)
Start the Gemini CLI in your terminal:
gemini
In Gemini CLI in your terminal, type:
/setup-github
Option B: Manually copy workflows
examples/workflows directory to your repository's .github/workflows directory. Note: the gemini-dispatch.yml workflow must also be copied, which triggers the workflows to run.Pull Request Review:
@gemini-cli /review on an existing pull request to manually trigger a reviewIssue Triage:
@gemini-cli /triage on existing issues to manually trigger triagingGeneral AI Assistance:
@gemini-cli followed by your request@gemini-cli explain this code change@gemini-cli suggest improvements for this function@gemini-cli help me debug this error@gemini-cli write unit tests for this componentThis action provides several pre-built workflows for different use cases. Each workflow is designed to be copied into your repository's .github/workflows directory and customized as needed.
This workflow acts as a central dispatcher for Gemini CLI, routing requests to the appropriate workflow based on the triggering event and the command provided in the comment. For a detailed guide on how to set up the dispatch workflow, go to the Gemini Dispatch workflow documentation.
This action can be used to triage GitHub Issues automatically or on a schedule. For a detailed guide on how to set up the issue triage system, go to the GitHub Issue Triage workflow documentation.
This action can be used to automatically review pull requests when they are opened. For a detailed guide on how to set up the pull request review system, go to the GitHub PR Review workflow documentation.
This type of action can be used to invoke a general-purpose, conversational Gemini AI assistant within the pull requests and issues to perform a wide range of tasks. For a detailed guide on how to set up the general-purpose Gemini CLI workflow, go to the Gemini Assistant workflow documentation.
gcp_location: (Optional) The Google Cloud location.
gcp_project_id: (Optional) The Google Cloud project ID.
gcp_service_account: (Optional) The Google Cloud service account email.
gcp_workload_identity_provider: (Optional) The Google Cloud Workload Identity Provider.
gcp_token_format: (Optional, default: access_token) The token format for authentication. Set to "access_token" to generate access tokens (requires service account), or set to empty string for direct WIF. Can be "access_token" or "id_token".
gcp_access_token_scopes: (Optional, default: https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/userinfo.email,https://www.googleapis.com/auth/userinfo.profile) The access token scopes when using token_format "access_token". Comma-separated list of OAuth 2.0 scopes.
gemini_api_key: (Optional) The API key for the Gemini API.
gemini_cli_version: (Optional, default: latest) The version of the Gemini CLI to install. Can be "latest", "preview", "nightly", a specific version number, or a git branch, tag, or commit. For more information, see Gemini CLI releases.