Antigravity CLI
Use aicentos in Antigravity CLI — connect through API Key mode
Last updated:
Antigravity CLI is a command-line tool from Google that supports connecting to Gemini API-compatible services through API Key mode. This document describes how to configure Antigravity CLI to use a custom API endpoint.
Installation
Choose the installation method for your operating system:
macOS / Linux
curl -fsSL https://antigravity.google/cli/install.sh | bashWindows (PowerShell)
irm https://antigravity.google/cli/install.ps1 | iexWindows (CMD)
curl -fsSL https://antigravity.google/cli/install.cmd -o install.cmd && install.cmd && del install.cmdVerify the installation
agy --versionConfiguration
Enable API Key mode
Edit ~/.gemini/antigravity-cli/settings.json and add to the existing JSON:
{
"modelProvider": "gemini"
}⚠️ Note: setting only GEMINI_API_KEY does not switch the authentication method. modelProvider must be set to the lowercase "gemini".
Set environment variables
export GOOGLE_GEMINI_BASE_URL="https://aicentos.com"
export GEMINI_API_KEY="your_api_key_here"Important:
GOOGLE_GEMINI_BASE_URLtakes the service root address, without any specific API path. The endpoint must be Gemini API-compatible.- Put your API Key in
GEMINI_API_KEY. - Run the commands above in the same shell that launches
agy. The CLI does not read.envfiles orGOOGLE_API_KEY.
To make it permanent, add the two export lines to ~/.zshrc or ~/.bashrc.
Launch and verify
agy --model gemini-2.0-flashOnce Gemini API key shows at the top, start a conversation.
Troubleshooting
- Still asks to sign in: check
"modelProvider": "gemini", then quit and restartagy. - Missing key at startup: set
GEMINI_API_KEYagain in the current shell. - Request failures: check the API Key, the service root address, and access permission for the chosen model.
Notes
- Both the
modelProvidersetting and the environment variables must be in place for API Key mode to work - Environment variables must be set in the shell session that launches the CLI, or written to a shell configuration file to persist
- The service endpoint must be compatible with the Gemini API specification
Related links
- Official documentation: https://docs.aicentos.com/clients/antigravity-cli.html