You want Google’s coding agent in a terminal, on a box you reach over SSH, without opening a desktop app first. To install Antigravity CLI on Linux or macOS, run curl -fsSL https://antigravity.google/cli/install.sh | bash, add ~/.local/bin to your PATH, and start agy. On Windows the same job is one PowerShell line, covered in Step 2.
A lot moved since June. The binary grew, headless runs now need explicit permission rules, and Gemini CLI did not disappear the way many people expected. I ran through this on Ubuntu 26.04 in November 2026 and it works end to end, with Application Default Credentials doing the sign-in on a cloud VM.
Below we cover which Antigravity product you need, sign-in on a server, headless permissions and the AES crash that still bites virtual machines.
Which Antigravity should you install?
Antigravity is now a family of five products, and the download page lists them side by side. They share one authentication layer, so signing in on one local surface signs you in on the others. Picking the wrong one is the most common reason people end up with an editor when they wanted a terminal agent, so match the tool to the job first:
| Product | Version on the download page | Install it when you want |
|---|---|---|
Antigravity CLI (agy) | 1.5.16 | An agent in a terminal, over SSH, in scripts and CI |
| Antigravity App | 2.35.0 | Projects, subagents, scheduled automations, /swarm, SSH remote hosts, voice, skills, MCP and JSON hooks |
| Antigravity IDE (standalone) | 2.8.0 | A full editor with agent panels built in |
| IDE extensions | VS Code 1.13.0, JetBrains, Zed and Xcode 1.5.0, Eclipse 1.2.0, Visual Studio 1.0.261116.0 | The agent inside the editor you already use |
Python SDK (google-antigravity) | 0.1.24 | Your own agents in code, installed with pip install google-antigravity |
The App is the graphical hub. It ships a Linux tar.gz that needs glibc 2.28 or newer, plus macOS 13 and Windows 10 builds, and it is where scheduled automations and the SSH Host connections live. The CLI is the one this guide installs, and it is the right pick for servers because it needs no display at all. If you are still comparing agent editors rather than terminal tools, our Cursor vs Windsurf vs Kiro comparison covers that side of the market.
What happened to the Gemini CLI?
Gemini CLI was not retired. On 18 June 2026 Google moved free individual accounts and Google AI Pro and Ultra subscribers from Gemini CLI to Antigravity CLI, as the transition post on the Google Developers Blog explains. Gemini CLI itself keeps running, and its GitHub repository still tags weekly releases, for these users:
- Gemini Code Assist Standard and Enterprise
- Gemini Code Assist for GitHub through Google Cloud
- Paid Gemini API and Gemini Enterprise Agent Platform API keys
So the question is which account you use, not whether the tool exists. A personal Google account belongs on agy now. A company on a Code Assist licence can stay on gemini, and our Gemini CLI install and configuration guide still applies there. Step 7 shows how to bring your Gemini CLI plugins across when you do move.
Prerequisites
The CLI needs very little, but the last item on this list is the one that stops people cold on virtual machines:
- 64-bit Linux, macOS or Windows with outbound HTTPS
- About 300 MB free in your home directory for the binary
- A Google account, or a Google Cloud project with Vertex AI enabled
- A CPU that exposes AES instructions (on Proxmox,
hostorx86-64-v2-AES)
Our lab box was an Ubuntu 26.04.1 cloud VM with 2 vCPUs and 8 GB of RAM, which is plenty: the agent does its thinking on Google’s side, so local load stays low. Free disk is the number to check on a small homelab container: the binary alone is 263 MB, the installer stages its download under ~/.cache/antigravity, and saved conversations grow from there.
Step 1: Install the Antigravity CLI on Ubuntu 26.04
The Antigravity CLI install Linux and macOS users run is one shell script, so read it before you pipe it into bash on anything that matters. It detects the platform, asks the release repository for the newest build, verifies a checksum and drops one native binary called agy into ~/.local/bin. There is no npm package and no Node.js runtime involved.
curl -fsSL https://antigravity.google/cli/install.sh | bash
On our server the script found linux_amd64, reported 1.5.16 as the latest release and verified the download. The installer always asks for the newest build, so right after a release it can be a few hours ahead of the version printed on the download page. The last lines are the important ones:

Our shell did not pick up the new directory. The installer placed the binary, then printed a warning that ~/.local/bin is missing from PATH and told us to add it ourselves. Older write-ups, including the first version of this one, say the script handles that, so do not count on it. The default ~/.profile on Ubuntu adds ~/.local/bin at the next login once the directory exists, but a plain new terminal is not always a login shell. Add the line to ~/.bashrc and load it:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Zsh users put the same line in ~/.zshrc. The installer already runs agy install, the subcommand that configures shell paths, and the --skip-path and --skip-aliases flags tell it to leave your profile alone when a dotfile manager owns it. Now confirm the version and look at what landed on disk:
agy --version
ls -lh ~/.local/bin/agy
file ~/.local/bin/agy
At 263 MB, the binary is about 80 MB heavier than the build we first wrote this guide on in June. It is one stripped, dynamically linked ELF file, and the built-in plugins such as the /swarm board unpack under ~/.gemini/antigravity-cli/builtin on first run:

Run agy --help once to see the shape of the tool. Besides the session flags, the subcommands tell you what the CLI can manage without opening the interactive interface:

The ones you will reach for first are mcp for MCP servers, plugin for plugins and Gemini CLI imports, models and update. acp starts an Agent Client Protocol server for editors such as Zed, and remote-control runs a background daemon so you can drive a session from a browser. Every flag and slash command is collected in our Antigravity CLI cheat sheet.
Step 2: Install on macOS and Windows
Our hands-on run was on Ubuntu, so the macOS and Windows commands here are the ones on Google’s Antigravity download page. The Antigravity CLI macOS install uses the same install.sh line as Linux, and the script detects the platform before it downloads. If nix-darwin or Home Manager owns your shell profile, add ~/.local/bin to PATH in your Nix config, since that is where your profile changes belong anyway. Windows has two official installers, one per shell. In PowerShell:
irm https://antigravity.google/cli/install.ps1 | iex
From the classic Command Prompt, the download page gives a version that fetches install.cmd, runs it and deletes it afterwards:
curl -fsSL https://antigravity.google/cli/install.cmd -o install.cmd && install.cmd && del install.cmd
Both Windows scripts install the same native binary. Google’s sign-in docs say the CLI opens your default browser on a desktop and keeps the session in Windows Credential Manager. Run agy --version in a new terminal window to confirm, because the current window will not see the updated PATH.
Step 3: Sign in with a Google account or a Cloud project
There is still no login subcommand. Run agy with no arguments and, without a saved session, it opens a sign-in menu. Commands that need a model refuse until you do: our agy models before sign-in answered “Please sign in to view available models. Launch the CLI without arguments to sign in.”

Which option is yours? It depends on who pays for the model calls, and the CLI supports three routes:
- Google OAuth: personal account, free, Pro or Ultra plan
- Use a Google Cloud project: Gemini Enterprise, pay as you go, SSO
- Gemini API key: AI Studio key plus a settings change
Most readers on a laptop want OAuth. A server you reach over SSH can use either OAuth with a pasted code or, if you already run Google Cloud, Application Default Credentials, which skip the browser completely. Both are shown below.
Signing in over SSH
On a remote shell the CLI cannot open a browser, so it prints the full OAuth URL and waits for a code. Copy the URL to a browser on your laptop, approve the consent screen, then paste the code the callback page shows back into the terminal. We blanked the per-session challenge and state values in this capture:

Have the browser ready before you launch agy, because the paste prompt does not wait forever. On this November run we stopped at the URL and signed the server in with ADC instead, so the OAuth details after the paste come from Google’s docs and our June run. Google’s docs say a local session lives in the operating system keyring (Apple Keychain, the Linux Secret Service over dbus, or Windows Credential Manager), so the next launch signs in silently. Typing /logout inside the CLI clears that saved profile.
Headless sign-in with Application Default Credentials
For servers and CI, skip the browser entirely and use Google Cloud Application Default Credentials. On a workstation you create them with gcloud auth application-default login --project your-gcp-project-id. On a Compute Engine VM with the cloud-platform scope, ADC comes from the metadata server with no login step at all, which is what we used. Turn it on with environment variables:
export AGY_ADC_AUTH=true
export GOOGLE_CLOUD_PROJECT=your-gcp-project-id GOOGLE_CLOUD_LOCATION=global
agy models | head -12
agy -p "Reply with the single word: ready"
Our model list came back with the Gemini 4 family (Carbon, Neon, Hydrogen, Argon), several Gemini 3.x Flash tiers, Claude Opus and Sonnet variants and an Orchestrator entry, and the print-mode prompt answered “ready”. The project needs the Vertex AI API enabled, and usage bills to it. The Antigravity docs name GOOGLE_CLOUD_QUOTA_PROJECT and GOOGLE_CLOUD_LOCATION as the optional ADC variables; we set GOOGLE_CLOUD_PROJECT as well, and on a workstation the --project flag of the gcloud login records the quota project for you:

A Gemini API key from Google AI Studio is the third option, and it has a trap. Exporting GEMINI_API_KEY alone does nothing. You also need "modelProvider": "gemini" in ~/.gemini/antigravity-cli/settings.json, and once that is set the CLI refuses to start without the variable. To leave ADC again, unset AGY_ADC_AUTH and open a new shell.
Step 4: Run your first agentic task
Print mode (-p) runs one prompt without the interactive interface and lets the agent use tools until the job is done. Point it at a working directory with --add-dir, otherwise it works in a project of its own. We gave it a small, checkable job: a Python script that summarises an nginx access log, with pytest tests.
mkdir -p ~/logsum && cd ~/logsum
agy --add-dir ~/logsum --mode auto -p "In ~/logsum write logsum.py: a CLI that reads an nginx access log path and prints the top 5 client IPs and the count of each HTTP status code. Add test_logsum.py with pytest tests using a small sample log. Run python3 -m pytest -q and report the result."
Eight seconds later it quit with nothing written. Why? For one, --mode auto needs the terminal sandbox, which was not available on our cloud VM, so the CLI fell back to the default mode. On top of that, the default mode asks before running commands, and headless print mode has nobody to ask, so the request was denied automatically:

Both ways out are named in the error. --dangerously-skip-permissions approves every tool call, which is fine in a disposable VM and reckless on a machine with credentials on it. The better habit is allow rules. The --settings flag takes the same JSON keys as settings.json for one session only, so you can grant exactly what the task needs:
agy --model gemini-3.5-flash --add-dir ~/logsum \
--settings "{\"permissions\":{\"allow\":[\"command(python3)\",\"command(ls)\",\"command(cat)\",\"write_file($HOME/logsum)\"]}}" \
-p "In ~/logsum write logsum.py: a CLI that reads an nginx access log path and prints the top 5 client IPs and the count of each HTTP status code. Add test_logsum.py with pytest tests using a small sample log. Run python3 -m pytest -q and report the result."
The JSON sits in double quotes so the shell expands $HOME to your own home directory; our capture shows the expanded /home/kibet/logsum, and a rule pointing at another home directory matches nothing. With write_file scoped to the project, the agent wrote logsum.py and test_logsum.py in about 80 seconds. It still stopped on one shell command our rules did not cover, so the final pytest run was ours, and all three tests passed:

So should you write tight rules or broad ones? In headless mode, tight rules mean a few denied steps you finish by hand, broad rules mean the agent runs anything. Start tight, read ~/.gemini/antigravity-cli/cli.log to see which permission it asked for, and widen one rule at a time. We pinned gemini-3.5-flash on this run because the default model had just returned RESOURCE_EXHAUSTED (code 429) on our project, more on that below. When a print-mode run like this grows into a pipeline, a bot or a CI job, the Antigravity Python SDK drives the same agent runtime from your own Python code, with the same safety policies.
Step 5: Know where the config and state live
Everything the CLI keeps sits under ~/.gemini, split into two directories. Knowing which is which saves you from deleting shared settings when you only meant to reset the CLI:
~/.gemini/antigravity-cli/: CLI state, logs, conversations~/.gemini/antigravity-cli/settings.json: CLI settings, permissions~/.gemini/config/mcp_config.json: MCP servers~/.gemini/config/config.json: shared user settings
Sign-in is shared through the operating system keyring, while config holds settings the other surfaces read too, such as the MCP list the CLI and the IDE use. The CLI does not create settings.json until you change a setting, and conversations are now kept indefinitely in conversations/, where releases before 1.5.15 pruned everything past the 500 most recent. Here is the layout after our runs, followed by an update check:

There was no token file on our server because ADC never stores one, and on a desktop the session goes into the keyring instead. The OAuth token path is from our June run, not this one: when we signed in with OAuth on a Linux server for the June version of this guide, the token landed in a plain file, ~/.gemini/antigravity-cli/antigravity-oauth-token, so treat that directory like an SSH key and keep it out of backups you share. agy update checks the release repository and replaces the binary in place, and agy changelog prints the release notes offline from a cached copy, which is the quickest way to see what a new build changed before you trust it in CI.
Step 6: Fix the “Illegal instruction” AES error on VMs
If agy dies the instant it starts with a core dump, you are almost certainly on a virtual machine with a generic CPU model. The binary is built with hardware AES enabled and refuses to start when the CPU it sees does not advertise it:
FATAL ERROR: This binary was compiled with aes enabled, but this feature is not available on this processor (go/sigill-fail-fast).
Illegal instruction (core dumped)
Check the guest before you change anything: grep -m1 -o -w aes /proc/cpuinfo prints aes on a healthy machine, as it did on our cloud VM, and nothing at all on a masked one. Proxmox’s kvm64 CPU type and older plain KVM defaults hide the flag. Set the VM’s CPU to host, then shut it down and start it again so the new model attaches:
qm set 151 --cpu host
qm shutdown 151 && qm start 151
A reboot from inside the guest does not help, because the CPU model only changes when the QEMU process restarts. Replace 151 with your VM ID. After the cold boot the flag shows up and the version command returns normally:

That capture is from our June build, and the cause has not changed since. In a cluster where VMs migrate between different CPU generations, x86-64-v2-AES is a safer CPU type than host, because it exposes AES while keeping the guests portable. VMware’s equivalent is passing the host CPU features through, and mainstream cloud instance types already expose AES.
Step 7: Bring your Gemini CLI setup across
The CLI has a migration helper built into the plugin manager. agy plugin import takes gemini or claude as its source, so extensions from either tool come across in one command instead of being rebuilt by hand:
agy plugin import gemini
agy plugin list
Skills, hooks, subagents and MCP servers all exist in Antigravity, but the file locations differ, so treat an import as a starting point and test each plugin. The CLI also reads cross-tool Agent Skills from ~/.agents/skills since 1.5.16, which means a skills folder you share with other agents needs no copy. Keep the Gemini CLI cheat sheet open while you map old commands to new ones.
If you work across several agents, the habits carry over. Claude Code and the Codex CLI use the same print mode, permission rule and MCP ideas, and our comparison of open-source terminal coding agents shows where each one fits.
What broke in our run
These are the failures we hit on the November rebuild, with the exact text the CLI printed and what fixed each one.
“a tool required the “command” permission that headless mode cannot prompt for”
Print mode never asks, it denies. Add an allow rule for the tool it names, either in settings.json under permissions.allow or for one run with --settings. The same message appears for write_file, and a rule like write_file($HOME/logsum) inside double-quoted JSON keeps file writes inside the project.
“–mode auto is not available because the terminal sandbox is not available on this host”
Auto mode depends on the terminal sandbox, and our Ubuntu cloud image did not provide one, so the CLI printed that warning and continued in the default mode. The warning is harmless on its own, but it means auto mode is not what decides your permissions on that host. Allow rules work either way.
“RESOURCE_EXHAUSTED (code 429): Resource exhausted”
With ADC, requests count against the Vertex AI quota of your project, and our third run hit the limit and gave up after 3 minutes 20 seconds. The CLI marks the error "retryable":false, so it ends the run. Switching to --model gemini-3.5-flash worked straight away. Google’s guidance for this error is the global endpoint (which GOOGLE_CLOUD_LOCATION=global already selects), backing off between retries, smoothing bursts, or Provisioned Throughput for steady heavy use.
“agy: command not found” right after install
The installer leaves PATH to you, as Step 1 showed. Add ~/.local/bin to your profile, open a new shell, or call ~/.local/bin/agy directly.
Uninstall the Antigravity CLI
Removing the CLI takes three commands plus one step inside the CLI that has to come first. Run /logout inside agy first if you signed in with OAuth, so the keyring entry goes too. Then delete the binary, the CLI state and the PATH line:
rm -f ~/.local/bin/agy
rm -rf ~/.gemini/antigravity-cli
sed -i '/\.local\/bin/d' ~/.bashrc
The sed line removes every line mentioning .local/bin, so check ~/.bashrc first if other tools put entries there, and run it on ~/.zshrc instead if you use zsh. The download staging directory of the installer, ~/.cache/antigravity, can go as well. Leave ~/.gemini/config alone if the Antigravity App or IDE is installed on the same machine, because they share it; on a server that only ever ran the CLI, as ours did, you can delete it too.