Interact with Antigravity CLI

Check my progress

/ 25

Use Antigravity CLI non-interactive mode

Check my progress

/ 25

Verify local repository using Git MCP tools

Check my progress

/ 25

Commit project changes using Git MCP server

Check my progress

/ 25

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.

GSP1348

Google Cloud self-paced labs

Overview

Vibe coding is an emerging software development practice that uses artificial intelligence (AI) to generate functional code from natural language prompts, accelerating development, and making app building more accessible, especially for those with limited programming experience.

The term, coined by AI researcher Andrej Karpathy in early 2025, describes a workflow where the primary role shifts from writing code line-by-line to guiding an AI assistant such as Antigravity CLI to generate, refine, and debug an application through a more conversational process. This frees you up to think about the big picture, or the main goal of your app, while the AI handles writing the actual code.

Antigravity CLI is an open-source AI agent that brings the power of Gemini directly into your terminal. The Antigravity CLI project is open source and you can view the public roadmap to learn more about functionality enhancements, upcoming features, and bug fixes.

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 Antigravity CLI.
  • Use built-in tools and shell mode.
  • Configure a Model Context Protocol (MCP) server for extended functionality.
  • Build and deploy an app using vibe coding.

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

Open Cloud Shell Editor and Terminal

For the best experience and optimal terminal formatting when running Antigravity CLI, use the Cloud Shell Editor's integrated terminal:

  1. Click Open Editor on the Cloud Shell toolbar.
  2. In Cloud Shell Editor, click Terminal > New Terminal (or press CTRL+~) to open the integrated terminal pane.

Set your environment variables

  • Run the following commands in the Cloud Shell integrated terminal to set your environment variables:
gcloud config set project {{{project_0.project_id}}} export NODE_NO_WARNINGS=1 export GOOGLE_CLOUD_LOCATION=global

Antigravity CLI configuration options

The Antigravity CLI's behavior is controlled by configuration files and environment variables. There are two key files:

  • .antigravity/settings.json: This file controls the configuration of the CLI including how to connect to external tools.

  • AGENTS.md (or GEMINI.md): This file provides natural language guidelines and context to the model. The CLI reads this file to understand your project's coding standards and conventions.

Antigravity CLI configuration via settings.json

When you use Cloud Shell to run Antigravity CLI, 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.

In Cloud Shell, this file is located in the following directory:

~/.antigravity/settings.json.

Antigravity CLI configuration via AGENTS.md (or GEMINI.md)

While you can configure some of Antigravity CLI's behavior through the settings.json file located in the ~/.gemini/ directory, another file you can use to configure Antigravity CLI's behavior is AGENTS.md (or GEMINI.md).

The AGENTS.md (or GEMINI.md) file is the context file (defaulting to AGENTS.md (or GEMINI.md) but configurable via the contextFileName property in settings.json file) that is crucial for configuring the instructional context (also referred to as "memory") provided to the Gemini model.

This file allows you to give project-specific instructions, coding style guides, or any relevant background information to the AI, making its responses more tailored and accurate to your needs.

The AGENTS.md (or GEMINI.md) file is in Markdown format.

What does a AGENTS.md (or GEMINI.md) file contain? Here is the content from an example produced based on the official Antigravity CLI documentation.

Sample AGENTS.md (or GEMINI.md) file:

# Project: My Awesome TypeScript Library ## General Instructions: - When generating new TypeScript code, please follow the existing coding style. - Ensure all new functions and classes have JSDoc comments. - Prefer functional programming paradigms where appropriate. - All code should be compatible with TypeScript 5.0 and Node.js 20+. ## Coding Style: - Use 2 spaces for indentation. - Interface names should be prefixed with `I` (e.g., `IUserService`). - Private class members should be prefixed with an underscore (`_`). - Always use strict equality (`===` and `!==`). ## Specific Component: `src/api/client.ts` - This file handles all outbound API requests. - When adding new API call functions, ensure they include robust error handling and logging. - Use the existing `fetchWithRetry` utility for all GET requests. ## Regarding Dependencies: - Avoid introducing new external dependencies unless absolutely necessary. - If a new dependency is required, please state the reason.

You may notice that the sample AGENTS.md (or GEMINI.md) file provides some general instructions plus specific instructions for coding style, dependency management and more. In a similar manner, you could write your own guidelines based on your programming language, framework, coding style, and other project-specific preferences.

The AGENTS.md (or GEMINI.md) file is the key to making Antigravity CLI follow your preferences. For more information, you can refer to the Practical Antigravity CLI series, which dives deeper into how you can auto-generate such a file for your project, customize the System Prompt, and more.

Set up the project-specific configuration

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. In the Cloud Shell Editor integrated terminal, run the following commands to create the antigravity-projects folder, and navigate to it:
mkdir -p ~/antigravity-projects ~/.gemini ~/.antigravity cd ~/antigravity-projects

In Cloud Shell, Antigravity CLI is pre-installed.

Task 2. Interact with Antigravity CLI

In this task, you interact with Antigravity CLI.

  1. In the Cloud Shell Editor integrated terminal, ensure you are in the antigravity-projects directory (cd ~/antigravity-projects), then run the following command to launch Antigravity CLI:
agy
  1. To sign in, select the Use a Google Cloud project option.

  2. Open the authorization URL in a new tab in your browser. Sign in with the lab credentials, click Copy to Clipboard to copy the authorization code, then paste it into the terminal prompt and press ENTER.

  3. Enter Google Cloud Project ID and press ENTER.

  4. Set Google Cloud Location to global.

  5. 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: Before you begin, verify that the Antigravity CLI is running under your Antigravity Business account. The banner should display something similar to: student-xx-xxxxxxxxxxxx@qwiklabs.net (Antigravity Business). If Antigravity Business is not shown in the startup banner, exit the CLI and relaunch Antigravity.
  1. 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 expected response is as follows.

Output:

╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ ✓ GoogleSearch Searching the web for: "famous quote on Artificial Intelligence" │ │ │ │ Search results for "famous quote on Artificial Intelligence" returned. │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ✦ "The development of full artificial intelligence could spell the end of the human race." - Stephen Hawking.

You may notice that your query resulted in a GoogleSearch tool (a built-in tool in Antigravity CLI) that gets invoked. You learn more about built-in tools later in this lab.

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}}}-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

A quick way to understand Antigravity CLI and the various commands that it supports is to type /help (forward slash) to receive a variety of commands and keyboard shortcuts as follows:

Sample output:

Commands: /help Show available slash commands and shortcuts /mcp List active Model Context Protocol (MCP) servers and tools /model Select or switch Gemini model tier /quit Exit the Antigravity CLI session

The /help command is one example of a so-called slash command. To learn more about these built-in Antigravity CLI commands, refer to the Slash Commands (/) documentation.

Task 3. Explore Antigravity CLI built-in tools

Antigravity CLI equips the underlying model with native capabilities to interact with your local environment, retrieve external information, and perform file and system actions. These built-in tools (such as GoogleSearch, ReadFile, WriteFile, and Shell) allow the agent to assist with software development, web research, and project maintenance.

Can Antigravity CLI simply call these tools whenever it wants? The answer is no. By default, the model requests explicit permission before performing sensitive operations — such as writing files to disk, modifying system state, or executing shell commands.

Can Antigravity CLI simply call these tools, when it wants to? The simple answer is no. By default, the model always asks for permission when it comes to sensitive operations that might involve writing to the local system, reading from an external system, going to the external network, and so on.

While there is a --yolomode available when you start the CLI (not typically recommended), you may find that Antigravity CLI prompts you for permission to run the tool that it has chosen. You can refuse permission, let it run once, or give it blanket permission to always run. You are and should be in full control of things.

Prompt the CLI to use a built-in tool

In this section, you give Antigravity CLI a prompt to make Gemini choose and execute one of its built-in tools for you to gain a better understanding of how it all works.

Say 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 Note: Whenever Antigravity CLI prompts for permission to execute a tool or action, press ENTER to select Yes, allow once (or Yes, allow always) to allow the operation to proceed.

The model first invokes the GoogleSearch tool to search the web for solar eclipse dates. Once retrieved, it invokes the WriteFile tool to save the results. Because writing to the filesystem is a sensitive operation, Antigravity CLI prompts you for confirmation.

  1. Press ENTER to select Yes, allow creation.

This writes the retrieved information to eclipse-dates.txt.

Expected output:

✦ I have saved the dates of the next total solar eclipse in eclipse-dates.txt.

To check if a file is written or not, you can use the @file to ask it to read the content. As you type @, it displays a list of files in the current folder, including the file it has just created.

Note: You can try other models by using the /model command in the Antigravity CLI.

While Gemini is running, you can verify the model that's running at the bottom right of the Antigravity CLI terminal as in the following screenshot:

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. This is useful if you use Antigravity CLI in an automated fashion as part of a script or any other automation process.

  1. Quit the session (press CTRL+D or CTRL+C twice, or issue the /quit prompt).

  2. In Cloud Shell integrated terminal, run the following command with the -p parameter:

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

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

Verify your progress

  1. In the Cloud Shell integrated terminal, run the following commands to save the non-interactive output to summary_task2.md and upload it to the grading bucket:
agy -p "What is the gcloud command to deploy to Cloud Run?" > summary_task2.md gcloud storage cp summary_task2.md gs://{{{project_0.project_id}}}-grading/
  1. Once uploaded, click Check my progress below to verify the objective.
Use Gemini non-interactive mode

Task 4. Use Antigravity CLI in shell mode

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

  1. Restart Antigravity CLI with the following command:
agy
  1. Press ! in the prompt box. This toggles to shell mode.

When in shell mode, you see the ! at the start of the prompt as shown in the following:

The prompt prefix changes to ! > to indicate that terminal shell mode is active.

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.

  1. Give the following prompt to Antigravity CLI:
cat eclipse-dates.txt

Example output:

Total solar eclipse dates saved in eclipse-dates.txt.
  1. Press ! again or press the ESC key to exit shell mode.

  2. Exit the agy session by typing /quit and then press ENTER.

Task 5. Configure an MCP server

An MCP server is an application that exposes tools and resources to the Antigravity CLI through MCP, allowing it to interact with external systems and data sources. MCP servers act as a bridge between the Gemini model and your local environment or other services like APIs.

An MCP server enables the Antigravity CLI to discover and execute tools thereby extending Antigravity CLI's capabilities to perform actions beyond its built-in features, such as interacting with databases, APIs, custom scripts, or specialized workflows.

Antigravity CLI supports configuring MCP servers for discovering and using custom tools.

  1. If you've launched Antigravity CLI, you can check the MCP servers configured via the /mcp command as follows:

Executing /mcp inside Antigravity CLI lists all connected MCP servers and their available tools.

If you don't have any MCP servers configured, it launches Antigravity CLI's MCP server documentation.

You can configure MCP servers at the global level in the ~/.antigravity/settings.json file or in your project's root directory.

If you have Antigravity CLI running, you can quit the session by pressing CTRL+D or CTRL+C twice.

  1. From the Cloud Shell terminal, click Open Editor on the toolbar to launch the Cloud Shell Editor.
  2. Because the .gemini subdirectory is hidden by default, select View > Toggle hidden files to show hidden files and directories.
  3. In the Cloud Shell Editor, browse to and open the .antigravity/settings.json file within your project-specific folder, antigravity-projects.

Within the ~/.antigravity/settings.json file, you need to configure the mcpServers configuration block. It takes the following syntax:

"mcpServers": { "server_name_1": {}, "server_name_2": {}, "server_name_n": {} }

You configure this file to support an MCP server in the next task.

Each server configuration supports the following properties, as per the Reference documentation:

Required (one of the following)

  • command (string): Path to the executable for Stdio transport
  • url (string): SSE endpoint URL (e.g., "http://localhost:8080/sse")
  • httpUrl (string): HTTP streaming endpoint URL

Optional

  • args (string[]): Command-line arguments for Stdio transport
  • headers (object): Custom HTTP headers when using url or httpUrl
  • env (object): Environment variables for the server process. Values can reference environment variables using $$VAR_NAME or $${VAR_NAME} syntax
  • cwd (string): Working directory for Stdio transport
  • timeout (number): Request timeout in milliseconds (default: 600,000ms = 10 minutes)
  • trust (boolean): When true, bypasses all tool call confirmations for this server (default: false)
  • includeTools (string[]): List of tool names to include from this MCP server. When specified, only the tools listed here will be available from this server (whitelist behavior). If not specified, all tools from the server are enabled by default.
  • excludeTools (string[]): List of tool names to exclude from this MCP server. Tools listed here will not be available to the model, even if they are exposed by the server. Note: excludeTools takes precedence over includeTools - if a tool is in both lists, it will be excluded.
Note: Before you proceed, know that you should always exercise caution when connecting to or integrating with third-party MCP servers. To protect your information and system integrity, it is advised that you only integrate with MCP servers from trusted and thoroughly vetted sources.

Set up a local Git MCP server

The official Model Context Protocol (MCP) Git server (git-mcp-server) allows Antigravity CLI to read, inspect, and perform Git version control operations directly on local repositories.

In this section, you set up a local Git repository and configure the Git MCP server in Antigravity CLI's configuration file.

  1. In your Cloud Shell Editor integrated terminal, run the following commands to create and initialize a sample Git repository:
mkdir -p ~/event-talks-app cd ~/event-talks-app git init git config user.name "Student" git config user.email "student@qwiklabs.net" echo "# Event Talks App" > README.md git add README.md git commit -m "Initial commit"
  1. Run the following commands in your terminal to create mcp_config.json with the git MCP server configuration:
mkdir -p ~/.antigravity ~/.gemini cat <<'EOF' > ~/.antigravity/settings.json { "mcpServers": { "git": { "command": "npx", "args": [ "-y", "git-mcp-server", "/home/student/event-talks-app" ], "trust": true } } } EOF cp ~/.antigravity/settings.json ~/.gemini/settings.json
  1. Run the following command to start Antigravity CLI:
agy

If prompted, Do you trust the contents of this project?, Press ENTER to select Yes, I trust this folder.

  1. To verify that the Git MCP server is loaded and its tools are active, issue the /mcp command:
/mcp

The /mcp command output displays the active git MCP server along with available tools such as git_status, git_log, git_add, and git_commit.

✓ git Tools: init, clone, status, add, commit, +16 more

Press ESC to exit the mcp mode.

Note: Whenever Antigravity CLI prompts for permission to execute a tool or action, press ENTER to select Yes, allow once (or Yes, allow always) to allow the operation to proceed.
  1. Prompt Antigravity CLI to inspect the repository status:
Check the git status of the repository at /home/student/event-talks-app using the git MCP server tools.

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 status of the Git repository at /home/student/event-talks-app inspected via the Git MCP server - The branch name and tracked files in the repository Once written, upload this file to the grading storage bucket by running: gcloud storage cp summary_task3.md gs://{{{project_0.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.
Verify local repository using Git MCP tools
  1. Now prompt Antigravity CLI to add a new file and commit the changes to Git:
Create a new file named talks.json in /home/student/event-talks-app with sample event schedule data, add it to git, and commit the changes with the message "Add talks schedule".

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 new file created (talks.json) and its location (/home/student/event-talks-app) - The commit message used ("Add talks schedule") - The latest git commit details confirmed via the Git MCP server Once written, upload this file to the grading storage bucket by running: gcloud storage cp summary_task4.md gs://{{{project_0.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.
Commit project changes using Git MCP server

Task 6. Perform vibe coding with Antigravity CLI

In this task, you use Antigravity CLI to vibe code a website. You ask Antigravity CLI to generate the structure of the website and set it up.

Note: Even when you are being precise in your instructions, when vibe coding the model can sometimes deviate from what you told it to do, hallucinate, or get stuck in a loop. If the model gets stuck, press ESC and prompt it with updated instructions or repeat your previous instructions, as needed. Note: If you encounter quota or capacity issues, use the /model command to select a different model (such as a Flash model).
  1. In the Antigravity CLI, issue the following prompt:
Generate a website for a 1-day event filled with technical talks. There are going to be 6 talks in a single track of 1 hour each. Each talk has the following information: title, 1 or maximum of 2 speakers, category (1 or maximum of 3 keywords), duration and a description. The website has a single page where users can see the schedule for the entire day with the timings. There will be one lunch break of an hour and the event starts at 10:00 AM. Keep a 10 minute transition between talks. I would like to use Node.js on the server side and standard HTML, JavaScript, and CSS on the front-end. The users should be able to search the talks based on category. I would like you to proceed in the following way: 1. Plan out how you would design and code this application. 2. Ask me for any clarifications along the way. 3. Once I am fine with it, do generate the code, and compile the website into a single, serverless HTML file. 4. Provide me with instructions to run and test the website on port 8080 (serve the index.html file to me using a simple Python server on port 8080 so I can preview it locally via Cloud Shell Web Preview). Note: Whenever Antigravity CLI prompts for permission to execute a tool or action, press ENTER to select Yes, allow once (or Yes, allow always) to allow the operation to proceed.

Antigravity CLI proceeds to go through a series of actions at this point.

  1. If the model wants you to confirm what actions it should take next, or asks how to proceed, prompt it as follows:
Create the website using placeholder data and proceed as per your plan suggestions. Note: It may happen that the Antigravity CLI experiences a timeout or uses an incorrect username, etc. Do interact with it and suggest the fixes, as needed.

The next few prompts and responses are a sample flow that was observed. You might get a completely different response.

You need to interact back-and-forth with Antigravity CLI, as needed.


At times, Antigravity CLI may suggest a command that it would like to execute. For the purposes of this lab, you should exert control over the task.

If the model offers to run a command, you can simply press ESC to escape out and redirect its approach with a message such as the following:

On following the instructions to start the server and navigate to the home page, you get a sample site as shown (you should see a variant of a similar site if you used the same prompt):

Feel free to make more changes with the help of Antigravity CLI.

  1. Once the server is running on port 8080, click Web Preview (top-right icon on the Cloud Shell toolbar) and select Preview on port 8080 to open and test your website.

Congratulations!

Congratulations, you've successfully explored Antigravity CLI, its capabilities, and applied it to a use case.

Next steps / Learn more

Manual Last Updated August 07, 2026

Lab Last Tested August 07, 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.