Skip to content

Antigravity CLI

If your machine does not have the agy command yet, complete the official installation for your system first. The Antigravity CLI command is agy, not antigravity.

Open the official installation guide and follow the Windows installation method shown there.

Open a new terminal and check the version:

cmd
agy --version

See the official Antigravity CLI command reference for more commands and options.

Google sign-in and Gemini API key mode are separate authentication modes in Antigravity CLI. To use Qiuqiu Token, set modelProvider: "gemini", then provide the token and endpoint through environment variables. Do not continue with Google OAuth sign-in in the CLI.

  1. Create the configuration directory.

    cmd
    mkdir "%USERPROFILE%\.gemini\antigravity-cli"

    The settings file is %USERPROFILE%\.gemini\antigravity-cli\settings.json on Windows and ~/.gemini/antigravity-cli/settings.json on macOS/Linux.

  2. Create or update settings.json.

    If the file already contains other settings, add or replace only modelProvider; keep the remaining fields.

    json
    {
    "modelProvider": "gemini"
    }
  3. Set the Gemini API key and Gemini-compatible root URL.

    Use the root URL without appending /v1. Replace sk-your-token with a token from the Gemini CLI group.

    cmd
    setx GEMINI_API_KEY "sk-your-token"
    setx GOOGLE_GEMINI_BASE_URL "https://api.qiuqiutoken.net"

    setx writes user-level environment variables, but it does not update terminals that are already open.

    If both GOOGLE_API_KEY and GEMINI_API_KEY are present, the CLI uses GOOGLE_API_KEY; remove or unset the former first.

  4. Close any running Antigravity CLI process, make sure the environment variables are loaded, and start it again.

    cmd
    cd your-project-folder
    agy

List the available models, then start the interactive CLI:

bash
agy models
agy

If the CLI still opens Google sign-in, check the settings.json path and the spelling of modelProvider, then fully quit and restart the CLI.