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
2. Add it as a GitHub SecretStore your API key as a secret named GEMINI_API_KEY
in your repository:
GEMINI_API_KEY
, Value: your API keyYou have two options to set up a workflow:
Option A: Use setup command (Recommended)
Start the Gemini CLI:
In the chat interface, type:
Option B: Manually copy workflows
examples/workflows
directory to your repository's .github/workflows
directory.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 component
This 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 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.
There is a known issue that action bot may approve the PR occasionally, to avoid this situation as org owner you can restrict who can approve the PR following Code Review Limits.
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 CLI workflow documentation.
prompt
: (Optional, default: You are a helpful assistant.
) A string passed to the Gemini CLI's --prompt
argument.
settings
: (Optional) A JSON string written to .gemini/settings.json
to configure the CLI's project settings. For more details, see the documentation on settings files.
gemini_api_key
: (Optional) The API key for the Gemini API.
gcp_project_id
: (Optional) The Google Cloud project ID.
gcp_location
: (Optional) The Google Cloud location.
gcp_workload_identity_provider
: (Optional) The Google Cloud Workload Identity Provider.
gcp_service_account
: (Optional) The Google Cloud service account email.
use_vertex_ai
: (Optional, default: false
) A flag to indicate if Vertex AI should be used.
use_gemini_code_assist
: (Optional, default: false
) A flag to indicate if Gemini Code Assist should be used.
gemini_cli_version
: (Optional, default: latest
) The version of the Gemini CLI to install.
summary
: The summarized output from the Gemini CLI execution.We recommend setting the following values as repository variables so they can be reused across all workflows. Alternatively, you can set them inline as action inputs in individual workflows or to override repository-level values.
Name Description Type Required When RequiredGEMINI_CLI_VERSION
Controls which version of the Gemini CLI is installed. Variable No Pinning the CLI version GCP_WIF_PROVIDER
Full resource name of the Workload Identity Provider. Variable No Using Google Cloud GOOGLE_CLOUD_PROJECT
Google Cloud project for inference and observability. Variable No Using Google Cloud SERVICE_ACCOUNT_EMAIL
Google Cloud service account email address. Variable No Using Google Cloud GOOGLE_CLOUD_LOCATION
Region of the Google Cloud project. Variable No Using Google Cloud GOOGLE_GENAI_USE_VERTEXAI
Set to true
to use Vertex AI Variable No Using Vertex AI GOOGLE_GENAI_USE_GCA
Set to true
to use Gemini Code Assist Variable No Using Gemini Code Assist APP_ID
GitHub App ID for custom authentication. Variable No Using a custom GitHub App
To add a repository variable:
For details about repository variables, refer to the GitHub documentation on variables.
You can set the following secrets in your repository:
Name Description Required When RequiredGEMINI_API_KEY
Your Gemini API key from Google AI Studio. No You don't have a GCP project. APP_PRIVATE_KEY
Private key for your GitHub App (PEM format). No Using a custom GitHub App.
To add a secret:
For more information, refer to the official GitHub documentation on creating and using encrypted secrets.
This action requires authentication to both Google services (for Gemini AI) and the GitHub API.
Choose the authentication method that best fits your use case:
You can authenticate with GitHub in two ways:
GITHUB_TOKEN
: For simpler use cases, the action can use the default GITHUB_TOKEN
provided by the workflow.For detailed setup instructions for both Google and GitHub authentication, go to the Authentication documentation.
This action can be configured to send telemetry data (traces, metrics, and logs) to your own Google Cloud project. This allows you to monitor the performance and behavior of the Gemini CLI within your workflows, providing valuable insights for debugging and optimization.
For detailed instructions on how to set up and configure observability, go to the Observability documentation.
Create a GEMINI.md file in the root of your repository to provide project-specific context and instructions to Gemini CLI. This is useful for defining coding conventions, architectural patterns, or other guidelines the model should follow for a given repository.
Contributions are welcome! Check out the Gemini CLI Contributing Guide for more details on how to get started.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4