Skip to main content

Antigravity CLI

Antigravity CLI (agy) is Google's terminal coding agent. It connects to MAG through the Gemini API route.

warning

Coding agents make many model calls with long contexts. Usage can be expensive and counts against the allocation of your project. Frontier models cost more per token. To reduce cost, use a smaller model for routine tasks and a lower reasoning effort. Check your spend on the MAG Dashboard.

1. Configure Antigravity CLI​

Make sure the environment variable AMSC_TOKEN contains your PAT, as shown in Step 4.

Antigravity CLI reads the API key and the endpoint from two environment variables. Add this to ~/.zshrc or ~/.bashrc:

export GEMINI_API_KEY="$AMSC_TOKEN"
export GOOGLE_GEMINI_BASE_URL="https://mag.genesis.americansciencecloud.org"

Do not add /v1 to the base URL. Antigravity CLI sends its requests to /v1beta. It sends the key in the header X-Goog-Api-Key, and MAG accepts the PAT in that header.

2. Start Antigravity CLI​

Start it in your project directory:

cd my-project
agy

To run one prompt and print the answer, use -p:

agy -p "Explain what this repository does."

If the command agy is not found, add the install directory to your path:

export PATH="$HOME/.local/bin:$PATH"

3. Select a model​

Antigravity CLI offers only its built-in models. It does not accept other model names, so you cannot select a MAG model that is not in its list. To list the models, run:

agy models
note

Antigravity CLI does not support Gemini 4 Argon through MAG yet. A fix is coming soon.

To select a model and a reasoning effort for one session, use the options --model and --effort:

agy --model "Gemini 3.8 Flash (Low)"

Antigravity CLI also makes a small background request with a lightweight model on every run. MAG serves it without any setting from you.