How to Install Antigravity CLI on Linux and WSL (Step-by-Step)
How to Install Antigravity CLI on Linux?
One command:
curl -fsSL https://antigravity.google/cli/install.sh | bash
The binary lands at ~/.local/bin/agy.
Verify:
agy --version
If you see command not found, you need to add the install directory to your PATH.
How to Add agy to PATH?
The installer tries to update your shell profile automatically, but it doesn’t always work. Manual fix:
# Immediate effect
export PATH="$HOME/.local/bin:$PATH"
# Permanent — add to .bashrc
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
For zsh users:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
Confirm it works:
which agy
# Should output: /home/youruser/.local/bin/agy
Can I Use apt or dnf Instead?
Yes, but the package managers install the Antigravity IDE (desktop app), not the standalone CLI:
Ubuntu/Debian:
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://antigravity.google/linux/apt/signing-key.gpg | \
sudo gpg --dearmor --yes -o /etc/apt/keyrings/antigravity-repo-key.gpg
echo "deb [signed-by=/etc/apt/keyrings/antigravity-repo-key.gpg] https://antigravity.google/linux/apt antigravity-debian main" | \
sudo tee /etc/apt/sources.list.d/antigravity.list > /dev/null
sudo apt update && sudo apt install antigravity
Fedora/RHEL:
sudo tee /etc/yum.repos.d/antigravity.repo << EOL
[antigravity-rpm]
name=Antigravity RPM Repository
baseurl=https://antigravity.google/linux/rpm
enabled=1
gpgcheck=0
EOL
sudo dnf makecache && sudo dnf install antigravity
For CLI-only usage, the curl script is simpler and lighter.
How to Set Up Antigravity CLI in WSL2?
Install the native Linux binary directly inside WSL (recommended):
curl -fsSL https://antigravity.google/cli/install.sh | bash
export PATH="$HOME/.local/bin:$PATH"
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
Alternative: Symlink from Windows Install
If Antigravity is already installed on Windows:
mkdir -p ~/.local/bin
ln -sf "/mnt/c/Users/YOUR_USERNAME/AppData/Local/Programs/Antigravity/bin/antigravity" ~/.local/bin/agy
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Replace YOUR_USERNAME with your Windows username. The native install is more reliable.
How to Fix Authentication Not Persisting in WSL?
This is the most common WSL issue. agy stores credentials in the OS keyring, but WSL has no graphical session to unlock it.
Fix — install gnome-keyring with a password-free keyring:
sudo apt install gnome-keyring
# Remove old encrypted keyring files
rm -f ~/.local/share/keyrings/*
# Restart WSL (run in Windows PowerShell)
wsl --shutdown
After reopening WSL, authentication will persist between sessions.
What to Do After Installation?
cd ~/your-project
agy
# First launch walks you through browser-based OAuth
# After auth, you're ready to work
Quick Troubleshooting Table
| Error | Cause | Fix |
|---|---|---|
command not found: agy | PATH not set | export PATH="$HOME/.local/bin:$PATH" |
| Stuck on “Signing In…” | No keyring | Install gnome-keyring |
| Network timeout in WSL | DNS issue | Set dnsTunneling=true in .wslconfig |
| OAuth token rejected | WSL clock drift | sudo hwclock -s |