Review GitHub code using Gemini Code Assist

Gemini Code Assist on GitHub brings the power of Gemini to the pull request process by acting as a code reviewer. Gemini Code Assist on GitHub uses a Gemini-powered agent that automatically summarizes pull requests and provides in-depth code reviews, speeding up reviews and increasing the quality of code.

Once you've set up Gemini Code Assist on GitHub, you can invoke Gemini Code Assist at any stage of the pull request to review the code. You can interact with Gemini Code Assist in the pull request comments directly by:

  • Asking clarifying questions on the review that Gemini Code Assist creates.
  • Prompting Gemini Code Assist by adding the /gemini tag to your comments to ask questions in the context of the pull request.

Gemini Code Assist will automatically retrieve helpful information from the repository and pull request to perform its tasks.

This document is intended for developers of all skill levels. It assumes that you have a working knowledge of GitHub.

Consumer version and enterprise version

Gemini Code Assist on GitHub is available in a consumer version, which you install directly in GitHub, and an enterprise version, which you install through Google Cloud.

The following table summarizes the differences between the consumer version and enterprise version:

Consumer version Enterprise version (Preview)
Setup Directly in GitHub Managed through Google Cloud
Terms of service Google terms of service Google Cloud terms of service
Quotas 33 pull requests per day 100+ pull requests per day
Configuration and style guide Set per-repository within GitHub Can be set either per-repository within GitHub or across multiple repositories from Google Cloud
GitHub support

GitHub

GitHub

GitHub Enterprise Server

GitHub Enterprise Cloud

Use Gemini Code Assist on GitHub

This section provides steps for using Gemini Code Assist on GitHub once you've completed the setup. This section applies to both consumer and enterprise versions of Gemini Code Assist on GitHub.

Before you begin

To complete the tasks in this section, make sure you have set up Gemini Code Assist on GitHub.

Get pull request summary and feedback

To get an initial review for a pull request from Gemini Code Assist, create a new pull request.

When you open the new pull request, Gemini Code Assist provides an initial review. After the review is ready, gemini-code-assist[bot] is automatically added as a reviewer to the pull request. Gemini Code Assist adds an issue comment in the Conversation tab of the pull request with its feedback, and proceeds to add comments about modified portions of the code.

Review comments contain the following information:

  • Severity of the issue, given as Critical, High, Medium, and Low
  • Feedback on the issue
  • Code suggestion that can be committed directly from GitHub
  • References to a user-provided style guide

Manually invoke Gemini Code Assist

Gemini Code Assist listens to comments from any pull request contributor, and decides whether it should respond.

To manually invoke Gemini Code Assist, you can use the following commands in the main comments page on the pull request as an issue comment.

Command Description
/gemini summary Posts a summary of the changes in the pull request
/gemini review Posts a code review of the changes in the pull request
/gemini Manually invokes Gemini Code Assist in comments
/gemini help Overview of the available commands

Manage the Gemini Code Assist settings

Anyone with permissions to modify GitHub App settings for the organization can manage the Gemini Code Assist app settings. You can review the permissions provided to the Gemini Code Assist app, manage repository access, and uninstall the Gemini Code Assist app.

To modify the settings, follow these steps:

  1. On GitHub, click your profile photo and then click Settings.
  2. In the Integrations section, click Applications. A list of GitHub Apps is displayed.
  3. Beside Gemini Code Assist, click Configure.

What's next