Looking for how to install Gemini CLI on WSL2? Since June 18, 2026, Gemini CLI no longer works with free accounts or Google AI Pro and Ultra plans. Google moved those users to Antigravity CLI, a terminal AI agent you run with the agy command. This guide shows you how to install it on WSL2 Ubuntu and fix the two issues WSL users usually hit.
If your organization has a Gemini Code Assist Standard or Enterprise license, Gemini CLI still works for you; see the official Gemini CLI repository. Everyone else should follow the steps below, as Google explains in its transition announcement.
Quick Option: Let an AI Agent Set It Up for You
Already use an AI agent such as Claude Code or Codex in WSL? Paste this prompt into it. The sign-in is left to you because it needs your Google account in a browser.
Install Google's Antigravity CLI (agy) in this WSL2 Ubuntu environment.
First check and report: Ubuntu version, whether curl and agy are installed,
and whether ~/.local/bin is on PATH. Ask me before making any change.
Then run: curl -fsSL https://antigravity.google/cli/install.sh | bash
If ~/.local/bin is not on PATH, add export PATH="$HOME/.local/bin:$PATH" to ~/.bashrc once.
Verify with agy --version. Do not sign in for me or change other settings.
Prerequisites
- Windows 10 or 11 with WSL2 and a 64-bit Ubuntu distribution
- A personal Google account (free, Google AI Pro, or Ultra), or a Gemini API key
- A browser on Windows to complete the Google sign-in
You don’t need Node.js: unlike Gemini CLI, Antigravity CLI is a single binary. New to WSL? Start with How to Install Ubuntu in WSL 2 on Windows. Google Workspace accounts don’t include Antigravity plans; see Google’s Workspace accounts page if that’s what you use.
Step 1: Install Antigravity CLI
Run the official installer inside your Ubuntu terminal, not in PowerShell:
curl -fsSL https://antigravity.google/cli/install.sh | bash
The script installs agy to ~/.local/bin without sudo and checks the download against a checksum. If you prefer to read a script before running it, save it with curl -fsSL https://antigravity.google/cli/install.sh -o install.sh, review it, then run bash install.sh.
Step 2: Verify the Installation
Open a new terminal tab and check the version:
agy --version
If you see agy: command not found, ~/.local/bin isn’t on your PATH. Add it and try again:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
agy --version
Step 3: Sign In
Go to a project folder and start the CLI:
cd ~/projects/my-app
agy
The first launch asks you to pick a color scheme, a display mode, and whether you trust the current folder. Only trust folders whose code you know. It then opens your browser; choose Google OAuth for a personal account.
If the browser doesn’t open from WSL, install wslu, which lets Linux programs open your Windows browser, and run agy again. Google’s docs don’t cover WSL here, so treat this as a workaround rather than an official step:
sudo apt install -y wslu
export BROWSER=wslview
agy
If agy can’t save your login
agy stores its login token in the Linux keyring, which plain Ubuntu on WSL doesn’t have. You may see secret keyring is locked or the CLI may hang. Google’s troubleshooting page asks for a running keyring service such as GNOME Keyring:
sudo apt install -y gnome-keyring
If that still doesn’t work, use a Gemini API key instead, which needs no browser sign-in or keyring. Create a key in Google AI Studio (usage is billed under Gemini API pricing), set "modelProvider": "gemini" in ~/.gemini/antigravity-cli/settings.json, then run:
export GEMINI_API_KEY="your-api-key"
agy
Step 4: Choose a Safe Mode
Antigravity CLI starts in auto mode when your account supports it: it edits files without asking and decides which commands are safe to run. For code you don’t know well, switch to default mode so it shows each change and asks before running commands. Press Shift+Tab to cycle modes, or set Agent Mode to default in /config. See Google’s execution modes page for the full list.
Basic Usage
Type requests in plain English, such as “explain how this project builds”. Useful commands: /help for shortcuts, /usage to see your remaining quota, /model to change models, and /logout to sign out. To run one prompt from a script, use agy -p "your question" after you’ve signed in once.
Free accounts get a quota that refreshes weekly; Google AI Pro and Ultra get more. Google doesn’t publish exact limits, and they can change (see the Plans page). The CLI updates itself in the background.
Coming From Gemini CLI
On first launch, agy detects your Gemini CLI settings and offers to migrate them. A few things need attention, per the migration guide:
GEMINI.mdandAGENTS.mdcontext files keep working as they are.- Move project skills from
.gemini/skills/to.agents/skills/. - MCP servers move to
~/.gemini/config/mcp_config.json, and remote server URLs use the keyserverUrl. - Convert extensions to plugins with
agy plugin import gemini.
For more on MCP servers, see How to Configure MCP Servers in VS Code, Claude Desktop, and Claude Code on WSL.
Privacy: What Gets Sent to Google
Under the Antigravity Terms, Google may use your prompts and the code the agent works with to improve its products, and people at Google may review them. Don’t use it on confidential work code without your employer’s approval. To opt out, turn off Enable Telemetry in /config.
Conclusion
You now have Antigravity CLI running in WSL2 Ubuntu, signed in and set to a mode you’re comfortable with. To compare it with another terminal agent, see How to Install Claude Code CLI on WSL2 Ubuntu.


