啟用 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 工具管理員 (
roles/cloudaicompanion.codeToolsAdmin
) 角色。
如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和機構的存取權」。
您或許還可透過自訂角色或其他預先定義的角色取得必要權限。
在 Google API 控制台中,前往 Gemini Code Assist 的「Tools」頁面。
前往「工具」
找出要啟用的工具,然後按一下「啟用」。工具詳細資料頁面隨即開啟。
在「Configuration」部分中,選取要為工具建立 Developer Connect 帳戶連接器的地區。可用的地區列於 Developer Connect 地點。
按一下「啟用」。
工具已啟用。
系統會提示您連結帳戶,以便在 IDE 中使用這項工具。如果您想在 IDE 中使用這項工具,請按一下「連結」,然後按照指示連結帳戶。如果不想使用這項工具,可以略過連線步驟。
在 Google Cloud 專案中,授予開發人員 Gemini Code Assist 工具使用者 (roles/cloudaicompanion.codeToolsUser
) 角色。
開發人員可在 IDE 中使用這項工具。使用者可以透過 @TOOL_NAME
在 Gemini Code Assist 對話中提示工具,向已啟用的 Gemini Code Assist 工具進行驗證。其中 TOOL_NAME 是 Gemini Code Assist 工具的名稱。
後續步驟
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-09-02 (世界標準時間)。
[null,null,["上次更新時間: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)."]]