Skip to content

Menu

Antigravity

Install and sign in to a CLI

Choose the correct account path, install Antigravity CLI, sign in, and complete a minimal read-only check.

min read
14
Level
Intermediate
Last verified

This page helps you produce an auditable result: you will know which CLI to install, record its source and version, and complete a test in an empty directory without modifying files. Do not begin by copying a gemini command from an old tutorial; account paths have diverged.

As of November 24, 2026, Google’s migration announcement and deprecation notice state that, beginning June 18, 2026, Gemini CLI no longer serves requests for Gemini Code Assist for individuals or Google AI Pro and Ultra accounts. Affected users should migrate to Antigravity CLI, while Gemini Code Assist Standard and Enterprise follow a separate phaseout schedule.

Your situation Current starting point
Personal Google Account Antigravity CLI, invoked with agy
Gemini Code Assist Standard or Enterprise Continue using Gemini CLI according to your organization’s documentation, or have an administrator evaluate Antigravity CLI
Enterprise Google Cloud project Ask an administrator to confirm the project, region, license, and identity method first
Browserless automation environment Evaluate a Gemini API Key or Application Default Credentials (ADC); do not reuse a personal sign-in cache

If you are unsure which account type applies, first read CLI overview. Do not infer organization approval from a successful sign-in.

Minimal installation: record first, then run

Section titled “Minimal installation: record first, then run”

The official site currently provides the following quick-install command for macOS and Linux. On Windows, copy the corresponding PowerShell or CMD command from the official download page. The script can change, so open the URL and review its contents before running it in a trusted terminal.

终端窗口
curl -fsSL https://antigravity.google/cli/install.sh | bash
agy --version

Record the date, operating system, installation-page URL, and actual output of agy --version in the project’s local development notes. Do not copy a version number from this page or the download page; versions change frequently.

If installation finishes but the command cannot be found, the default location in the official documentation is ~/.local/bin/agy. First run:

终端窗口
command -v agy
printf '%s\n' "$PATH"

Only after confirming that the binary actually exists should you add the corresponding directory to PATH as instructed by the installer. Do not repeatedly rerun the installation script to hide a path problem.

Launch the client in a directory that contains no sensitive material:

终端窗口
mkdir -p /tmp/gemini-guidebook-cli-check
cd /tmp/gemini-guidebook-cli-check
agy

When agy starts, it signs in silently if the system keychain already contains a valid session. Otherwise, it opens the default browser on a local machine or displays an authorization URL and one-time code in an SSH environment. Complete authentication only on an official page you opened yourself. Do not paste the code into a chat, ticket, or repository.

A browserless environment can use an API Key, but setting an environment variable alone is not enough. According to the authentication documentation, you must also select the Gemini provider in ~/.gemini/antigravity-cli/settings.json:

{
"modelProvider": "gemini"
}

Then inject the real key represented by this placeholder only into the current shell:

终端窗口
export GEMINI_API_KEY="YOUR_API_KEY"
agy

Do not put a real key in this page, a screenshot of command history, or a repository. Production environments should use an organization-approved secret-management method; see API Key safety.

The starting material is only this synthetic sentence; no files need to be read:

The Blue Harbor project’s release window is Thursday at 14:00; whether a rollback drill is required has not yet been confirmed.

Send this complete prompt in the CLI:

Use only the synthetic text in this message. Do not read files, access the network, or run commands.
Organize the content below into two lines labeled “Known | To confirm”:
The Blue Harbor project's release window is Thursday at 14:00; whether a rollback drill is required has not yet been confirmed.

The expected output should preserve “Thursday at 14:00” and “has not yet been confirmed,” with no tool-execution record. Check these three items:

  • agy --version produces output, and you have recorded the exact text.
  • The interface shows the account or authentication method you expected.
  • The answer neither reads the directory nor modifies files, and it does not turn “has not yet been confirmed” into a definite fact.

“Inspect this project and fix every problem” immediately expands the scope of reading, execution, and writing. Rewrite the first check as: “Classify only the synthetic text in this message; do not call tools.” First prove that authentication and basic responses work, then enter a trusted repository.

Symptom Check first Recovery action
agy: command not found command -v agy, the default installation directory, and PATH Fix PATH as directed by the installer, then reopen the terminal
Browser sign-in loop System time, default browser, and account type Use the official remote authorization flow; organization accounts should contact an administrator
API Key ignored Whether modelProvider is gemini Correct the setting and restart; do not guess several variable names at once
Error appears only on the first request Whether the key was revoked and has access to the target model Check the key in Google AI Studio; do not put it in logs
Signed in to the wrong account Run /logout in the CLI Clear the saved session, then sign in again with the correct account

Installation scripts, authentication methods, and account eligibility can all change. When repeating these steps, defer to the official documentation listed at the top of this page. Next: Read CLI migration guidance first, then configure MCP and plugins if needed.