| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
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.
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:
Add the following entries to your .gitignore file:
# gemini-cli settings
.gemini/
# GitHub App credentials
gha-creds-*.jsonYou have two options to set up a workflow:
Option A: Use setup command (Recommended)
Start the Gemini CLI in your terminal:
geminiIn Gemini CLI in your terminal, type:
/setup-github
Option B: Manually copy workflows
Pull Request Review:
Issue Triage:
General AI Assistance:
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 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.
gemini_debug: (Optional) Enable debug logging and output streaming.
gemini_model: (Optional) The model to use with Gemini.
google_api_key: (Optional) The Vertex AI API key to use with Gemini.
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.
use_gemini_code_assist: (Optional, default: false) Whether to use Code Assist for Gemini model access instead of the default Gemini API key. For more information, see the Gemini CLI documentation.
use_vertex_ai: (Optional, default: false) Whether to use Vertex AI for Gemini model access instead of the default Gemini API key. For more information, see the Gemini CLI documentation.
extensions: (Optional) A list of Gemini CLI extensions to install.
upload_artifacts: (Optional, default: false) Whether to upload artifacts to the github action.
use_pnpm: (Optional, default: false) Whether or not to use pnpm instead of npm to install gemini-cli
workflow_name: (Optional, default: ${{ github.workflow }}) The GitHub workflow name, used for telemetry purposes.
github_pr_number: (Optional, default: ${{ github.event.pull_request.number }}) The Pull Request number the CLI is operating on. Defaults to the event payload.
github_issue_number: (Optional, default: ${{ github.event.issue.number }}) The Issue number (or comma-separated list of issue numbers) the CLI is operating on. Defaults to the event payload.
summary: The summarized output from the Gemini CLI execution.
error: The error output from the Gemini CLI execution, if any.
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 Required |
|---|---|---|---|---|
| GEMINI_DEBUG | Enables debug logging for the Gemini CLI. | Variable | No | Never |
| GEMINI_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. Optional - only needed for WIF with service account (not required for direct WIF). | Variable | No | Using WIF with service account |
| 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 |
Warning
Do not use the DEBUG environment variable as it causes the Gemini CLI to hang waiting for node debugger to attach.
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 Required |
|---|---|---|---|
| GEMINI_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. |
| GOOGLE_API_KEY | Your Google API Key to use with Vertex AI. | No | You have a express Vertex AI account. |
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:
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.
The Gemini CLI can be extended with additional functionality through extensions. These extensions are installed from source from their GitHub repositories.
For detailed instructions on how to set up and configure extensions, go to the Extensions documentation.
To ensure the security, reliability, and efficiency of your automated workflows, we strongly recommend following our best practices. These guidelines cover key areas such as repository security, workflow configuration, and monitoring.
Key recommendations include:
For a comprehensive guide on securing your repository and workflows, please refer to our Best Practices 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.
| Back | FazBrowse Home | New Git URL |