Skip to content

How to Install Antigravity CLI on Linux and WSL (Step-by-Step)

· 3 min read

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

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

ErrorCauseFix
command not found: agyPATH not setexport PATH="$HOME/.local/bin:$PATH"
Stuck on “Signing In…”No keyringInstall gnome-keyring
Network timeout in WSLDNS issueSet dnsTunneling=true in .wslconfig
OAuth token rejectedWSL clock driftsudo hwclock -s

FAQ

Where does agy install to?
~/.local/bin/agy by default. Add ~/.local/bin to your PATH if the shell can't find the command.
Why do I have to re-authenticate every time in WSL?
WSL lacks a graphical keyring. Install gnome-keyring and create a password-free keyring to fix this.
Can I install Antigravity CLI with apt?
Yes, but apt installs the Antigravity IDE (desktop app). For the CLI only, use the curl installer script.
Does the Windows Antigravity install work in WSL?
You can symlink it, but installing the native Linux binary directly in WSL is more reliable.
What Linux distros are supported?
Any distro with glibc 2.17+. Ubuntu, Debian, Fedora, RHEL, Arch all work. Also available as .deb and .rpm packages for the IDE.

Related Posts