Building Module 6 · CLI Tools Setup

Gemini CLI → Antigravity CLI

Last reviewed · content updated

What you'll learn

~15 min
  • Understand the Gemini CLI → Antigravity CLI transition and the 2026-06-18 consumer cutover
  • Install Antigravity CLI (`agy`) as a consumer, or Gemini CLI under an enterprise license
  • Authenticate with a Google account
  • Run your first task and view the output
  • Know when to reach for a Google CLI vs Claude Code
Important: Gemini CLI is moving to Antigravity CLI

Google is retiring the consumer Gemini CLI. On June 18, 2026, Gemini CLI and the Gemini Code Assist IDE extension stop serving requests for Free, Google AI Pro, and Ultra accounts. Google’s replacement is Antigravity CLI — the agy command.

  • Individual / consumer users: switch to Antigravity CLI (covered below).
  • Enterprise users: if your organization has a Gemini Code Assist Standard or Enterprise license (or Gemini Code Assist for GitHub via Google Cloud), Gemini CLI keeps working — see the enterprise section near the end.

This lesson teaches Antigravity CLI as the primary path and keeps Gemini CLI as the enterprise option.

Cloud Equivalent

Gemini Web at gemini.google.com is a free, browser-based way to use Google’s models for conversational tasks with no install. For a full browser terminal where you can install a CLI, see the Cloud Sandbox Cheat Sheet or set up your sandbox.

By the end of this lesson, you’ll have a Google AI CLI running — Antigravity CLI if you’re an individual, Gemini CLI if you’re on an enterprise license — and understand when to reach for it.

What changed — and why

Gemini CLI was Google’s popular open-source command-line agent (tens of thousands of GitHub stars). In May 2026, Google announced it is consolidating its terminal agent into Antigravity CLI, a new Go-based agent that runs asynchronous multi-agent workflows in the background. Consumer Gemini CLI access ends 2026-06-18; enterprise licenses keep Gemini CLI running.

Antigravity carries over the same ideas you’d learn in any modern CLI agent — Agent Skills, Hooks, Subagents, and Extensions (now called “Antigravity plugins”) — though not at full 1:1 parity yet. Unlike Gemini CLI, Antigravity CLI is not open source.

The good news: the skills transfer directly. Whichever Google CLI you run, you’re still directing a Gemini-model agent from your terminal — and everything you learn here applies to Claude Code and Codex CLI too.

What you get

Both Antigravity CLI and (enterprise) Gemini CLI drive Google’s Gemini models from the terminal:

  • Massive context: ~1 million tokens — read enormous codebases in one pass
  • Gemini 3 family models (3 Pro, 3.5 Flash) with Auto routing — simple prompts go to Flash, complex ones to Pro
  • Plan-first workflows: review and approve a strategy before the agent executes
  • Project context files that give the model persistent instructions (like Claude Code’s CLAUDE.md)
  • MCP-extensible: connect external tools and services
  • Async multi-agent workflows (Antigravity): kick off background work and check results later

Install Antigravity CLI (individuals)

This tool is new — verify the install command

Antigravity CLI launched in May 2026 and is evolving quickly. The commands below were current at this lesson’s last review, but always confirm against the official site, antigravity.google, before installing.

Step 1: Install

Terminal window
curl -fsSL https://antigravity.google/cli/install.sh | bash
Terminal window
curl -fsSL https://antigravity.google/cli/install.sh | bash

PowerShell:

Terminal window
irm https://antigravity.google/cli/install.ps1 | iex

Antigravity CLI runs on Windows native — it does not require WSL.

The installer adds the agy command (it lands in ~/.local/bin on macOS/Linux). Verify:

Terminal window
agy --version

Step 2: Authenticate

Start Antigravity CLI:

Terminal window
agy

It opens your browser to sign in with your Google account. Sign in, and you’re done.

💡Authenticating over SSH or on a remote server

If you’re on a remote server without a browser, use device-flow authentication — the tool shows a URL and a code; open the URL on your local machine, enter the code, and the remote tool authenticates. Alternatively, set a Gemini API key as an environment variable: export GEMINI_API_KEY="your-key" (get one from aistudio.google.com). Because Antigravity CLI is new, run agy --help to confirm the exact auth flags for your version.

Your first interaction

Step 1: Create a project folder

Terminal window
mkdir hello-agy && cd hello-agy

Step 2: Start the CLI

Terminal window
agy

Run agy --help first if you want to see the available subcommands — the tool is new and its surface is still settling.

Step 3: Give it a task

Create a simple HTML page with a counter. It should have a dark
background, a large number in the center, and + / - buttons to
increment and decrement. Use vanilla JavaScript — no frameworks.

Watch as the agent:

  1. Plans the approach
  2. Creates the file(s)
  3. Writes the HTML, CSS, and JavaScript
  4. Reports what it did

Step 4: Check the result

Terminal window
ls
cat index.html
Terminal window
open index.html

From WSL:

Terminal window
explorer.exe index.html

Or right-click the file in VS Code’s Explorer panel.

Terminal window
xdg-open index.html

On a remote server, use VS Code’s file explorer or download the file.

A Google CLI vs Claude Code

Both are excellent. Here’s how they compare:

AspectAntigravity / Gemini CLIClaude Code
AccessGoogle account (Antigravity), or enterprise license (Gemini CLI)API key or subscription
Context window~1M tokensLarge (varies by model)
Open sourceGemini CLI yes; Antigravity noNo
Project contextGEMINI.md (Gemini CLI)CLAUDE.md
Best forLarge codebases, async multi-agent runsComplex reasoning, nuanced instructions
SetupGoogle account or enterprise licenseAPI key or subscription

Context windows and model capabilities change frequently — check each tool’s official docs for current limits. Many people use both: a Google CLI for broad exploration over big codebases, and Claude Code for complex, multi-step work where reasoning quality matters most.

Enterprise: keeping Gemini CLI

If your organization has a Gemini Code Assist Standard or Enterprise license (or Gemini Code Assist for GitHub via Google Cloud), Gemini CLI keeps serving requests past the June 18 cutover with continued model access and updates. Install it the usual way:

Terminal window
npm install -g @google/gemini-cli
gemini --version

Authenticate with your licensed Google Workspace account. Gemini CLI’s in-session commands — /help, /plan (Plan Mode), /model, /memory show, /memory reload, /clear — and GEMINI.md project-context files work as before.

🧬In Your Field: Biotechclick to expand

The ~1M-token context window is especially useful for bioinformatics. You can feed a Google CLI an entire sequencing pipeline — dozens of scripts, config files, and documentation — and ask “Trace the data flow from raw FASTQ files to the final variant call set” or “Which steps could be parallelized?” It’s among the largest context windows in popular CLI tools, ideal for understanding large, inherited analysis codebases. Use Antigravity CLI individually, or Gemini CLI if your lab has an enterprise Gemini Code Assist license.

🏛️In Your Field: Government / State Devclick to expand

For government work, the right path is an enterprise Gemini Code Assist license — not a personal free tier. Enterprise licensing keeps Gemini CLI serving past the June 18 consumer cutover and, more importantly, comes with the data-handling, retention, and access-control terms a compliance review requires. Treat a personal free tier as off-limits for anything touching agency data, and route tool access through your security office. The draw is still the million-token context window: it can hold hundreds of pages of regulations or legislative text at once.

Tips

  1. Take advantage of the large context. A 1M-token window can hold very large codebases — don’t hesitate to point it at big projects.

  2. Use plan-first workflows for anything non-trivial. Review the strategy before letting the agent execute.

  3. Set up project context early. Even a few lines (“This is a Python Flask app, we use pytest, follow PEP 8”) makes every response better. Gemini CLI uses GEMINI.md; check agy --help for Antigravity’s project-context file.

  4. Lean on async multi-agent runs (Antigravity). Kick off longer background work and check the results when it’s done, rather than babysitting the terminal.

  5. Run --help when a command isn’t what you expect. Antigravity CLI is new and its commands are still settling — the tool is the source of truth, not your memory.

Verify it works

Terminal window
agy --version

You should see a version number. If you get “command not found,” revisit the installation step (and confirm ~/.local/bin is on your PATH).

🔧

When Things Go Wrong

Use the Symptom → Evidence → Request pattern: describe what you see, paste the error, then ask for a fix.

Symptom
Google account authentication fails or browser doesn't open
Evidence
Error: Could not open browser for authentication or 'Authentication failed'
What to ask the AI
"Antigravity CLI (agy) tried to open my browser for Google sign-in but it failed. I'm on a remote server via SSH. How do I authenticate without a browser using device flow or a Gemini API key environment variable?"
Symptom
'agy: command not found' after the install script runs
Evidence
bash: agy: command not found
What to ask the AI
"The Antigravity CLI install script finished but my terminal can't find the 'agy' command. It installs to ~/.local/bin — how do I check whether that directory is on my PATH and add it if not?"
Symptom
Gemini CLI says 'quota exceeded' or stops serving requests
Evidence
Error: 429 Resource has been exhausted, or requests fail after 2026-06-18
What to ask the AI
"My Gemini CLI requests are failing. I'm on a free/Pro/Ultra Google account. Is this the June 18 2026 consumer cutover, and should I move to Antigravity CLI or get an enterprise Gemini Code Assist license?"
💬Another tool in your arsenal

Tools come and go — Gemini CLI is becoming Antigravity CLI even as you read this. That’s exactly why the skill matters more than the command. You’re not just learning one CLI; you’re learning to direct an AI agent from the terminal. The specific commands will keep changing. The ability to point an agent at a problem and get real work back will not.


Key Takeaways

  • Consumer Gemini CLI ends 2026-06-18 — individuals move to Antigravity CLI (agy); enterprise Gemini Code Assist licenses keep Gemini CLI
  • Install Antigravity CLI from antigravity.google — it’s new and evolving, so verify commands against the official docs
  • ~1M-token context lets a Google CLI read more of your project than most other tools
  • Plan-first, then execute — review the strategy before the agent runs
  • For government/regulated work, use an enterprise license, not a personal free tier — route tool access through your security office
  • Pair it with Claude Code — a Google CLI for broad exploration, Claude for precision reasoning