Skip to content

Antigravity CLI 快速入门 (Getting Started)

安装 (Installation)

Mac / 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

身份验证 (Authentication)

Antigravity CLI 会尝试使用您操作系统的安全钥匙串(keyring)对您进行静默验证。如果未找到已保存的会话,它将回退到基于浏览器的 Google 登录。

  • 本地机器:CLI 会自动在您的默认浏览器中打开 Google 登录页面。
  • 远程 / SSH 会话:CLI 会检测到您处于 SSH 会话中,并打印出一个安全的授权 URL。将此 URL 复制到本地浏览器中以登录,然后将生成的授权码粘贴回 CLI 提示符中。
  • 注销登录:要终止您的会话并移除已保存的凭据,请运行命令 /logout

要在登录时使用您的企业凭据,请在新手引导过程中连接您的 GCP 项目。有关详细信息,请访问 企业版文档页面 (Enterprise Documentation Page)

Gemini中文文档