# Antigravity CLI

Source: https://docs.aicentos.com/en/clients/antigravity-cli

Language: en

> Use aicentos in Antigravity CLI — connect through API Key mode

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

```bash
curl -fsSL https://antigravity.google/cli/install.sh | bash
```

### Windows (PowerShell)

```powershell
irm https://antigravity.google/cli/install.ps1 | iex
```

### Windows (CMD)

```cmd
curl -fsSL https://antigravity.google/cli/install.cmd -o install.cmd && install.cmd && del install.cmd
```

### Verify the installation

```bash
agy --version
```

## Configuration

### Enable API Key mode

Edit `~/.gemini/antigravity-cli/settings.json` and add to the existing JSON:

```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

```bash
export GOOGLE_GEMINI_BASE_URL="https://aicentos.com"
export GEMINI_API_KEY="your_api_key_here"
```

**Important:**

* `GOOGLE_GEMINI_BASE_URL` takes 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 `.env` files or `GOOGLE_API_KEY`.

To make it permanent, add the two `export` lines to `~/.zshrc` or `~/.bashrc`.

## Launch and verify

```bash
agy --model gemini-2.0-flash
```

Once `Gemini API key` shows at the top, start a conversation.

### Troubleshooting

* **Still asks to sign in**: check `"modelProvider": "gemini"`, then quit and restart `agy`.
* **Missing key at startup**: set `GEMINI_API_KEY` again in the current shell.
* **Request failures**: check the API Key, the service root address, and access permission for the chosen model.

## Notes

* Both the `modelProvider` setting 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](https://docs.aicentos.com/clients/antigravity-cli.html)