启用 Gemini Code Assist 工具
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本文档介绍了如何启用 Gemini Code Assist 工具。Google Cloud 管理员应完成以下步骤,以便在其 IDE 中为开发者启用工具。
如需详细了解这些工具,请参阅 Gemini Code Assist 工具概览。如需配置要在 IDE 中使用的工具,请参阅配置 Gemini Code Assist 工具。
准备工作
- 设置 Gemini Code Assist。
- 确保您的 Google Cloud 项目已启用结算功能
启用 Developer Connect API。
启用该 API
Developer Connect 用于在 Google 和 Gemini Code Assist 工具之间建立连接。
所需的角色
如需获取启用 Gemini Code Assist 工具所需的权限,请让您的管理员为您授予 Google Cloud 项目的
Gemini Code Assist Tools Admin (
roles/cloudaicompanion.codeToolsAdmin
) 角色。
如需详细了解如何授予角色,请参阅管理对项目、文件夹和组织的访问权限。
您也可以通过自定义角色或其他预定义角色来获取所需的权限。
在 Google API 控制台中,前往 Gemini Code Assist 工具页面。
前往“工具”页面
找到要启用的工具,然后点击启用。系统随即会打开工具详情页面。
在配置部分中,选择一个区域,以便为该工具创建 Developer Connect 账号连接器。Developer Connect 位置中列出了可用的区域。
点击启用。
该工具已启用。
系统会提示您关联到您的账号,以便在 IDE 中使用该工具。如果您想在 IDE 中使用该工具,请点击关联,然后按照说明关联您的账号。如果您不想使用该工具,可以跳过关联步骤。
为开发者授予 Google Cloud 项目的 Gemini Code Assist Tools User (roles/cloudaicompanion.codeToolsUser
) 角色。
开发者可以在其 IDE 中使用该工具。用户可以通过在 Gemini Code Assist 对话中使用 @TOOL_NAME
提示工具,向已启用的 Gemini Code Assist 工具进行身份验证。其中 TOOL_NAME 是 Gemini Code Assist 工具的名称。
后续步骤
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-09-02。
[null,null,["最后更新时间 (UTC):2025-09-02。"],[],[],null,["| **Preview**\n|\n| This product or feature is in preview. Products and features that are\n| in preview are available \"as is\".\n\nThis document describes how to enable Gemini Code Assist tools.\nGoogle Cloud administrators should complete these steps to enable tools for\ndevelopers in their IDEs.\n\nFor more information about tools, read the\n[Gemini Code Assist tools overview](/gemini-code-assist/docs/tools-agents/tools-overview). To configure tools\nfor use in your IDE, see\n[Configure Gemini Code Assist tools](/gemini-code-assist/docs/tools-agents/configure-tools-standard-enterprise).\n\nBefore you begin\n\n1. [Set up Gemini Code Assist](/gemini-code-assist/docs/set-up-gemini-standard-enterprise).\n2. [Make sure billing is enabled for your Google Cloud project](https://cloud.google.com/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project)\n3. Enable the Developer Connect API.\n\n [Enable the API](https://console.cloud.google.com//flows/enableapi?apiid=developerconnect.googleapis.com)\n\n Developer Connect is used to create connections between Google and\n Gemini Code Assist tools.\n\nRequired roles To get the permissions that you need to enable Gemini Code Assist tools, ask your administrator to grant you the [Gemini Code Assist Tools Admin](https://cloud.google.com/iam/docs/roles-permissions/cloudaicompanion#cloudaicompanion.codeToolsAdmin) (`roles/cloudaicompanion.codeToolsAdmin`) role on the Google Cloud project.\n\n\u003cbr /\u003e\n\nFor more information about granting roles, see\n[Manage access to projects, folders, and organizations](https://cloud.google.com/iam/docs/granting-changing-revoking-access).\n\nYou might also be able to get the required permissions through\n[custom roles](https://cloud.google.com/iam/docs/creating-custom-roles) or\nother [predefined roles](https://cloud.google.com/iam/docs/understanding-roles).\n\n\nEnable tools\n\n1. In the Google API Console, go to the Gemini Code Assist **Tools**\n page.\n\n\n [Go to Tools](https://console.cloud.google.com/gemini-code-assist/agents-tools)\n2. Locate the tool you want to enable and then click **Enable**. The tool\n details page opens.\n\n3. In the **Configuration** section, select a region to create your\n Developer Connect account connector in for the tool. The available\n regions are listed in\n [Developer Connect locations](https://cloud.google.com/developer-connect/docs/locations).\n\n4. Click **Enable**.\n\n The tool is enabled.\n\n You are prompted to connect to your account to use the tool in the\n IDE. If you want to use the tool in the IDE, then click **Connect** and\n follow the instructions to connect your account. You can skip the connection\n step if you don't want to use the tool.\n5. Grant your developers the\n [Gemini Code Assist Tools User](https://cloud.google.com/iam/docs/roles-permissions/cloudaicompanion#cloudaicompanion.codeToolsUser) (`roles/cloudaicompanion.codeToolsUser`) role on the Google Cloud\n project.\n\n The tool is available to developers in their IDEs. Users can authenticate to\n enabled Gemini Code Assist tools by prompting the tool in the\n Gemini Code Assist chat with `@`\u003cvar translate=\"no\"\u003eTOOL_NAME\u003c/var\u003e. Where\n \u003cvar translate=\"no\"\u003eTOOL_NAME\u003c/var\u003e is the name of the Gemini Code Assist tool.\n\nWhat's next\n\n- [Configure Gemini Code Assist tools](/gemini-code-assist/docs/tools-agents/configure-tools-standard-enterprise).\n- [Get Started with Gemini Code Assist tools](/gemini-code-assist/docs/tools-agents/get-started-with-tools-standard-enterprise)."]]