# Migrating from Gemini CLI to Antigravity CLI: A Guide

> Installing agy, migrating configuration, plugins, and environment variables; checks, common errors, and regional restrictions.

Source: https://ailoot.ai/blog/en/gemini-cli-to-antigravity-cli-migration/
Canonical: https://ailoot.ai/blog/en/gemini-cli-to-antigravity-cli-migration/
Language: en
Publisher: Ailoot (https://ailoot.ai/)
Translation: guide-097
Revision: sha256-6be65531decf6527a7f9c24b72603a870d7d2d6f9a70843d276235f5835a25a6


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. 



<div class="aside" data-semantic="ailoot-docs-link" role="note" aria-label="Ailoot documentation">

Connecting models and working with the API are covered in the [Ailoot documentation](https://ailoot.ai/docs/).

</div>

## Which Gemini CLI users are affected by the June 18, 2026 change?

<div class="aside" data-semantic="key-takeaway" role="note" aria-label="Key takeaway">

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.

</div>

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:

<figure>
<blockquote>
<p>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.</p>
</blockquote>
<figcaption>— Google Developers Blog, https://developers.googleblog.com/an-important-update-transitioning-gemini-cli-to-antigravity-cli/</figcaption>
</figure>

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?

<div class="aside" data-semantic="key-takeaway" role="note" aria-label="Key takeaway">

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.

</div>

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:

<figure>
<blockquote>
<p>Antigravity CLI is built in Go, runs faster, and supports asynchronous background workflows.</p>
</blockquote>
<figcaption>— Google Developers Blog, https://developers.googleblog.com/an-important-update-transitioning-gemini-cli-to-antigravity-cli/</figcaption>
</figure>

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:

<figure>
<blockquote>
<p>The repository will remain available on GitHub under the Apache 2.0 license, and we will continue working on the project as open source.</p>
</blockquote>
<figcaption>— Google, https://github.com/google-gemini/gemini-cli</figcaption>
</figure>

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

<div class="aside" data-semantic="key-takeaway" role="note" aria-label="Key takeaway">

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.

</div>

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`:

```bash
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:

```bash
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
```

Check that the binary is visible:

```bash
which agy
agy --version
```

### Windows (PowerShell)

```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:

```cmd
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:

```bash
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:

1. Choose an interface theme.
2. Choose an authentication method: Google OAuth (for personal accounts) or an API key.
3. 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

<div class="aside" data-semantic="key-takeaway" role="note" aria-label="Key takeaway">

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.

</div>

Step by step:

1.  ### 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.

2.  ### 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.

3.  ### 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.

4.  ### agy config --edit

    Opens the config in the default editor (`$EDITOR`). If something was not picked up automatically, edit it manually.

5.  ### 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](https://ailoot.ai/blog/en/agents-md-guide-template/), 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?

<div class="aside" data-semantic="key-takeaway" role="note" aria-label="Key takeaway">

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.

</div>

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_`:

```bash
# 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:

```bash
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

<div class="aside" data-semantic="key-takeaway" role="note" aria-label="Key takeaway">

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.

</div>

Checklist of initial problems:

1. **MCP servers.** If you used `mcp_servers` in `.gemini/config.json`, they might not be picked up after `agy plugin import gemini`. Check with `agy inspect`—there will be an `mcp` section. If it is empty or has errors, rewrite it manually with `agy config --edit`. The format is described in the official Antigravity documentation (look for the MCP section).

2. **Custom hooks.** If you had a bash script in `.gemini/hooks/` that read `$GEMINI_API_KEY`, it will break. Find such places: bash

    ```
    grep -rn "GEMINI_" .agents/hooks/ 2>/dev/null
    ```

    Replace the variables.

3. **CI/CD.** In GitHub Actions or GitLab CI, change steps that use the `gemini` command to `agy`. The binary name in the installer may differ, so create an abstraction using the `$CLI_CMD` variable.

4. **IDE Extension.** The Gemini Code Assist extension for VS Code will be disabled along with the CLI. The replacement is [Antigravity IDE](https://antigravity.google) (a separate VS Code fork) or AGENTS.md in any other AI editor.

5. **`@[file]` loading.** In early Antigravity CLI builds, the `@src/file.ts` command 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?

<div class="aside" data-semantic="key-takeaway" role="note" aria-label="Key takeaway">

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.

</div>

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](https://ailoot.ai/blog/en/google-antigravity/).

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](https://ailoot.ai/blog/en/claude-code/) or [Codex](https://ailoot.ai/blog/en/codex-vs-claude-code-choice/) |



## Migration checklist in 15 minutes

<div class="aside" data-semantic="key-takeaway" role="note" aria-label="Key takeaway">

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.

</div>

1. ### Install Antigravity CLI

    `curl -fsSL https://antigravity.google/cli/install.sh | bash` (macOS/Linux) or `irm https://antigravity.google/cli/install.ps1 | iex` (Windows PowerShell).

2. ### Start agy and authenticate

    Without arguments: `agy`. Choose OAuth or an API key.

3. ### Import plugins from .gemini

    `agy plugin import gemini`—this migrates extensions globally. Run it again inside the project folder for workspace plugins.

4. ### Move skills

    `mv .gemini/skills/ .agents/skills/`. The file contents stay as they are.

5. ### Replace environment variables

    In `~/.zshrc`/`~/.bashrc` and `.env` files: `GEMINI_API_KEY → AV_API_KEY`, `GEMINI_PROJECT_ID → AV_PROJECT_ID`, `GEMINI_REGION → AV_REGION`. Restart the terminal.

6. ### Verify the installation

    `agy doctor`—all four items (binary, authentication, plugins, network) should be green.

7. ### 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.

8. ### Update GitHub Actions / GitLab CI

    Change the command name and secrets from `GEMINI_*` to `AV_*`.

9. ### 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.

<div class="section" role="doc-bibliography" aria-label="Sources">

### Sources

- [Google Developers Blog - An important update: Transitioning Gemini CLI to Antigravity CLI](https://developers.googleblog.com/an-important-update-transitioning-gemini-cli-to-antigravity-cli/)

- [Antigravity CLI - Getting Started](https://antigravity.google/docs/cli-getting-started)
- [Antigravity CLI - GitHub repository](https://github.com/google-antigravity/antigravity-cli)






- [Google Blog - Google I/O 2026 developer highlights](https://blog.google/innovation-and-ai/technology/developers-tools/google-io-2026-developer-highlights/)


</div>







<div class="aside" data-semantic="ailoot-link" role="note" aria-label="Ailoot">

Continue working with AI on [Ailoot](https://ailoot.ai/).

</div>

## 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.


## Ailoot · The company and its project portfolio

Ailoot combines established operating experience, a large client base, stable service and ongoing KPI control.

The company and its project portfolio: millions of customers; monthly sales in the billions.

Ailoot brings that operating experience to API access for AI features in customer products, agents, applications and automations.
