Migrating from Gemini CLI to Antigravity CLI: A Guide
MarkdownInstalling agy, migrating configuration, plugins, and environment variables; checks, common errors, and regional restrictions.
Read full article
On May 19, 2026, Google announced that it would shut down the old Gemini CLI for all Free, Pro, and Ultra plans on June 18. Two weeks after this guide is published, the gemini command will stop processing requests. Migrating from Gemini CLI to Antigravity CLI with the agy command is the only way to stay with Google tools. agy is built in Go and starts tens of times faster.
If you have anything running on Gemini CLI—CI scripts, nightly cron jobs, the Gemini Code Assist IDE extension—this guide explains how to migrate in one evening without breaking anything.
Connecting models and working with the API are covered in the Ailoot documentation.
Which Gemini CLI users are affected by the June 18, 2026 change?
Key takeaway
On June 18, 2026, Gemini CLI and the Gemini Code Assist extension for VS Code will stop processing requests for three categories of users: the Free plan, Google AI Pro, and Google AI Ultra. New Gemini Code Assist installations on GitHub will no longer be available; existing ones will be disabled “in the following weeks.” Paid API access through Gemini Enterprise Agent Platform and Code Assist Standard/Enterprise licenses will continue to work unchanged.
This is not a “complete shutdown of the project,” but a cutoff for the three most popular plans. Who is affected:
| Plan | What it offered | What will happen on June 18, 2026 |
|---|---|---|
| Free tier | Access to Gemini Code Assist + CLI with limits | Fully disabled |
| Google AI Pro (about $19.99/month) | Higher CLI and Code Assist limits | Fully disabled |
| Google AI Ultra (from $100/month after I/O 2026) | The highest limits | Fully disabled |
| Gemini Code Assist for GitHub | Google's automatic PR reviews in your repository | No new installations; existing ones will be disabled in the following weeks |
| Gemini Code Assist Standard / Enterprise (corporate licenses) | Through a corporate Google Workspace account | Continues unchanged |
| Paid API through Google Cloud (paid Gemini API key) | Requests billed to the project | Continues unchanged |
From the official Google Developers Blog:
On June 18, 2026, Gemini CLI and Gemini Code Assist IDE extensions will stop processing requests for Google AI Pro, Ultra, and Free tier users.
If you used the Free plan, like most individual developers, and are thinking “but I have a paid account”—check exactly how your API key is billed. AI Pro is not Cloud billing; it is a personal Google AI subscription, and it will be disabled. Cloud billing with a paid project will not be disabled.
Why is Google shutting down Gemini CLI at all?
Key takeaway
Gemini CLI was a separate TypeScript/Node.js experiment in Google's GitHub repository. Google decided to unify all its agent tools under a single platform—Google Antigravity—with four interfaces: Antigravity 2.0 (desktop application), Antigravity CLI (terminal), Antigravity SDK (Python wrapper), and Antigravity IDE (VS Code fork). Antigravity CLI has been rewritten from Node.js to Go: it starts in milliseconds instead of hundreds of milliseconds and uses tens of megabytes of memory instead of hundreds.
The old gemini started in “hundreds of milliseconds” because Node.js needed to warm up. The new agy is built as a single static Go binary and starts in “milliseconds.” For CI and scripts that call the CLI hundreds of times per run, the difference is significant.
What Google says about the speed and the reason:
Antigravity CLI is built in Go, runs faster, and supports asynchronous background workflows.
All the key Gemini CLI features have moved over:
- Agent Skills — the
.gemini/skills/folder now lives in.agents/skills/. - Hooks — the same events (
PreToolUse,PostToolUse, etc.); the syntax has barely changed. - Subagents — work as before, and their configuration is migrated automatically.
- Extensions — renamed Antigravity plugins and imported with one command.
What did NOT migrate seamlessly: MCP servers and old scripts that directly access .gemini/config.json. MCP configurations may break and need to be rewritten manually. There is a separate section on this below.
Google is not closing the Gemini CLI open-source project:
The repository will remain available on GitHub under the Apache 2.0 license, and we will continue working on the project as open source.
That means you can fork it and continue using it with your own Gemini API key. But this is now a paid setup through Cloud billing; the free Code Assist arrangement is over.
How to install Antigravity CLI: commands for macOS, Linux, and Windows
Key takeaway
The Google installer automatically detects the OS and architecture, downloads the binary, and puts it in ~/.local/bin (Linux/macOS) or C:\Users\[your_name]\AppData\Local\agy\bin (Windows). Commands differ across the three OSes: on macOS and Linux, a one-liner using curl; on Windows, either PowerShell irm or the CMD option. After installation, add the path to PATH if the installer did not do this, open a new terminal, and run agy doctor—it checks that the binary was found and can reach Google.
Before you start, do a quick self-check: which plan are you on? If you have a paid Cloud project with no June 18 deadline, migration is useful but not urgent. If you are on Free/Pro/Ultra and have something running on the CLI, switch now, while the plans are still active, so you can compare behavior on the same task.
macOS and Linux
One-liner using curl:
curl -fsSL https://antigravity.google/cli/install.sh | bash
The script detects the platform, downloads the agy binary, checks its checksum, and puts it in ~/.local/bin. If this folder is not in PATH, add it:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
Check that the binary is visible:
which agy
agy --version
Windows (PowerShell)
irm https://antigravity.google/cli/install.ps1 | iex
The binary will be installed in C:\Users\[your_name]\AppData\Local\agy\bin. The installer will update PATH automatically, but open a new PowerShell window to reload the variables.
Windows (CMD)
If PowerShell is blocked by your corporate policy:
curl -fsSL https://antigravity.google/cli/install.cmd -o install.cmd && install.cmd && del install.cmd
Verify the installation
After installation on any OS, run:
agy doctor
The command checks the binary version, whether a config exists, authentication, and network access to antigravity.google. If it cannot reach Google, the issue is with your region or proxy.
Authentication
The first time you run agy without arguments, it launches a setup wizard:
- Choose an interface theme.
- Choose an authentication method: Google OAuth (for personal accounts) or an API key.
- Optionally, import the config from
.gemini/right away.
If you choose OAuth, a browser will open and redirect you to accounts.google.com; you need to consent to data sharing. After that, the CLI works.
How to migrate config and plugins from .gemini to .agents
Key takeaway
Antigravity CLI looks for its config in .agents/ next to the project and in ~/.agents/ globally—just as Gemini CLI looked in .gemini/. Migration is done with one command, agy plugin import gemini: it goes through .gemini/extensions/, migrates them as Antigravity plugins, and updates the config format. Move the skills folder manually: mv .gemini/skills/ .agents/skills/. Afterward, agy doctor and agy inspect will show what was picked up, what was not, and where there are duplicates.
Step by step:
agy plugin import gemini
Run the command from any folder. It will migrate global plugins from
~/.gemini/to~/.agents/. For workspace plugins (next to the project), run the command inside the project folder.mv .gemini/skills/ .agents/skills/
Move skills by manually renaming the folder. The file format inside is the same; there is no need to rewrite the markdown.
agy inspect
Shows which plugins, skills, hooks, and subagents are active. Compare this with the list you had in Gemini CLI—there should be no omissions.
agy config --edit
Opens the config in the default editor (
$EDITOR). If something was not picked up automatically, edit it manually.agy doctor
Final check: binary, authentication, plugins, network. If all four are green, config migration is complete.
I would leave the old .gemini/ folder in place as a backup for a month, in case something was missed. After you have used Antigravity for a week and confirmed that everything is there, you can delete it.
If you work with AGENTS.md as a universal config for all AI tools, you do not need to touch it. Antigravity CLI reads AGENTS.md from the same folder as Claude Code or Codex.
Which environment variables need to be changed?
Key takeaway
If you have CI/CD scripts, GitHub Actions, local .env files, or dotfiles that pass through GEMINI_API_KEY or other variables, you need to rename them. The GEMINI_ prefix has become AV_ (for Antigravity). Antigravity CLI will NOT read the old variables.
Complete replacement table:
| Old variable (Gemini CLI) | New variable (Antigravity CLI) | Default value |
|---|---|---|
GEMINI_API_KEY | AV_API_KEY | - |
GEMINI_PROJECT_ID | AV_PROJECT_ID | - |
GEMINI_REGION | AV_REGION | us-central1 |
GEMINI_MODEL | AV_MODEL | gemini-3.5-flash |
GEMINI_API_BASE | AV_API_BASE | Official Google endpoint |
If you have GitHub Actions that pass through secrets, open Settings -> Secrets -> Actions and rename the keys. The values themselves stay the same (the Google API key did not change during migration).
Check all places that might contain GEMINI_:
# Find mentions throughout the project
grep -rn "GEMINI_" . --include="*.yml" --include="*.yaml" --include="*.sh" --include=".env*" 2>/dev/null
# In dotfiles
grep -nE "GEMINI_" ~/.zshrc ~/.bashrc ~/.bash_profile ~/.config/fish/config.fish 2>/dev/null
After replacing them, restart the terminal and check presence without printing the secret. Do not enable shell tracing or copy key values into logs. Presence alone does not prove authorization; inspect agy doctor separately:
if [ -n "${AV_API_KEY:-}" ]; then
printf 'AV_API_KEY is set\n'
else
printf 'AV_API_KEY is missing or empty\n'
fi
agy doctor # should show “authorized”
What most often breaks during the transition and how to fix it
Key takeaway
The most common issues are MCP servers defined in ~/.gemini/config.json, which are not picked up automatically—the config needs to be rewritten in Antigravity format. Custom hooks that use old environment variables fail silently, so tests fail without a clear error. Scripts that access .gemini/ directly (rather than through the CLI) need to be switched to .agents/. The @[file] command for loading a file into context had bugs when Antigravity CLI first launched; it has been fixed in recent builds, but if you are on an older one, update.
Checklist of initial problems:
MCP servers. If you used
mcp_serversin.gemini/config.json, they might not be picked up afteragy plugin import gemini. Check withagy inspect—there will be anmcpsection. If it is empty or has errors, rewrite it manually withagy config --edit. The format is described in the official Antigravity documentation (look for the MCP section).Custom hooks. If you had a bash script in
.gemini/hooks/that read$GEMINI_API_KEY, it will break. Find such places: bashgrep -rn "GEMINI_" .agents/hooks/ 2>/dev/nullReplace the variables.
CI/CD. In GitHub Actions or GitLab CI, change steps that use the
geminicommand toagy. The binary name in the installer may differ, so create an abstraction using the$CLI_CMDvariable.IDE Extension. The Gemini Code Assist extension for VS Code will be disabled along with the CLI. The replacement is Antigravity IDE (a separate VS Code fork) or AGENTS.md in any other AI editor.
@[file]loading. In early Antigravity CLI builds, the@src/file.tscommand for loading a file into context had bugs. Update to the latest version:agy update.
If something critical breaks and cannot be fixed within an hour, a temporary solution for the Free plan is to stay on Gemini CLI until June 18 while setting up the migration on a separate repository branch. Time limit: 14 days.
Is it worth staying with Google tools after June 18?
Key takeaway
Antigravity CLI starts faster, works with Gemini 3.5 Flash, supports parallel agents and asynchronous background tasks through agy --background. But there are two potential problems: regional access restrictions and an immature ecosystem (fewer plugins and MCP servers than Claude Code). I would not migrate to Antigravity as my primary tool. I would use it as a backup channel for parallel background tasks, while keeping the main development work in Claude Code. If you used Gemini CLI for the Free plan, June 18 is a convenient moment to reconsider your entire toolset.
Antigravity 2.0 can be considered as a backup option for cases where your primary tool (Claude Code or Codex) is not suitable. For a detailed look at what it is good and bad at, see the guide to Google Antigravity 2.0.
A short breakdown of what to do depending on your situation:
| If you... | What to do by June 18 |
|---|---|
| Used the Free Gemini CLI for experiments | Migrate to Antigravity CLI with an account that can access the service OR switch to Claude/Codex—depending on your budget |
| Used Gemini Code Assist in your IDE | Switch to Antigravity IDE or go back to VS Code + Claude Code |
| Ran nightly cron jobs through Gemini API on the Free plan | Urgently rewrite them for the paid Cloud API (which will not be disabled) OR move them to Claude API |
| Work through corporate Cloud (Standard/Enterprise) | Do nothing; the shutdown does not affect you |
| Were only thinking of trying Gemini CLI because “it’s free” | Don’t start; go straight to Claude Code or Codex |
Migration checklist in 15 minutes
Key takeaway
If you want the fastest route without reading the whole guide, here is the short sequence. On a fresh terminal with no active Gemini scripts, the entire migration takes 10–20 minutes.
Install Antigravity CLI
curl -fsSL https://antigravity.google/cli/install.sh | bash(macOS/Linux) orirm https://antigravity.google/cli/install.ps1 | iex(Windows PowerShell).Start agy and authenticate
Without arguments:
agy. Choose OAuth or an API key.Import plugins from .gemini
agy plugin import gemini—this migrates extensions globally. Run it again inside the project folder for workspace plugins.Move skills
mv .gemini/skills/ .agents/skills/. The file contents stay as they are.Replace environment variables
In
~/.zshrc/~/.bashrcand.envfiles:GEMINI_API_KEY → AV_API_KEY,GEMINI_PROJECT_ID → AV_PROJECT_ID,GEMINI_REGION → AV_REGION. Restart the terminal.Verify the installation
agy doctor—all four items (binary, authentication, plugins, network) should be green.Run a test task
agy "write a README for the project in the current folder"—check that the result is similar to what Gemini CLI produced.Update GitHub Actions / GitLab CI
Change the command name and secrets from
GEMINI_*toAV_*.Keep .gemini/ as a backup
You can delete it 1–2 weeks after confirming that everything works.
And lastly: June 18 does not mean “all your projects will go down.” It means the free channel is being disabled. Paid Cloud API access remains, the Gemini CLI repository remains, and forks are possible. If you used the Free plan, you need to decide before June 18; otherwise, the next gemini "something" will return an authorization error.
Sources
Continue working with AI on Ailoot.
More details
Questions about Migrating from Gemini CLI to Antigravity CLI: A Guide
How can I verify the renamed API-key variable without exposing it?
Test whether ${AV_API_KEY:-} is nonempty and print only a set/missing message. Do not echo the key value or run the check with shell tracing enabled; use agy doctor separately to inspect authentication.
Does a successful config import prove all migration work is finished?
No. Compare the active plugins, skills, hooks, and subagents with the old configuration, inspect MCP settings, and run a small task. Keep the old .gemini/ configuration until the intended workflow and result are verified.