Using Antigravity to Deploy App to Google Cloud with Google Cloud Developer Plugin

1. Before you begin

In this codelab, you will install the Google Cloud Developer plugin for the Antigravity CLI and deploy an application to Google Cloud.

What you will learn

  • (Optional) Claim Google Cloud credits through the Google Developer Program or connect an existing Cloud Billing account.
  • Create a Google Cloud project, enable the Agent Platform API, and configure your Cloud Shell workspace.
  • Authenticate the Antigravity CLI using Application Default Credentials (ADC).
  • Install the Google Cloud Developer plugin in the Antigravity CLI.
  • Test the plugin by deploying a sample web application to Google Cloud.

Prerequisites

  • A Google account (a personal Gmail account is required to claim Google Developer Program credits).
  • A Cloud Billing account (claiming credits will create a temporary one automatically).

2. Claim Google Developer Program credits (Optional)

All Google Cloud projects need an active Cloud Billing account. If you are participating in a Google-supported workshop or event, you can claim Google Developer Program credits to receive a temporary, pre-funded billing account.

Steps

  1. Locate your credit redemption link in your event materials (for example, https://me.developers.google.com/benefits/claim/XXXX or https://g.dev/credits/XXXX).
  2. Open the link, log in with your personal Gmail account, and select Claim Credit.

claim_gdp_credits

  1. If prompted, complete the form to set up your Google Developer Program profile.
  2. Complete the Scan to Verify You're Human check by scanning the QR code with your mobile device.
  3. After verification, a confirmation screen will appear:

claim_credits_successfully

(Optional) 🔍 Check your claimed credits

  1. Click the Open Billing Account button or visit Cloud Billing to view your billing accounts in the Google Cloud console. Your new account will be listed under Your billing accounts:

newly_creation_billing_account

  1. Select your billing account, then click Credits in the left navigation menu to confirm your active credits, remaining balance, and expiration dates.

billing_account_credits

3. Create a Google Cloud project and set up environment

To use Google Cloud services, create a project and link it to an active billing account.

Create a Google Cloud project

  1. Open the Google Cloud console. From the navigation menu (☰), go to IAM & Admin > Create Project.

creating_a_project

  1. Complete the project configuration:
    • Project name: Enter a name and record the generated Project ID for future steps.
    • Billing account: Select your billing account (such as your Google Developer Program credits account). Note: If you have only one billing account, Google Cloud links it automatically and hides this field.
    • Parent resource: Select No organization (or choose your organization if applicable).

cloud_project_creation

  1. Click Create and wait for provisioning to finish.
  2. When the notification appears, click the Notifications icon in the upper-right corner and choose Select Project.

select_project

  1. Verify that your new project appears in the project selector at the top of the console. If not, open the selector and switch to it.

project_selector

Activate the Cloud Shell

We will use Cloud Shell to run the Antigravity CLI and complete the codelab.

  1. Click the Activate Cloud Shell icon in the top-right toolbar.

activate_cloud_shell

  1. If prompted, click Authorize to grant Cloud Shell access to Google Cloud APIs.

authorize_cloud_shell

  1. Verify your active project in the terminal prompt.

cloud_shell_project

If the correct project is not set, run this command:

gcloud config set project YOUR_PROJECT_ID

cloud_shell_project_set

Enable the Agent Platform API

The Antigravity CLI requires the Agent Platform API to access AI models. Enable the API by running the command in the Cloud Shell:

gcloud services enable aiplatform.googleapis.com

cloud_shell_enable_api

What we have done

  • Created and configured a Google Cloud project with billing.
  • Launched and authorized Cloud Shell.
  • Set the active project and enabled the Agent Platform API.

4. Launch Antigravity CLI

Download the sample app

We will use a sample app to test the deployment to Google Cloud. Please use the command in the Cloud Shell to download the sample app and enter the directory.

git clone https://github.com/ericsk/luckydraw.git
cd luckydraw/

Launch Antigravity

The Antigravity CLI (agy) is pre-installed in Cloud Shell. In this section, you will configure and launch the CLI.

To authorize the Antigravity CLI using Application Default Credentials (ADC), follow these steps:

  1. Set the required environment variables (AGY_ADC_AUTH, CLOUDSDK_CORE_PROJECT, and GOOGLE_CLOUD_QUOTA_PROJECT) so that Antigravity CLI uses your project's quota, then launch the CLI:
export AGY_ADC_AUTH=true
export CLOUDSDK_CORE_PROJECT=$(gcloud config get project)
export GOOGLE_CLOUD_QUOTA_PROJECT=$(gcloud config get project)
agy
  1. On first launch, you will be prompted to select a theme:

agy_cli_themes

and accept the terms of service:

agy_cli_tos

Use the arrow keys to navigate and press Enter to proceed.

  1. Because this is your first time running the CLI in this directory, you will be asked to trust it. Select Yes, I trust this folder and press Enter.

agy_cli_trust

  1. The Antigravity CLI is now running. Confirm that it points to your target project and current working directory (luckydraw).

agy_cli_launched

  1. Run the /quit command to exit Antigravity CLI and return to Cloud Shell. You will install the required plugin in the next section.

What we have done

  • Download the sample app for testing
  • Launch the Antigravity CLI in Cloud Shell with Google Cloud authentication.

5. Install and test the Google Cloud Developer plugin

To equip the Antigravity CLI with the tools and best practices required to work with Google Cloud Platform, install the Google Cloud Developer plugin.

Install the Google Cloud Developer plugin

In Cloud Shell (outside the Antigravity CLI), run the following command to install the Google Cloud Developer plugin:

agy plugin install https://github.com/google/skills/tree/main/plugins/cloud/google-cloud-developer

agy_cli_plugin_installation

Deploy your app from the Antigravity CLI

  1. Launch the Antigravity CLI:
agy
  1. Inside the CLI, prompt the agent to deploy your application and include any configuration preferences, such as the deployment region:
Please deploy this web app to Google Cloud. I'd like to publish it to the region in Taiwan
  1. The CLI might prompt you to approve commands as it executes tasks. Press Enter to confirm and continue.

agy_cli_deployment

Once the deployment completes, the agent returns the public URL for your application.

Clean up resources

To remove all created resources and avoid ongoing charges, ask the agent to tear down the environment:

Please clean up all stuff in this project

What you have done

  • Install the Google Cloud Developer plugin for the Antigravity CLI.
  • Deploy an application to Google Cloud using the Antigravity agent.

6. Congratulations

You have learned how to configure a project, billing account, and Cloud Shell on Google Cloud. You also used the Antigravity CLI and saw how the Google Cloud Developer plugin streamlines deploying and undeploying applications.

What you accomplished

  • (Optional) Claimed Google Developer Program credits and set up an active Cloud Billing account.
  • Created a Google Cloud project and linked it to an active Cloud Billing account.
  • Launched the Antigravity CLI using Google Cloud authentication.
  • Installed the Google Cloud Developer plugin for the Antigravity CLI.
  • Deployed and undeployed an application on Google Cloud.

Next steps