Install the Cloud Code for VS Code extension

The Cloud Code for VS Code extension adds support for Google Cloud development toVS Code.

Before you begin

Before you install Cloud Code, confirm that the following toolsare installed and set up on your system:

  1. Install and set upVisual Studio Codeon your machine.
  2. Install and configure language support.

    The Cloud Code extension works best with the followinglanguages:

  3. InstallGit.Git is required for copying samples to your machine.

  4. Install theDocker clientand add it to thePATH environment variable:

    • If you're building exclusively using Cloud Build or Jib, you canskip installing Docker.
    • If you're using WSL but can't install Docker for Desktop, useminikube instead for local development with Cloud Code.
  5. If you're using Google Cloud,create a Google Cloud projectand thenenable billing.

    Projects allow you to collect the related resources for a single applicationin one place, manage APIs, enable Google Cloud services, add and removecollaborators, and manage permissions for Google Cloud resources.

Install Cloud Code

Note: When installing Cloud Code, theGemini Code Assist extensionis also installed by default.

Install the Google Cloud Code extension from the Visual Studio Code Marketplace.

Alternatively, open theExtensions view in VS Code:

  1. ClickExtension iconExtensions or pressCtrl/Cmd+Shift+X.

  2. Search forGoogle Cloud Code.

    Cloud Code extension in VSC marketplace

  3. ClickInstall.

  4. If prompted, restart VS Code.

    After the extension has successfully installed, the Cloud Codeicon is added to the activity bar and ready for use. You can furtherconfigure your Cloud Code installation by specifying yourpreferences using the top-level application taskbar:navigate toCode >Settings >Settings >Extensions andsearch forGemini Code Assist + Google Cloud Code.

Custom versions of dependencies

By default, Cloud Code hasAuto dependencies turned on andinstalls some command-line dependencies for you automatically. If you turn offauto dependencies, you can use custom versions of the dependencies but youmust install the dependencies yourself for Cloud Code to work.

To use custom versions of Cloud Code dependencies:

  1. ClicksettingsManage >Settings and then setAuto Dependencies(cloudcode.autoDependencies) tooff.

  2. Install the following dependencies on yourPATH:

Install the Google Cloud CLI

The first time you use a feature that requires the gcloud CLI, you'regiven the option to learn how to install the CLI from your IDE, use an existinginstallation, or continue with managed dependencies. If you prefer to installthe gcloud CLI manually, seeInstall the gcloud CLI.

Optional: Verify Cloud Code vsix using VsixSignTool

To verify the Cloud Code vsix with the VsixSignTool, perform thefollowing steps:

  1. Ensure you're using the following:

    • Nuget package manager
    • Windows OS
    • A production release of Cloud Code
  2. Install theMicrosoft VsixSignTooland take note of the installation path.

  3. Open VS Code and navigate toExtensions icon in VSCExtensions >Cloud Code.

  4. In theDetails tab, underExtension Resources, clickMarketplace.

  5. On the Marketplace page in your browser, underResources, clickDownload Extension to download the packaged version ofCloud Code. This downloads the packaged version ofCloud Code, which has a.vsix file extension, to your defaultdownload directory.

  6. If you'd prefer to verify a different version than the latest, click theVersion History tab and select a different version to download.

    Note: The earliest Cloud Code version you're able to verify with VsixSignTool is1.20.2.
  7. When the download is complete, open a terminal window and run the following:

    PATH_TO_VSIXSIGNTOOL verifyPATH_TO_DOWNLOADED_VSIX
  8. Confirm that the output matches the following:

    VsixSignTool Success: PackagePATH_TO_DOWNLOADED_VSIX is valid.

Authenticate credentials for Google Cloud

To help with application development with Google Cloud APIs, when yousign in to the gcloud CLI, yourApplication Default Credentialsare updated.

Sign in to Google Cloud

If you aren't signed in to Google Cloud, follow these steps to sign in:

  1. In the Cloud Code status bar, clickCloud Code - Sign in.
  2. If this is your first time connecting to Google Cloud in your IDE,you're prompted to addhttps://accounts.google.com to Trusted Domain. ClickConfigure Trusted Domains in the dialog that appears:

    Configure Trusted Domain dialog

  3. Follow the prompts to sign in using your web browser.

  4. When prompted to allow Cloud Code to access your GoogleAccount, clickAllow.

Known issue: Edge browser redirects to HTTPS on authentication callback

When using the Microsoft Edge browser to authenticate your credentials, you maynotice that the Edge browser redirects the URLhttp://localhost:3000 tohttps://localhost:3000. This leads to the following failure message:

The connection for this site is not secure. localhost sent an invalid response.Try running Windows Network Diagnostics. ERR_SSL_PROTOCOL_ERROR.

To solve this problem, you can excludelocalhost from the redirection:

  1. In the address bar of your Edge browser, enteredge://net-internals/#hsts.

  2. Go to theDelete domain security policies section.

  3. Enterlocalhost, then clickDelete.

Log out of Google Cloud

  1. ClickCloud Code and then expandHelp and Feedback.
  2. ClickSign Out of Google Cloud and when prompted, selectSign-out.
  3. Alternatively, you can log out using the Command Palette. PressCtrl/Cmd+Shift+P or clickView >Command Palette,and then clickSign out of all accounts in Google Cloud SDK.

Change the active Google Cloud project

  1. In the Cloud Code status bar, click the active project name.

    Active project name in status bar

  2. In the Quick Pick menu that appears, selectsync_altSwitch Project.

  3. Select a project or enter keywords in the search bar to filter projects.

Authenticate credentials for debugging applications locally

In addition to the authentication steps in theSign in to Google Cloud section, you'll need toauthenticate your credentials to debug an application locally in your IDE thatmakes Google API calls.

If you don't authenticate your credentials for debugging applications, an errormessage appears in your IDE when you attempt to run/debug a local applicationthat tries to make a call to a Google API.

To authenticate your credentials for debugging applications locally, perform thefollowing steps:

  1. Installgcloud to your machine if you haven't alreadydone so.

  2. Run the following command:

    gcloud auth application-default login
  3. When you've finished debugging locally, you can sign out by running thefollowing command:

    gcloud auth application-default revoke

To learn more about Application Default Credentials and Google APIs, seeAuthenticate to Cloud services using client libraries.

What's next

Get Support

To send feedback, report issues onGitHub,or ask a question onStack Overflow.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.