Google's Antigravity and WSL
If like me you use WSL2 for your dev work on Windows and you launch vscode from WSL with code . you probably expect Antigravity to behave the same. But it doesn't. The hacky fix: (Update the WIN_AGY line).
mkdir -p ~/.local/bin
cat > ~/.local/bin/agy <<'SH'
#!/usr/bin/env bash
set -euo pipefail
WIN_AGY="/mnt/c/Users/[YOUR PROFILE HERE]/AppData/Local/Programs/Antigravity/bin/antigravity"
# Default: open current folder
if [ $# -eq 0 ]; then
set -- .
fi
# Launch Antigravity (Windows binary) but pass WSL paths through.
# Antigravity/VS Code launchers understand WSL paths and will open the folder.
exec "$WIN_AGY" "$@"
SH
chmod +x ~/.local/bin/agy
Make sure ~/.local/bin is on your PATH (most distros do this automatically). If not:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
While agy . now works it doesn't launch Antigravity in WSL2 mode it just opens the current folder with the network path from Windows. To fix that we need to change some things. First open this file in Windows:
C:\Users\[YOUR PROFILE]\AppData\Local\Programs\Antigravity\bin\antigravity
Find this line:
WSL_EXT_ID="ms-vscode-remote.remote-wsl"
Change to:
WSL_EXT_ID="google.antigravity-remote-wsl"
Now, when you try running agy . it will fail and say it can't find wslCode.sh.
To fix that you need to copy the files in:
C:\Users\[YOUR PROFILE]\.vscode\extensions\ms-vscode-remote.remote-wsl-*\scripts\
To:
C:\Users\[YOUR PROFILE]\AppData\Local\Programs\Antigravity\resources\app\extensions\antigravity-remote-wsl\scripts\
Note you have to make the scripts folder it won't be there by default.
After that, agy . should behave like code ..