Questa pagina fornisce istruzioni per la creazione di un ambiente di sviluppo locale di Apigee API Management in Cloud Code per VS Code, che supporta Gemini Code Assist per la progettazione e lo sviluppo delle specifiche OpenAPI.
Consulta la
Panoramica dello sviluppo locale con Apigee per le funzionalità dell'ambiente di sviluppo locale.
La procedura di configurazione richiede il completamento di entrambe le sezioni di questa guida:
Per configurare e utilizzare Apigee in VS Code, devi:
Un progetto Google Cloud a cui accedere nel tuo ambiente di sviluppo locale. Per utilizzare Gemini Code Assist per sviluppare le specifiche delle API, non è necessario eseguire il provisioning del progetto per Apigee, ma è necessario eseguire il provisioning per Apigee per creare uno spazio di lavoro locale Apigee in cui puoi sviluppare e testare i proxy API. È necessario anche il provisioning di Apigee per visualizzare le API
dell'hub API Apigee nella sezione Apigee di Cloud Code.
(Consigliato) Hub API di cui è stato eseguito il provisioning
sul tuo progetto. L'hub API è obbligatorio per queste funzionalità:
Se non vuoi aggiungere l'hub API al tuo progetto, puoi associare il progetto
a un altro progetto in cui è abilitato l'hub API. Consulta
Collegare un progetto di runtime a un hub API per informazioni sul collegamento di un progetto a un hub API.
Familiarità con VS Code, come gestirlo e come eseguire azioni comuni come
accedere alle impostazioni e installare le estensioni. Consulta la
documentazione di VS Code.
Installa VS Code e l'estensione Cloud Code
Questa sezione fornisce le istruzioni di installazione per installare VS Code e l'estensione Cloud Code in VS Code. Questo è il primo passaggio per configurare lo sviluppo locale per
Apigee ed è necessario per utilizzare una qualsiasi delle funzionalità di sviluppo locale di Apigee, tra cui Gemini Code Assist.
Installa l'estensione Cloud Code, come descritto in
Installare l'estensione Cloud Code. Se prevedi di gestire
proxy API nel tuo ambiente locale, installa Docker nell'ambito della procedura.
(Consigliato) Attiva gli aggiornamenti automatici per l'estensione Cloud Code. In
Impostazioni, cerca Estensioni: aggiornamento automatico e attivalo per tutte le estensioni
o per l'estensione Cloud Code singolarmente.
Installa l'estensione Gemini Code Assist in VS Code.
(Consigliato) Attiva gli aggiornamenti automatici per l'estensione Gemini Code Assist. In
Impostazioni, cerca Estensioni: aggiornamento automatico e attivalo per tutte le estensioni
o per l'estensione Gemini Code Assist singolarmente.
In VS Code, accedi al tuo Google Cloud progetto in entrambe le
estensioni Gemini Code Assist e Cloud Code. Puoi farlo utilizzando uno dei seguenti metodi:
Aggiungi manualmente il progetto nel file settings.json:
Se apri la chat di Gemini Code Assist e non hai eseguito l'accesso a un progetto con Gemini
abilitato, vedrai un messaggio in questo senso con un modo per accedere.
Seleziona Seleziona un Google Cloud progetto per aggiungere il progetto.
Per selezionare un progetto per Google Cloud dall'interno della sezione Apigee di Cloud Code,
espandi la sezione Hub API e fai clic su Cloud Code - Nessun progetto selezionato:
In alternativa, fai clic sul nome del progetto nella barra di stato di Cloud Code e seleziona il nuovo progetto:
Configura lo sviluppo del proxy API per lo sviluppo locale di Apigee
Completa i passaggi di questa sezione se vuoi utilizzare il tuo ambiente di sviluppo locale per
lo sviluppo e il test del proxy API Apigee. Completa anche questi passaggi per poter creare
un proxy API da una specifica OpenAPI.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-05 UTC."],[[["\u003cp\u003eThis page provides instructions for setting up Cloud Code for Apigee and Apigee hybrid API management in Visual Studio Code (VS Code).\u003c/p\u003e\n"],["\u003cp\u003eInstallation involves downloading VS Code, installing the Cloud Code extension with Docker, restarting VS Code, and setting up an Apigee workspace and emulator.\u003c/p\u003e\n"],["\u003cp\u003eGemini Code Assist, a preview feature, can be used with Cloud Code and Apigee by enabling the Gemini for Google Cloud API and granting appropriate Identity and Access Management roles.\u003c/p\u003e\n"],["\u003cp\u003eVS Code supports integration with various source control management providers like Git for managing code versions, also allowing for more extension in the marketplace.\u003c/p\u003e\n"],["\u003cp\u003eAfter setting up cloud code, you can access and explore API management, build and deploy API proxies, or seek support through GitHub or Stack Overflow.\u003c/p\u003e\n"]]],[],null,["# Set up Apigee API Management in Cloud Code for VS Code\n\n*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\n\n*View [Apigee Edge](https://docs.apigee.com/api-platform/get-started/what-apigee-edge) documentation.*\n\n\nThis page provides instructions for creating an Apigee API Management local development\nenvironment in [Cloud Code for VS Code](/code/docs/vscode), which supports\nGemini Code Assist for OpenAPI spec design and development.\nSee [Overview of local development with Apigee](/apigee/docs/api-platform/local-development/overview) for features in the local development environment.\n\nThe setup process requires completion of both of these sections of this guide:\n\n- [Before you begin](#before-you-begin)\n- [Install VS Code and the Cloud Code extension](#install)\n\n\nDepending on your use cases, also complete one or both of these sections:\n\n- [Set up Gemini Code Assist for Apigee in\n Cloud Code](#set-up-gemini)\n- [Set up API proxy development for Apigee\n local development](#set-up-proxy-development)\n\nBefore you begin\n----------------\n\nTo set up and use Apigee in VS Code, you need:\n\n1. A Google Cloud project to log into in your local development environment. The project does not need to be provisioned for Apigee in order to use Gemini Code Assist to develop API specs, but does need to be provisioned for Apigee to create an Apigee local workspace where you can develop and test API proxies. Apigee provisioning is also required to see any [Apigee API hub](/apigee/docs/apihub/what-is-api-hub) APIs in the Apigee section of Cloud Code.\n2. (Recommended) [API hub](/apigee/docs/apihub/what-is-api-hub) provisioned on your project. API hub is required for these features:\n - [Enterprise context](/apigee/docs/api-platform/local-development/vscode/develop-design-edit-apis#enterprise-context) when generating OpenAPI specs.\n - Creation of a [remote mock server](/apigee/docs/api-platform/local-development/vscode/develop-design-edit-apis#use-remote-mock-server) for testing API specs.\n\n If you do not want to add API hub to your project, you could associate the project with another project that has API hub enabled instead. See [Attach a runtime project to an API hub](/apigee/docs/apihub/auto-register-apigee-proxies#attach-a-runtime-project) for information on attaching a project to an API hub.\n3. The [Required roles to use\n Gemini Code Assist in Apigee](#required-roles-to-use-gemini-code-assist-in-apigee) for actions you plan to perform. You must have the [Service Usage Admin](/service-usage/docs/access-control#predefined_roles) role on your user account for the project to set up Gemini Code Assist.\n4. Familiarity with VS Code, how to manage VS Code, and how to perform common actions such as accessing settings and installing extensions. See the [VS Code documentation](https://code.visualstudio.com/docs).\n\nInstall VS Code and the Cloud Code extension\n--------------------------------------------\n\nThis section provides the installation instructions for installing VS Code and the\nCloud Code extension in VS Code. This is the first step in setting up local development for\nApigee and is required to use any of the Apigee local development\nfeatures, including Gemini Code Assist.\n\nTo install VS Code and the Cloud Code extension:\n\n1. Download and install **[Visual Studio Code (VS Code)](https://code.visualstudio.com)** on your local machine, if it is not already installed.\n2. Install the Cloud Code extension, as described in [Install the Cloud Code extension](/code/docs/vscode/install). If you plan to manage [API proxies](/apigee/docs/api-platform/fundamentals/understanding-apis-and-api-proxies#howdoyoucreateanapiproxy) in your local environment, install Docker as part of the process.\n3. (Recommended) Enable automatic updates for the Cloud Code extension. In **Settings** , search for **Extensions: Auto Update** and enable it for all extensions or for the Cloud Code extension individually.\n4. Restart VS Code.\n\nSet up Gemini Code Assist for Apigee\n------------------------------------\n\nFollow these steps to set up\n[Gemini Code Assist for Apigee](/apigee/docs/api-platform/local-development/overview#gemini-apigee-local-dev) in your local\ndevelopment environment. Note the [Required roles to use Gemini Code Assist in Apigee](#required-roles-to-use-gemini-code-assist-in-apigee).\n\n1. Make sure you've completed the steps in [Install VS Code and the Cloud Code extension](/apigee/docs/api-platform/local-development/setup#install), if not already completed.\n2. Install the Gemini Code Assist extension in VS Code.\n3. (Recommended) Enable automatic updates for the Gemini Code Assist extension. In **Settings** , search for **Extensions: Auto Update** and enable it for all extensions or for the Gemini Code Assist extension individually.\n4. If not already installed, install the [gcloud CLI](https://cloud.google.com/sdk/docs/install).\n5. Enable the Gemini for Google Cloud API for the project. You need the [Service Usage Admin](/service-usage/docs/access-control#predefined_roles) role to perform this step. \n\n ```scdoc\n gcloud services enable cloudaicompanion.googleapis.com --project=YOUR_PROJECT\n ```\n6. In VS Code, log in to your Google Cloud project in *both* the Gemini Code Assist and Cloud Code extensions. You can do this using either of these methods:\n - Manually add the project in your `settings.json` file: \n\n ```\n {\n \"cloudcode.apigee.gemini.options\": {\n \"cloudcode.project\": \"YOUR_PROJECT\",\n \"geminicodeassist.project\": \"YOUR_PROJECT\"\n ...\n }\n }\n ```\n - Select the project when prompted: \n\n If you open Gemini Code Assist chat and are not logged in to a project with Gemini enabled, you'll see a message to that effect with a way to log in. Select **select a Google Cloud project** to add the Project. \n\n \u003cbr /\u003e\n\n To select a project for Google Cloud from within the **Apigee** section of Cloud Code, expand the **API hub** section and click **Cloud Code - No Project selected** : \n\n \u003cbr /\u003e\n\n Or, click the project name in the Cloud Code status bar and select the new project:\n7. Add any needed [Required roles to use Gemini Code Assist in Apigee](#required-roles-to-use-gemini-code-assist-in-apigee) to your user account.\n8. If you want to be able to create an API proxy bundle from an OpenAPI spec and manage it in your local development environment, complete the steps in [Set up your local\n development environment for API proxy development](#set-up-proxy-development).\n\n### Required roles to use Gemini Code Assist in Apigee\n\nYou'll need the roles listed below to perform API design and testing steps using\nGemini Code Assist:\n\nSet up API proxy development for Apigee\nlocal development\n---------------------------------------------------------\n\nComplete the steps in this section if you want to use your local development environment for\nApigee API proxy development and testing. Also complete these steps to be able to create\nan API proxy from an OpenAPI spec.\n\n1. [Create an Apigee workspace](/apigee/docs/api-platform/local-development/vscode/manage-apigee-workspace#creating_an_apigee_workspace).\n2. [Install the Apigee Emulator](/apigee/docs/api-platform/local-development/vscode/manage-apigee-emulator#install).\n3. [Add a container](/apigee/docs/api-platform/local-development/vscode/manage-apigee-emulator#adding_a_container_for_the_apigee_emulator) for deploying to the Apigee Emulator.\n\nWhat's next\n-----------\n\nAfter completing the installation and setup steps, get started using Cloud Code:\n\n- Complete the Gemini Code Assist tutorial for Apigee: [Tutorial: Use Gemini Code Assist to design, develop, and test APIs in Apigee and Cloud Code](/apigee/docs/api-platform/local-development/vscode/tutorial-gemini)\n- [Access and explore API Management in Cloud Code](/apigee/docs/api-platform/local-development/vscode/explore)\n- [Build and deploy your first API proxy in local development](/apigee/docs/api-platform/local-development/vscode/get-started)"]]