Skip to content

Instantly share code, notes, and snippets.

@MichaelWS
Created June 1, 2026 14:58
Show Gist options
  • Select an option

  • Save MichaelWS/6c25db778aaabc896eda5561d5a07e20 to your computer and use it in GitHub Desktop.

Select an option

Save MichaelWS/6c25db778aaabc896eda5561d5a07e20 to your computer and use it in GitHub Desktop.
agy update
#!/bin/bash
# 1. Ensure the script is run with sudo privileges
if [ "$EUID" -ne 0 ]; then
echo "Error: Please run this script with sudo."
exit 1
fi
echo "--- Cleaning up old Antigravity CLI installations ---"
# Remove the system-wide binary if it exists
rm -rf /usr/bin/agy
# Remove the user's local binary if it exists (accounting for the user invoking sudo)
if [ -n "$SUDO_USER" ]; then
rm -f /home/$SUDO_USER/.local/bin/agy
fi
echo "--- Installing Antigravity CLI ---"
# Download and execute the installation script
rm /usr/local/bin/agy
curl -fsSL https://antigravity.google/cli/install.sh | bash -s -- --dir /usr/local/bin
# Ensure the binary has execute permissions
chmod +x /usr/local/bin/agy
echo "--- Patching the CLI ---"
# Ensure the python patch script exists in the directory where this script is run
if [ -f "antigravity_patch.py" ]; then
/apps/miniforge3/bin/python antigravity_patch.py /usr/local/bin/agy
else
echo "Warning: antigravity_patch.py not found in the current directory."
echo "The binary was installed, but not patched."
exit 1
fi
sudo cp /usr/local/bin/agy.va39 /usr/local/bin/agy
echo "--- Installation Complete ---"
# Verify the patched version
/usr/local/bin/agy --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment