Enable Gemini Code Assist tools

This document describes how to enable Gemini Code Assist tools. Google Cloud administrators should complete these steps to enable tools for developers in their IDEs.

For more information about tools, read the Gemini Code Assist tools overview. To configure tools for use in your IDE, see Configure Gemini Code Assist tools.

Before you begin

  1. Set up Gemini Code Assist.
  2. Make sure that billing is enabled for your Google Cloud project.

  3. Enable the Developer Connect API.

    Enable the API

    Developer Connect is used to create connections between user accounts and Gemini Code Assist tool services.

Required roles

To get the permissions that you need to enable Gemini Code Assist tools, ask your administrator to grant you the following IAM roles on the Google Cloud project:

For more information about granting roles, see Manage access to projects, folders, and organizations.

You might also be able to get the required permissions through custom roles or other predefined roles.

Enable tools

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

    Go to Tools

  2. Locate the tool you want to enable and then click Enable. The tool details page opens.

  3. In the Configuration section, select a region to create your Developer Connect account connector in for the tool. The available regions are listed in Developer Connect locations.

  4. Click Enable.

    The tool is enabled for your project and is available to developers in their IDEs.

    You are prompted to connect to your account to use the tool in the IDE. If you want to use the tool in the IDE, then click Connect and follow the instructions to connect your account. You can skip the connection step if you don't want to use the tool.

  5. To enable users to authenticate to the tool, you must create a custom role and grant it to users.

    1. Create a custom role by running the following command:

      gcloud iam roles create ROLE_NAME \
          --project=PROJECT \
          --title="Gemini Code Assist Tools User" \
          --description="custom role for tools user" \
          --permissions=cloudaicompanion.codeToolsSettings.get,cloudaicompanion.codeToolsSettings.list,cloudaicompanion.settingBindings.codeToolsSettingsGet,cloudaicompanion.settingBindings.codeToolsSettingsList,cloudaicompanion.instances.queryEffectiveSetting
      

      Replace the following:

      • ROLE_NAME with the name you want to give your custom role.
      • PROJECT with your Google Cloud project ID.
    2. Grant your users the custom role by running the following command:

      gcloud projects add-iam-policy-binding PROJECT \
          --member=PRINCIPAL_TYPE:PRINCIPAL \
          --role=projects/PROJECT/roles/ROLE_NAME
      

      Replace the following:

      • PROJECT with your Google Cloud project ID.
      • PRINCIPAL_TYPE with the principal type you want to grant the custom role to. For more information on principal types, see Principal identifiers.
      • PRINCIPAL with the identifier for your principal.
      • ROLE_NAME with the name you gave your custom role.

        The following example grants the custom role tools-user to a single user luka@example.com in the project test-project:

        gcloud projects add-iam-policy-binding test-project \
            --member=user:luka@example.com \
            --role=projects/test-project/roles/tools-user
        

      Once you grant users your custom role, they can authenticate to enabled Gemini Code Assist tools by prompting the tool in the Gemini Code Assist chat with @TOOL_NAME. Where TOOL_NAME is the name of the tool.

what's next