Set up Gemini Code Assist on GitHub

This page shows you how to set up Gemini Code Assist on GitHub, a Gemini-powered agent that automatically summarizes pull requests and provides in-depth code reviews.

Before you begin

To set up Gemini Code Assist on GitHub, make sure you do the following:

  • Have a GitHub organization or personal account.

  • Have one or more GitHub repositories that you want to enable Gemini Code Assist on GitHub on.

  • If you are setting up the enterprise version of Gemini Code Assist on GitHub, you must have appropriate IAM roles in order to complete the setup within Google Cloud.

    • Ask your administrator to grant you the Service Usage Admin role and the geminicodeassistmanagement.scmConnectionAdmin role.

    • Alternatively, if you have the Admin or Owner basic roles, you have the necessary IAM permissions to complete the setup for the enterprise version.

Install Gemini Code Assist on GitHub

The following steps show you how to set up Gemini Code Assist on GitHub. Click the relevant tab for the version you want to set up, either the consumer version or enterprise version.

Consumer

  1. Go to the Gemini Code Assist app page.

  2. Sign in to your GitHub account if you haven't already.

  3. Click Install.

    A prompt to install the Gemini Code Assist app for a user or organization is displayed.

  4. When prompted to install the Gemini Code Assist app for a user or organization, select the organization you intend to use it on.

    After you've installed the Gemini Code Assist app for your GitHub organization, you're prompted to select the repositories to enable the Code Review integration.

    You're redirected to the Admin Console for the Gemini Code Assist app.

  5. Login with your GitHub account.

  6. Select a GitHub organization or personal account from the drop-down menu.

  7. Review and accept the Google Terms of Service, Generative AI Prohibited Use Policy and Privacy Policy, and then click Complete setup.

    Gemini Code Assist is added to the pull requests within your selected repositories.

After creation, Gemini Code Assist provides suggestions to your code review every time the pull request author or other human reviewers add comments with the /gemini tag on the pull request.

Gemini Code Assist is now active for all the pull requests within your selected repositories.

Enterprise

  1. In the Google Cloud console, go to the Gemini Code Assist Agents & Tools page.

    Go to Agents & Tools

    1. If you haven't previously enabled the Developer Connect API, you see a caution banner that prompts you to enable the API. If this happens, click the Enable button associated with the banner, and click the Enable button in the dialog window that appears.
  2. In the Agents section, locate the Code Assist Source Code Management card, and click Enable.

    The Enable Code Assist Source Code Management pane opens.

  3. In the Gemini Code Assist Management API section, click Enable.

  4. In the Select a connection section, click the Connection drop-down.

  5. In the drop-down, click Create new connection.

    The Link Git repositories via Developer Connect pane opens.

  6. In the Provider drop-down, select the GitHub provider you are using.

  7. In the Name field, enter a name for your connection.

  8. Click Continue.

    The Request GitHub OAuth token dialog window open.

  9. After reading the disclaimer, click I understand and continue.

  10. In the Install Gemini Code Assist page, click the account you want to install the app in.

  11. Choose whether to install the app for All repositories or Only select repositories.

  12. Click Install.

  13. Follow the GitHub steps to authenticate to GitHub.

    Once access is confirmed, the dialog window closes and you return to the Link Git repositories via Developer Connect pane.

  14. In the Link repositories section, click the Repositories drop-down, select the repositories you want to link, and click Ok.

  15. Click Link.

  16. In the Select a connection drop-down, select the connection you created.

  17. Click Done.

Gemini Code Assist is now active for all the pull requests within your selected repositories.

What's next