Interact with Antigravity CLI

Check my progress

/ 10

Prompt the CLI to use a built-in tool

Check my progress

/ 10

Test the application

Check my progress

/ 20

Improve the application CSS

Check my progress

/ 20

Generate unit tests and run them

Check my progress

/ 20

Add docstrings to application files

Check my progress

/ 20

This lab may incorporate AI tools to support your learning.
This content is not yet optimized for mobile devices.
For the best experience, please visit us on a desktop computer using a link sent by email.

GSP1382

Google Cloud self-paced labs

Overview

Imagine for a moment you work as a Software Development Engineer for Cymbal Software. Cymbal wants to adopt a partner application development program for their marketplace and many of the partners are single, independent developers. However, Cymbal needs a mechanism to review new partner generated apps and ensure that the apps are built and tested to certain standards, including: a consistent user experience, inline code documentation, and adherence to Cymbal's stylistic and branding guidelines.

In this hands-on lab, you will learn about the basics of Antigravity CLI. You will also take what you have learned, and use it to review and improve a partner-built Tic Tac Toe application using the Antigravity CLI to explain the codebase, apply a stylesheet, generate professional Google-style docstrings, and build a robust unit testing suite.

Antigravity CLI is an open-source, agent-first development terminal tool built in Go. It brings multi-agent orchestration directly into your workspace and terminal environment, enabling faster execution and background processing.

Explore other content in the Gemini Enterprise Agent Ready (GEAR) program.

What you'll learn

In this lab, you learn how to perform the following tasks:

  • Configure and interact with the Antigravity CLI using built-in tools and shell mode.
  • Explain and test the application codebase using natural language prompts.
  • Improve the application CSS and inline code documentation with Google-style docstrings.
  • Generate and run unit tests to ensure that the application is stable.

What you'll need

This lab can be run entirely within Google Cloud Shell, which comes pre-installed with Antigravity CLI.

This lab is designed for users and developers of all levels (including beginners).

Setup and requirements

Before you click the Start Lab button

Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.

This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.

To complete this lab, you need:

  • Access to a standard internet browser (Chrome browser recommended).
Note: Use an Incognito (recommended) or private browser window to run this lab. This prevents conflicts between your personal account and the student account, which may cause extra charges incurred to your personal account.
  • Time to complete the lab—remember, once you start, you cannot pause a lab.
Note: Use only the student account for this lab. If you use a different Google Cloud account, you may incur charges to that account.

Activate Cloud Shell

Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources.

  1. Click Activate Cloud Shell Activate Cloud Shell icon at the top of the Google Cloud console.

  2. Click through the following windows:

    • Continue through the Cloud Shell information window.
    • Authorize Cloud Shell to use your credentials to make Google Cloud API calls.

When you are connected, you are already authenticated, and the project is set to your Project_ID, . The output contains a line that declares the Project_ID for this session:

Your Cloud Platform project in this session is set to {{{project_0.project_id | "PROJECT_ID"}}}

gcloud is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion.

  1. (Optional) You can list the active account name with this command:
gcloud auth list
  1. Click Authorize.

Output:

ACTIVE: * ACCOUNT: {{{user_0.username | "ACCOUNT"}}} To set the active account, run: $ gcloud config set account `ACCOUNT`
  1. (Optional) You can list the project ID with this command:
gcloud config list project

Output:

[core] project = {{{project_0.project_id | "PROJECT_ID"}}} Note: For full documentation of gcloud, in Google Cloud, refer to the gcloud CLI overview guide.

Task 1. Configure Antigravity CLI for your needs

Install Antigravity CLI

Since Antigravity CLI is currently being integrated into Google Cloud Shell, you need to manually install it for this lab.

  1. In Cloud Shell, run the following command to download and install the Antigravity CLI:

    curl -fsSL https://antigravity.google/cli/install.sh | bash
  2. Add the installation directory to your environment PATH so the agy binary can be executed from anywhere, and reload your bash profile:

    echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc

Enable Cloud Logging for Antigravity CLI

To support scoring for some of the tasks in this lab, you need to enable Cloud Logging on Antigravity CLI.

  1. In Cloud Shell, run the following command to update ~/.bashrc with custom Antigravity CLI error handling. This will help you with troubleshooting the application.

    gcloud storage cp gs://spls/gsp1382/bash/.bashrc ~/.bashrc source ~/.bashrc

Once the commands are complete, you will notice the prompt change to green. This confirms bash is using the new file.

  1. Run the following commands to configure Cloud Logging for Antigravity CLI:

    export NODE_NO_WARNINGS=1 export GOOGLE_CLOUD_LOCATION=global export ZONE=$(gcloud compute instances list \ --filter "name="lab-vm"" --format "value(zone.basename())") export EXTERNAL_IP=$(gcloud compute instances describe \ lab-vm --zone=$ZONE \ --format='get(networkInterfaces[0].accessConfigs[0].natIP)')

Review Antigravity CLI configuration options

The Antigravity CLI's behavior is controlled by configuration files and environment variables. There are two key global directories and a workspace configuration you need to be aware of:

  • ANTIGRAVITY.md: This file provides natural language guidelines and context to the agent. The CLI reads this file to understand your project's coding standards and conventions.

  • ~/.gemini/antigravity-cli/settings.json: This file controls the global configuration of the CLI, including telemetry parameters.

  • ~/.gemini/config/hooks.json: Global hooks mapping specific lifecycle events (such as model response parsing) to custom scripts.

Review Antigravity CLI configuration via settings.json

When you use Cloud Shell to run Antigravity, a default theme for Antigravity CLI and the authentication method is already selected and configured for you. The file that Antigravity CLI uses to "remember" your preferences is called settings.json and you can also use it to customize Antigravity CLI.

Configure the Antigravity CLI with a custom settings.json

  1. Create (if it does not exist yet) and access the global Antigravity CLI config directory with the following command:

    mkdir -p ~/.gemini/antigravity-cli && cd ~/.gemini/antigravity-cli
  2. Use nano to create a new settings.json file:

    { "model": "Gemini 3.8 Flash (Medium)", "telemetry": { "enabled": true, "target": "gcp", "otlpEndpoint": "http://${EXTERNAL_IP}:4318", "otlpProtocol": "http", "logPrompts": true, "useCollector": true } }

Install the Cymbal Developer custom plugin

To facilitate advanced partner review automation, telemetry logging, and graceful capacity error fallback handling, you will install the custom Cymbal Developer plugin.

  1. Copy the custom plugin package files from the Google Cloud Storage bucket to a temporary directory and grant execute permissions to the hook script:

    mkdir -p /tmp/cymbal-developer gcloud storage cp gs://spls/gsp1382/plugins/cymbal-developer/* /tmp/cymbal-developer/ chmod +x /tmp/cymbal-developer/handle_capacity_error.sh
  2. Install the custom plugin using the Antigravity CLI:

    agy plugin install /tmp/cymbal-developer
  3. In Cloud Shell, verify that the plugin has been successfully loaded by listing the active plugins:

    agy plugin list

You should see the cymbal-developer plugin listed as enabled and active.

Create the project folder

Before you get started in Antigravity CLI, you need to create a folder to use as your home folder for all the projects that you may create inside of it. This is a starting point for the Antigravity CLI to work with, although it may reference some other folders on your system, as needed.

  1. Run the following commands in Cloud Shell to create a sample folder, antigravity-projects, and navigate to it:

    cd ~ mkdir antigravity-projects cd antigravity-projects

Task 2. Interact with Antigravity CLI

In this task, you interact with Antigravity CLI. To use Antigravity CLI, you must first authenticate and log in.

  1. Run the following command to launch Antigravity CLI and start a new session:

    agy
  2. To sign in, select the Use a Google Cloud project option, and then Continue with Google Cloud.

  3. Complete the interactive authentication flow:

    • The CLI will print an Authentication required URL in your terminal.
    • Hold CTRL (or CMD on macOS) and click the link, or copy and paste the URL into a new browser tab.
    • Log in using your student Google credentials provided for this lab.
    • Click Allow to grant the required permissions.
    • Copy the authorization code displayed in the browser, paste it back into your Cloud Shell terminal at the prompt, and press ENTER.
  4. When prompted to Select billing model, use the arrow keys to select 2. Pay As You Go – Pay only for the tokens you use, billed through Gemini platform, and press ENTER.

  5. Copy and paste your Google Cloud Project ID () and press ENTER.

  6. Select global for the Google Cloud Location and press ENTER.

  7. Continue with Agent Platform if prompted.

  8. On the setup wizard screens (Choose your color scheme and Terms of Service & Data Use), use the arrow keys to navigate and press ENTER to select Next and then Done to accept the default settings.

Note: You may be prompted with Do you trust this folder? since you are running Antigravity CLI in a new folder. Select 1. Trust folder (antigravity-projects) to continue.
  1. Before sending your first prompt, switch the active model to Gemini 3.8 Flash so it complies with the lab environment's organization policy. Type the following command and press ENTER:

    /model
  2. Use the arrow keys to select Gemini 3.8 Flash and press ENTER.

  3. Copy and paste the following and then press ENTER to prompt Antigravity CLI with your first query:

Give me a famous quote on Artificial Intelligence and who said that?

The GoogleSearch tool (a built-in tool in Antigravity CLI) will be invoked to search the web, returning the quote.

Verify your progress

  1. In the Antigravity chat, ask the assistant to generate the summary file and upload it to the grading bucket:
Please write a summary_task1.md file in my project directory that lists: - The famous quote on Artificial Intelligence you provided and who said it - The tool you used to retrieve this quote (GoogleSearch) Once written, upload this file to the grading storage bucket by running: gcloud storage cp summary_task1.md gs://{{{project_0.project_id | project_id}}}-grading/
  1. When Antigravity proposes the file creation and upload commands, click the Proceed / Run button directly in the chat UI (or allow the command execution).
  2. Once completed, click Check my progress below to verify the objective.
Interact with Antigravity CLI
  1. A quick way to understand Antigravity CLI and the various commands that it supports is to type /help (forward slash) inside the active agy session to receive a list of commands and keyboard shortcuts.

  2. Exit the interactive Antigravity CLI session to return to your standard Cloud Shell prompt:

    Type /exit (or press CTRL+D).

Task 3. Explore Antigravity CLI built-in tools & non-interactive mode

In this task, you will test Antigravity CLI's non-interactive mode and explore its built-in tools.

Use non-interactive mode

An interesting option is to run Antigravity CLI in a non-interactive mode. This means that you directly provide it the prompt and it goes ahead and responds to it, without the Antigravity CLI interactive terminal opening up. Since you have already completed your authentication in the previous task, the cached OAuth tokens will be used, allowing the non-interactive command to run instantly.

  1. Run the following command with the -p (prompt) parameter:

    agy -p "What is the gcloud command to deploy to Cloud Run?"

Note that in non-interactive mode, you cannot continue the conversation with follow-up questions. This mode also does not allow you to authorize tools (including WriteFile) or to run shell commands.

Explore built-in tools

Antigravity CLI comes with a set of built-in tools, which the agent uses to interact with your local environment, access information, and perform actions.

  1. Launch Antigravity CLI interactive mode again to explore these tools:

    agy
  2. Run the following command to get a list of current built-in tools:

    /mcp

Can Antigravity CLI simply call these tools when it wants to? The simple answer is no. By default, the agent always asks for permission when performing sensitive operations, such as writing files or executing terminal commands. You remain in full control.

Press ESC to exit the mcp mode.

Prompt the CLI to use a tool

In this section, you give Antigravity CLI a prompt to choose and execute one of its built-in tools.

Suppose you want to get information on the dates of the next total solar eclipse and save that into a file in the local working directory from where you launched Antigravity CLI.

  1. Give Antigravity CLI the following prompt:

    Search for the dates of the next total solar eclipse and save them in a file named eclipse-dates.txt

First, it will search the web using GoogleSearch. Then, it will use the WriteFile tool to write to a local file. You will be asked to authorize this write operation.

  1. Go ahead and press ENTER to allow once for now.

    To check if a file is written, you can use @ in the prompt box to open the file auto-complete helper.

Verify your progress

  1. In the Antigravity chat, ask the assistant to generate the summary file and upload it to the grading bucket:
Please write a summary_task2.md file in my project directory that lists: - The search conducted for the dates of the next total solar eclipse - The local file created (eclipse-dates.txt) with the dates - The built-in tools used (GoogleSearch and WriteFile) Once written, upload this file to the grading storage bucket by running: gcloud storage cp summary_task2.md gs://{{{project_0.project_id | project_id}}}-grading/
  1. When Antigravity proposes the file creation and upload commands, click the Proceed / Run button directly in the chat UI (or allow the command execution).
  2. Once completed, click Check my progress below to verify the objective.
Prompt the CLI to use a built-in tool

Task 4. Use Antigravity CLI in shell mode

It's also possible to work directly with the shell from within Antigravity CLI.

  1. Press ! in the prompt box. This toggles to shell mode.

    When in shell mode, you can use standard commands like pwd, cat, and ls, for example.

    Now try printing the contents of a file via the cat command.

  2. Give the following prompt to Antigravity CLI:

    cat eclipse-dates.txt

Task 5. Explain the codebase and test the application

In this task and the remaining tasks within this hands-on lab you will explore how to use Antigravity CLI to assist you with partner code reviews and improvements to meet these standards.

Download and extract the Tic Tac Toe codebase

  1. While still in shell mode, run the command below to download, extract, and list the Tic Tac Toe codebase.

    gcloud storage cp gs://spls/gsp1382/tictactoe.zip . unzip tictactoe.zip ls -la

Explain the codebase

  1. Give the following prompt to the agent:

    Explain the codebase. Focus your response on the 'check_winner' algorithm and list all the Flask routes including their expected JSON payloads.

The agent should respond with output containing a summary explaining what the app is (a tic-tac-toe game) and how it uses a 1D array of 9 elements, checks 8 winning combinations, and exposes /, /move (expecting {"position": int}), and /reset.

Test the application

Now that you have a general understanding of the application, it is time to test it.

  1. Give the following prompt to the agent:

    It is time for me to test the appliction. Can you install and run it? For now do not make any changes to the application.

You should see various Action Required messages, review each change and accept it by choosing Allow once. The agent will then load the dependencies, and create a virtual environment for the application and launch it via a local URL.

Note: You may need to prompt it to provide the application URL.
  1. Click the link for the application URL. You see the application running in a new tab within your browser.

  2. Test the Tic Tac Toe game first as a draw between X and O.

  3. Test the Tic Tac Toe game as a win for X.

    Are the results of the two games as expected? If so, the logic for the app is working as designed.

Verify your progress

  1. In the Antigravity chat, ask the assistant to generate the summary file and upload it to the grading bucket:
Please write a summary_task3.md file in my project directory that lists: - The explanation of the Tic Tac Toe codebase, including the check_winner algorithm and Flask routes - The installation and test execution steps performed for the application (including testing win/draw scenarios) Once written, upload this file to the grading storage bucket by running: gcloud storage cp summary_task3.md gs://{{{project_0.project_id | project_id}}}-grading/
  1. When Antigravity proposes the file creation and upload commands, click the Proceed / Run button directly in the chat UI (or allow the command execution).
  2. Once completed, click Check my progress below to verify the objective.
Test the application

Task 6. Improve the application CSS

During your test you noticed that the User Interface for the Tic Tac Toe game was very basic and was effectively using only black and white. After a deeper review of the index.html file you notice that a cascading style sheet has not been applied to the page, and believe the app would be improved by applying a stylesheet. Also applying a stylesheet would help ensure the new app adheres to Cymbal's branding guidelines.

In this task you will use Antigravity CLI to modify index.html and suggest a stylesheet to be applied to it.

  1. Give the following prompt to the agent:

    During testing I noticed that the User Interface for the Tic Tac Toe game is very basic and lacks color. Could you suggest improvements, and explain your reasoning?

The agent will suggest improving the index.html page with the addition of a CSS script at the top of the file.

Note: You may need to prompt it to implement the changes and, if necessary, to provide the application URL.
  1. Review and accept the changes so that they are applied.

  2. Open the index.html file in the Editor, and review the changes the agent made.

  3. Once you complete reviewing the changes access the application at http://localhost:5000 to observe how they actually were applied. Notice how color has been added to the X and O symbols.

Verify your progress

  1. In the Antigravity chat, ask the assistant to generate the summary file and upload it to the grading bucket:
Please write a summary_task4.md file in my project directory that lists: - The CSS improvements suggested and applied to index.html - The styling changes added to improve the Tic Tac Toe user interface and colors Once written, upload this file to the grading storage bucket by running: gcloud storage cp summary_task4.md gs://{{{project_0.project_id | project_id}}}-grading/
  1. When Antigravity proposes the file creation and upload commands, click the Proceed / Run button directly in the chat UI (or allow the command execution).
  2. Once completed, click Check my progress below to verify the objective.
Improve the application CSS

Task 7. Generate unit tests and run them

Now that you have improved the application with the addition of a stylesheet, it is time to generate your own unit tests.

  1. Give the following prompt to the agent:

    Based on app.py, generate a Python test file named test_app.py using the pytest framework. Include tests for: 1. A horizontal win for 'X', 2. A draw scenario, 3. Preventing a move on an already occupied square. Use Flask's test_client. As you are building the test_app.py file and attempting to complete the testing of the application do not make changes app.py.

As with previous tasks you will be asked to allow the changes. Review these and accept them.

The result is you should see the test_app.py file is generated and the agent will run the test_app.py file to perform the testing on your behalf. You should see a report with the results of the testing.

Note: Depending on the testing results provided you may receive only a basic description like "all tests pass..." You can ask the agent with a subsequent prompt for more detail if desired.
  1. If you want to review details of the test_app.py you can use the Cloud Shell editor to open the test_app.py file.

    You should see that the test_app.py file should look similar to the following:

    import pytest from app import app, check_winner @pytest.fixture def client(): app.config['TESTING'] = True with app.test_client() as client: yield client def test_horizontal_win(): test_board = ["X", "X", "X", "", "", "", "", "", ""] assert check_winner(test_board) == "X" def test_draw(): test_board = ["X", "O", "X", "X", "O", "O", "O", "X", "X"] assert check_winner(test_board) == "Draw" def test_invalid_move(client): # Reset to ensure clean slate, then occupy position 0 client.post('/reset') client.post('/move', json={'position': 0}) # Try to play in the same position response = client.post('/move', json={'position': 0}) assert response.status_code == 400 assert response.get_json()['error'] == 'Invalid move'
  2. Optional Step - If you would like to know more detail about the test results, use a prompt like:

    Can you tell me more detail about the test results?

The result is you will see further detail about the test results, as interpreted by the agent.

Verify your progress

  1. In the Antigravity chat, ask the assistant to generate the summary file and upload it to the grading bucket:
Please write a summary_task5.md file in my project directory that lists: - The generation of test_app.py using pytest framework - The test cases implemented (horizontal win for 'X', draw scenario, and invalid move check) - The pytest execution results Once written, upload this file to the grading storage bucket by running: gcloud storage cp summary_task5.md gs://{{{project_0.project_id | project_id}}}-grading/
  1. When Antigravity proposes the file creation and upload commands, click the Proceed / Run button directly in the chat UI (or allow the command execution).
  2. Once completed, click Check my progress below to verify the objective.
Generate unit tests and run them

Task 8. Add docstrings to application files

As part of your code review of the application files, you notice that these do not have inline documentation for various features. You can add these now using the Antigravity CLI.

  1. Give the following prompt to the agent:

    Add docstrings to all files. Use the Google style.

You see that the agent will attempt to modify each file with inline comments.

  1. Once you accept all the changes you can review the comments and modify these if they need further detail by using the Cloud Shell editor.

Verify your progress

  1. In the Antigravity chat, ask the assistant to generate the summary file and upload it to the grading bucket:
Please write a summary_task6.md file in my project directory that lists: - The files updated with Google-style docstrings (such as app.py and test_app.py) - A summary of the inline code documentation added across the application Once written, upload this file to the grading storage bucket by running: gcloud storage cp summary_task6.md gs://{{{project_0.project_id | project_id}}}-grading/
  1. When Antigravity proposes the file creation and upload commands, click the Proceed / Run button directly in the chat UI (or allow the command execution).
  2. Once completed, click Check my progress below to verify the objective.
Add docstrings to application files

Congratulations!

Congratulations, you've successfully used Antigravity CLI to review and improve applications. Consider what you have learned in this lab and how it can improve your workflow. Which parts of the Antigravity CLI code review process can you implement today and why? How would these make your workflow more efficient?

Next steps / Learn more

Manual Last Updated November 6, 2026

Lab Last Tested November 6, 2026

Copyright 2026 Google LLC. All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.

Before you begin

  1. Labs create a Google Cloud project and resources for a fixed time
  2. Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
  3. On the top left of your screen, click Start lab to begin

Use private browsing

  1. Copy the provided Username and Password for the lab
  2. Click Open console in private mode

Sign in to the Console

  1. Sign in using your lab credentials. Using other credentials might cause errors or incur charges.
  2. Accept the terms, and skip the recovery resource page
  3. Don't click End lab unless you've finished the lab or want to restart it, as it will clear your work and remove the project

This content is not currently available

We can notify you via email when it becomes available

Great!

We can contact you via email if it becomes available

One lab at a time

Confirm to end all existing labs and start this one

Use private browsing to run the lab

Using an Incognito or private browser window is the best way to run this lab. This prevents any conflicts between your personal account and the Student account, which may cause extra charges incurred to your personal account.