How to Use Google's Antigravity CLI for AI Code Assistance – Real Python
How to Use Google's Antigravity CLI for AI Code Assistance by Bartosz Zaczyński Updated Jul 27, 2026 Reading time estimate 38m intermediate ai tools Table of Contents Remove ads Antigravity CLI is a terminal-based AI coding tool that brings Google’s agent assistance into your workflow. After installing it and signing in with your Google account, you can ask questions about your code, add new features, track down bugs, and even dispatch multiple subagents to work on separate tasks in parallel, all without leaving your shell: Antigravity CLI Antigravity CLI replaced Gemini CLI , which Google retired in June 2026.
If you’ve used Gemini CLI, then a lot of this will feel familiar. Your skills, hooks, subagents, and plugins carry over, and the tool still reads its configuration from ~/.gemini/ . You don’t need any of that history to follow along, though. This is a hands-on guide to using Antigravity CLI, not a migration manual. But if you’re switching, then the Coming From Gemini CLI? section rounds up what changed and what to watch out for.
You’re about to install Antigravity CLI, sign in with your Google account, and put it to work on a Python project. It’ll read an unfamiliar module , review it against your conventions, and refactor the code while the agent verifies its own work. Take the Quiz: Test your knowledge with our interactive “How to Use Google's Antigravity CLI for AI Code Assistance” quiz. You’ll receive a score upon completion to help you track your learning progress: Interactive Quiz How to Use Google's Antigravity CLI for AI Code Assistance Test your knowledge of Google's Antigravity CLI, a terminal-based AI coding agent, and how to use it to read, review, and refactor Python code.
Prerequisites To follow along with this tutorial, you’ll need the following: Google Account: A Google account lets you sign in to Antigravity CLI. A free account is enough to finish this tutorial, although the free tier’s usage limits are tight and have shifted since launch, so expect to bump into them on longer sessions. Python 3.12 or higher: You’ll work with a small Python command-line application . If you haven’t already, install Python , making sure the minimum version is Python 3.12 .
Because Antigravity CLI is a command-line tool, you should feel comfortable navigating your terminal and running basic shell commands. The tool ships as a single binary for macOS, Linux, and Windows, so any of these platforms will work. Unlike Gemini CLI, it doesn’t depend on Node.js , which means there’s no separate runtime to install first. Go ahead and download the supporting materials for the Python project you’ll work with throughout this tutorial: Get Your Code: Click here to download the expense-report command-line tool that you’ll have Antigravity CLI read, review, and refactor.
Once you’ve extracted the files, you’ll find an expense-report/ directory with a tiny command-line tool that reads a CSV of transactions and prints a per-category spending summary. To get the most out of this tutorial, initialize a new Git repository in that directory and make an initial commit so you have a clean baseline to diff against later: Language: Shell $ cd expense-report/ $ git init $ git add . $ git commit -m "Initial commit" This project is the kind of small, undocumented script you might inherit from a teammate, which makes it a good testing ground for Antigravity CLI’s code-reading and refactoring features.
Remove ads Step 1: Install and Set Up Antigravity CLI Before you can use Antigravity CLI , you need to install it and sign in with your Google account. In this step, you’ll run the official installer, verify the freshly installed agy command, authenticate, and pick a capable model. Install the Binary Antigravity CLI is distributed as a self-contained binary file that ships with the entire Go runtime, so you can download and install it using a single command.
Here’s how you can run the official installer script for your platform: Windows Linux + macOS Language: Windows PowerShell PS> irm https :// antigravity . google / cli / install . ps1 | iex Language: Shell $ curl -fsSL https://antigravity.google/cli/install.sh | bash The installer places the agy executable in a local bin/ directory, which is ~/.local/bin/ on macOS and Linux. As part of the same run, the installer’s setup step also tries to wire up your PATH and shell profile for you.
Open a new terminal session, or reload your shell profile, and then confirm that the installation worked by checking the version: Language: Shell $ agy --version 1.0.12 If you see a version number, then you’re ready to authenticate. Because it’s a single Go binary, Antigravity CLI updates itself in place whenever a newer release is available. But you can trigger that manually at any time with agy update . Authenticate With Google The first time you launch Antigravity CLI, it walks you through a one-time sign-in and setup process.
Navigate to the sample project and start a session by running agy on its own: Language: Shell $ cd expense-report/ $ agy Because Antigravity CLI can read, write, and run code on your behalf, only launch it from inside a specific project directory. This keeps the agent focused on the files that matter and avoids accidental changes elsewhere. Working under version control like Git also lets you review and undo any edits.
When you run agy for the first time, you’ll be presented with two authentication methods: Google OAuth Google Cloud Project Select Google OAuth as the login method. This will automatically open your default web browser, letting you choose one of your Google accounts to sign in with and authorize the tool: Sign in with Google Next, copy your unique authorization code and paste it back into Antigravity CLI. After you confirm, Antigravity CLI securely stores the resulting access token in your operating system’s native keyring, reusing it for future sessions.
Note that if you’re working over SSH on a remote machine, then Antigravity CLI detects the headless session and prints an authorization URL for you to open in a local browser. Remove ads Choose Your Color Scheme During the first launch, after successfully authenticating with your Google account, you’ll be able to select your preferred color scheme for Antigravity CLI: Color Scheme Setup You can pick from a few options, ranging from your terminal emulator’s built-in color palette to the popular Solarized light and dark themes.
This choice, along with many other options, gets stored in a settings file, which you can edit manually if you later change your mind: Language: JSON Filename: ~/.gemini/antigravity-cli/settings.json { "colorScheme" : "solarized dark" , "enableTelemetry" : false } For a full list of the available configuration options, use the /config slash command or its /settings alias in Antigravity CLI itself. Accept the Terms of Service Before you can start using Antigravity CLI, you’ll need to accept the Terms of Service and Privacy Policy on the first run.
Additionally, you may opt out of letting Google collect your data to improve its services: Terms of Service, Privacy Policy, and Data Use Keep in mind that when you use Antigravity CLI, your prompts and code are sent to Google’s models for processing. While this enables the tool’s features, be mindful of sensitive data or proprietary code, and review Google’s terms to understand how your data is handled. Pick a Supported Model Antigravity CLI uses a lightweight model by default to keep the interactions snappy.
For real work, choose something stronger. From inside a session, the /model slash command lets you browse and switch models. You can also list what your account can reach from your terminal with the agy models subcommand: Language: Shell $ agy models Gemini 3.5 Flash (Medium) Gemini 3.5 Flash (High) Gemini 3.5 Flash (Low) Gemini 3.1 Pro (Low) Gemini 3.1 Pro (High) Claude Sonnet 4.6 (Thinking) Claude Opus 4.6 (Thi
The rest of this page is on the live site.