
agy binary.If you landed here after pasting gemini: request failed: HTTP 410 Goneinto a search box, you are in the right place. Nothing is broken on your machine. On June 18, 2026 Google flipped the auth endpoint for Gemini CLI on consumer accounts, and it now answers every call with a 410 Gone. This guide is the direct migration to agy (Antigravity CLI), keyed to the exact strings and env vars your scripts trip over.
1. What you are seeing: gemini returns HTTP 410 Gone
The failure looks like one of these, depending on how you invoke the CLI:
$ gemini "summarize this repo"
Error: request failed with status 410 Gone
# or, in a script that hits the API endpoint directly:
< HTTP/2 410
< content-type: application/json
{"error":{"code":410,"status":"GONE","message":"This endpoint is no longer available."}}410 Gone is a deliberate signal, not a transient outage. Where a 401 or 403 would tell you to re-authenticate, 410means the resource has been permanently removed. Re-running gemini auth, reinstalling the binary, or clearing ~/.gemini/ will not change it on a Google AI Pro, Ultra, or free Gemini Code Assist account. The endpoint is gone for that tier. If you want the deeper background on crashes and auth loops, our Antigravity troubleshooting hub collects the related error strings.
gemini still worksIf you authenticate with a paid Gemini API key, or your org holds a Gemini Code Assist Standard / Enterprise license, the endpoint keeps serving and you will not see the 410. Everyone else has to move to agy.
Get the latest on AI, LLMs & developer tools
New MCP servers, model updates, and guides like this one — delivered weekly.
2. TL;DR: the fastest fix
- Install:
curl -fsSL https://antigravity.google/cli/install.sh | bash(agy 1.1.0, July 2026) - New binary:
agy, notgemini— rename it everywhere you script - Env var:
GEMINI_API_KEY→AV_API_KEY(alsoAV_PROJECT_ID,AV_REGION) - New key: your Google AI Studio key does not transfer — mint a fresh
AV_API_KEY - State dir: agy lives in
~/.gemini/antigravity-cli/; MCP in~/.gemini/config/mcp_config.json - Exit codes: agy returns non-zero on tool-use failure (gemini returned 0)
- Streaming:
agy --streamemits SSE — stripdata:or add--stream-format text - Default model: now
gemini-3-pro
3. Why gemini 410s now
Google announced on May 19, 2026 that Gemini CLI was being folded into Antigravity CLI, with a 30-day migration window for individual-tier accounts and an explicit no-action-required carveout for enterprise. On June 18, 2026 the consumer auth endpoint switched off and started returning 410 Gone. The official Google Developers Blog post is the primary announcement.
Transitioning Gemini CLI users to Antigravity CLI We are unifying our efforts around a single harness and platform, Google Antigravity with four distinct surfaces: • Antigravity 2.0 • Antigravity CLI • Antigravity SDK • Antigravity IDE This will allow us to move faster and
— @geminicli May 19, 2026
Transitioning Gemini CLI users to Antigravity CLI
The official @geminicli account announcing the 30-day migration window for individual-tier accounts and the explicit no-action-required carveout for enterprise users.
The replacement, agy, is a closed-source Go binary — no Node or npm dependency — built for asynchronous multi-agent runs that the single-agent TypeScript gemini could not do. It is not a drop-in rename, though: four behavior changes below are what actually break existing setups. For the full product tour, see our Antigravity CLI deep dive.
4. Install the agy CLI
One install command per platform. The current build is 1.1.0 (July 2026):
# macOS / Linux curl -fsSL https://antigravity.google/cli/install.sh | bash # Windows PowerShell irm https://antigravity.google/cli/install.ps1 | iex
Then wire up your shell PATH and verify:
agy install # configures PATH + shell aliases (post-install) agy --version # expect: 1.1.0 (or later)
The binary is agy — not gemini, not antigravity. Every alias, Makefile target, CI step, and cron entry that calls gemini is a rename. Because it is a compiled Go binary, you can drop the old Node runtime requirement entirely.
5. Authenticate agy
- Interactive. Run
agy. Your browser opens; sign in with the same Google account you used for Gemini CLI. When prompted, choose “Use a Google Cloud project” if you want calls billed to a project. The token lands in your system keyring. - Remote / SSH. Run
agy; it detects the SSH session and prints an authorization URL. Open it on your local machine, finish the OAuth flow, and the session picks up the token. This is first-class now, where Gemini CLI needed manual workarounds. - Headless / CI. Skip the browser entirely by setting an API-key token in the environment (see the env-var section next). This is how you keep an unattended pipeline running.
6. The GEMINI_API_KEY → AV_API_KEY swap
This is the single change most likely to keep a “fixed” pipeline red. agy does not read GEMINI_API_KEY. The direct replacements:
| Gemini CLI | agy (Antigravity CLI) | Notes |
|---|---|---|
GEMINI_API_KEY | AV_API_KEY | Old key does not transfer — mint a new one |
GEMINI_PROJECT_ID | AV_PROJECT_ID | Google Cloud project for billing |
GEMINI_REGION | AV_REGION | Defaults to us-central1 |
# before export GEMINI_API_KEY="AIza...old" # after — new key from the Antigravity dashboard export AV_API_KEY="agy_...new" export AV_PROJECT_ID="my-gcp-project" # if you set the Gemini equivalent export AV_REGION="us-central1" # optional; this is the default
Your existing Google AI Studio / Gemini API key will not authenticateagy — you generate a fresh AV_API_KEY from the Antigravity dashboard. For a purely non-interactive CI worker, an ANTIGRAVITY_API_KEYtoken is the headless auth path; set whichever your workflow standardizes on, but do not leave GEMINI_API_KEY as the only credential in the environment.
7. The ~/.gemini state-dir move
Gemini CLI kept everything flat under ~/.gemini/ — settings.json, skills/, inline MCP config. agy reorganizes that tree, so anything hardcoded to the old paths is silently ignored:
| What | Gemini CLI | agy |
|---|---|---|
| Settings | ~/.gemini/settings.json | ~/.gemini/antigravity-cli/settings.json |
| Keybindings | — | ~/.gemini/antigravity-cli/keybindings.json |
| Central MCP config | Inline in ~/.gemini/settings.json | ~/.gemini/config/mcp_config.json |
| Global skills | ~/.gemini/skills/ | Auto-loaded by agy |
agy still nests under ~/.gemini/, so do not delete that folder — it just reads from the new antigravity-cli/ and config/subdirectories instead of the flat files. If a wrapper script writes ~/.gemini/settings.json to configure the agent, repoint it at ~/.gemini/antigravity-cli/settings.json.
8. Non-zero exit codes on tool failure
Gemini CLI returned exit code 0 even when a tool call inside the run failed — a CI step would go green while the actual work silently failed. agy fixes that: a tool-use failure now surfaces as a non-zero exit code.
That is better behavior, but it flips the assumption in any script that treated a zero exit as “done.” A job that used to pass may now legitimately fail — because it was always failing, just quietly. Audit anything of this shape:
# Gemini CLI: this "succeeded" even on tool failure gemini -p "run the migration" && echo "done" # agy: the same tool failure now short-circuits the && agy -p "run the migration" && echo "done" # handle it explicitly: if ! agy -p "run the migration"; then echo "agy reported a tool failure (non-zero exit)" >&2 fi
9. SSE-default streaming
In Gemini CLI, --stream emitted plain-text chunks. In agy, --stream emits Server-Sent Events by default, so every chunk arrives on a data:-prefixed line. Anything parsing raw output breaks until you account for it:
# agy --stream now yields SSE frames:
data: {"delta":"Hello"}
data: {"delta":" world"}
# Option A — restore plain-text chunks (closest to old gemini behavior)
agy --stream --stream-format text
# Option B — keep SSE and strip the prefix
agy --stream | sed -u 's/^data: //'10. Move MCP servers, skills, and plugins
On first launch agy prompts to import your Gemini CLI extensions. If you skip it or are on a fresh machine, run the import explicitly:
agy plugin import gemini
Two things the import does not fully handle, so do them by hand:
- Workspace skills. Move per-project skills from
.gemini/skills/to.agents/skills/(git mv .gemini/skills .agents/skills). Global skills load automatically. - Remote MCP field rename. agy's MCP config uses
serverUrl, noturl/httpUrl. Central config lives at~/.gemini/config/mcp_config.json; workspace config at.agents/mcp_config.json. Copy a remote entry across without renaming and it fails silently.
// old (Gemini CLI, inline in settings.json)
"mcpServers": { "my-remote": { "url": "https://example.com/mcp" } }
// new (agy, ~/.gemini/config/mcp_config.json)
{ "my-remote": { "serverUrl": "https://example.com/mcp" } }Local (command + args) MCP entries do not need the rename. For the full config reference, see our MCP tutorial and skills setup guide. Context files — GEMINI.md and AGENTS.md — keep working unchanged (GEMINI.md takes precedence).
11. Headless / CI gotcha: agy -p and non-TTY stdout
One more trap worth knowing before you wire agy into a pipeline. In 1.1.0, agy -p (print mode) can complete a full model round trip and emitnothing on stdout when stdout is not a real terminal — piped, redirected to a file, or spawned as a subprocess. Exit code is 0, no stderr warning, output only appears when attached to a TTY. If your CI step calls agy -p and gets empty output, that is this bug, not your prompt. The common workaround is to allocate a pseudo-terminal:
# force a PTY so print-mode output actually reaches the pipe script -qec 'agy -p "generate release notes"' /dev/null > notes.txt
12. Verify the migration
Run one real task you did in Gemini CLI yesterday and check each item that tends to break:
- No more
410 Gone— agy authenticates and returns model output. AV_API_KEY(notGEMINI_API_KEY) is what the environment exposes.- MCP servers fire — watch for silent
serverUrlfailures. - A deliberately failing tool call now returns non-zero, and your script reacts to it.
- Your streaming consumer handles SSE (or you pass
--stream-format text). - Print-mode output actually reaches the pipe in CI (PTY workaround if not).
13. Every breaking change at a glance
| Concept | Gemini CLI | agy (Antigravity CLI) |
|---|---|---|
| Consumer endpoint | HTTP 410 Gone | Serves requests |
| Binary | gemini (Node) | agy (Go, no Node) |
| API-key env var | GEMINI_API_KEY | AV_API_KEY |
| Settings dir | ~/.gemini/ (flat) | ~/.gemini/antigravity-cli/ |
| MCP config | Inline in settings.json | ~/.gemini/config/mcp_config.json |
| Remote MCP field | url / httpUrl | serverUrl |
| Exit on tool failure | 0 (silent) | Non-zero |
--stream format | Plain text | SSE (--stream-format text to revert) |
| Default model | Gemini 2.x default | gemini-3-pro |
14. FAQ
Q: Why does my gemini command return HTTP 410 Gone?
Because Google retired the consumer Gemini CLI endpoint on June 18, 2026. 410 Gone means “permanently removed,” so re-auth or reinstall does nothing on a Google AI Pro, Ultra, or free Gemini Code Assist account. Migrate to agy.
Q: What environment variable replaces GEMINI_API_KEY?
AV_API_KEY. Also AV_PROJECT_ID and AV_REGION(default us-central1). Your old Gemini API key does not carry over — mint a new AV_API_KEY from the Antigravity dashboard. For headless CI, an ANTIGRAVITY_API_KEY token also works.
Q: Where did agy move the ~/.gemini state directory?
agy still nests under ~/.gemini/ but reads settings from ~/.gemini/antigravity-cli/ and central MCP config from ~/.gemini/config/mcp_config.json instead of the old flat ~/.gemini/settings.json. Do not delete ~/.gemini/.
Q: Why did my CI pipeline start failing after switching to agy?
Two changes. agy returns a non-zero exit code on tool-use failure (gemini returned 0), so steps that used to pass now correctly fail. And agy --stream emits SSE, so parsers that read plain text see data:-prefixed lines — add --stream-format textor strip the prefix.
Q: Can I still use Gemini CLI at all?
Only on a paid Gemini API key or a Gemini Code Assist Standard / Enterprise license. On any consumer tier the endpoint returns 410 Gone and there is no local flag that revives it.
Q: agy -p prints nothing in my script — why?
Known 1.1.0 issue: print mode can emit nothing on non-TTY stdout (pipe, redirect, subprocess) with exit code 0. Wrap the call in a pseudo-terminal, e.g. script -qec 'agy -p "..."' /dev/null.
15. Verdict
Our Take
The 410 is not recoverable on the old path, so treat this as a one-hour migration, not a debugging session. Install agy, run agy plugin import gemini, do the four edits that actually break things — AV_API_KEY, the state-dir paths, the exit-code assumption, the SSE parser — then run one real task and confirm it reproduces. Everything else is cleanup.
Related Guides
For the full product breakdown of the new binary, see Antigravity CLI Deep Dive. For other error strings — login loops, crashes, quota limits — the Antigravity troubleshooting hub. For older Gemini CLI workflows that mostly still map over, the Gemini CLI setup guide.
Sources
- Google Developers Blog — An important update: Transitioning Gemini CLI to Antigravity CLI
- google-gemini/gemini-cli Discussion #27274 — transition announcement
- @geminicli on X — transition announcement
- Antigravity CLI — Migrating from Gemini CLI (official docs)
- Antigravity CLI Overview — official docs
- agy issue #76 — agy --print drops stdout on non-TTY
- google-antigravity/antigravity-cli — releases (1.1.0)