欢迎使用 Google Antigravity!请参照本指南,在常用开发环境中快速上手。
选择开发环境
下载与安装
-
Download the Google Antigravity installer for your operating system (or view all builds at antigravity.google/download):
macOSmacOS 13 (Ventura) or later (Apple Silicon or 64-bit Intel)Open the downloaded
Antigravity.dmgdisk image and drag Antigravity into your Applications folder. If you are upgrading an existing installation, select Replace when prompted instead of Keep Both.WindowsWindows 10 (64-bit) or Windows 11Run the downloaded
.exeinstaller and follow the guided setup wizard.Linuxglibc >= 2.28, glibcxx >= 3.4.25 (Ubuntu 20+, Debian 10+, Fedora 36+, RHEL 8+)Extract the archive with
tar -xzf Antigravity.tar.gzand launch./Antigravity.GooglebookGooglebook OS (pre-installed on Googlebooks; update or reinstall via Google Play)Google Antigravity comes pre-installed on Googlebooks. Open Google Play to install updates or reinstall the application.
-
Launch Google Antigravity from your applications launcher or menu.
-
登录并选择工作区的设置方式:
-
个人 Google 账号 (
v2.30.0+):通过浏览器登录后,Antigravity 会询问最符合您工作性质的选项——软件工程、知识工作、数据与分析、科研、设计或其他(点击跳过即可以默认的软件工程配置启动):
您的选择将决定初始界面布局(选择知识工作、科学研究、设计和其他时设为知识工作 (Knowledge Work);选择软件工程和数据与分析时设为软件工程 (Software Engineering)),并在您确认条款与数据使用 (Terms & Data Use) 声明后,在主界面消息框上方显示最多三个可关闭的初始提示词:

选择角色时不会直接安装任何插件——点击初始提示词后,系统会在需要时于后台安装与之配对的 Marketplace 插件,预先填入
@<Plugin>和提示词(但不会直接发送),并选中第一个<...>占位符以便你先行编辑(Google Calendar、Drive、Slides 或 Figma 等关联服务会在你运行提示词时提示登录)。选择软件工程 (Software Engineering) 还会包含从其他 Agent 开发工具导入我的配置 (Bring over my setup from other Agentic Developer Tools) 选项,方便你从 Claude Code、Codex、Cursor 和 Gemini CLI 导入 MCP 服务器、skill、规则和指令。你可以随时忽略任何建议,或在设置 > 常规 > 界面布局中切换布局。 -
Gemini Enterprise 与 Google Cloud 账号:在登录时选择 Use Business Account,然后选择为您分配的许可证和 Google Cloud 项目,或者使用您自己的项目按需付费。正在使用 Google Workspace 账号?请参阅 Google Workspace 账号。
-
-
Install the Antigravity CLI (
agy) binary using the automated installer for your operating system:curl -fsSL https://antigravity.google/cli/install.sh | bashDefault binary location:
~/.local/bin/agyirm https://antigravity.google/cli/install.ps1 | iexDefault binary location:
C:\Users\<username>\AppData\Local\agy\bincurl -fsSL https://antigravity.google/cli/install.cmd -o install.cmd && install.cmd && del install.cmdDefault binary location:
C:\Users\<username>\AppData\Local\agy\bin -
Open a terminal window and verify the installation:
agy --version -
Complete the interactive terminal configuration on initial launch:
- Color scheme: Select your visual preference (Dark, Solarized Dark, Solarized Light, or terminal default).
- Rendering mode: Choose Alt-Screen mode (full-screen buffer) or Inline mode (sequential output in terminal history).
- Workspace trust: Confirm that you trust the repository directory before the agent begins file indexing.
-
Install the official Google Antigravity extension for your preferred editor, or download the standalone Antigravity IDE:
Requirements: Visual Studio Code 1.90 or later on macOS, Linux, or Windows.
Open the Extensions sidebar (Cmd + Shift + X on macOS or Ctrl + Shift + X on Windows/Linux), search for Google Antigravity, and click Install. See the VS Code extension guide.
Requirements: Any IntelliJ-based IDE (IntelliJ IDEA, PyCharm, WebStorm, GoLand, CLion, Rider) version 2026.2.1 or later.
Open JetBrains AI > Settings > Agents, search for Antigravity, and click Install. See the IntelliJ-based IDEs guide.
Requirements: An Android Studio release with Bring Your Own Agent (ACP) support.
Open the Agent tool window, click the agent picker at the top of the panel, and choose Google Antigravity (or install it from Settings > Tools > AI > Agents on the Marketplace tab). See the Android Studio guide.
Requirements: Visual Studio 2026 (version 17.8 or higher) on Windows 10/11.
Navigate to Extensions > Manage Extensions, search for Google Antigravity, click Download, and restart Visual Studio to complete the VSIX installation. See the Visual Studio guide.
Requirements: Zed version 0.140.0 or later on macOS or Linux.
Open the Command Palette (Cmd + Shift + P / Ctrl + Shift + P), run
agent: open settings, and navigate to External Agents > Add > Install from Registry to install Antigravity. See the Zed guide.Requirements: Xcode 27 beta 6 or later on macOS.
Open Xcode > Settings (Cmd + ,), select the Intelligence panel, and click Get next to Antigravity. See the Xcode guide.
Requirements: Eclipse 2026-06 or later on macOS, Linux, or Windows.
Select Help > Eclipse Marketplace…, search for Google Antigravity, click Install, and restart Eclipse when prompted. Check out the Eclipse guide.
Requirements: macOS 12 (Monterey)+, Windows 10 (64-bit)+, or Linux / Googlebook (glibc >= 2.28, glibcxx >= 3.4.25).
Download the standalone Antigravity IDE installer for your platform from antigravity.google/download. When a new version is available on macOS or Windows, Antigravity IDE downloads it in the background and prompts you to click Restart to Update (a system-wide Windows installation shows Install Update instead). On Linux, an Update Available button appears in the title bar and a badge appears on your account icon. Click Update Available for instructions: if you installed Antigravity IDE with a package manager such as apt, update it through your system’s update process; if you installed it from the tarball, download the new tarball yourself:

Basic navigation (Editor & Agent panel): The agent runs in the Agent side panel on the right side of the editor. Press Cmd + L (Ctrl + L on Windows/Linux) to move to the panel. From the editor, this also adds the selected lines (or the current line) to your prompt as context. Press Cmd + Shift + L (Ctrl + Shift + L) to start a new conversation. To show or hide the panel, click Toggle Agent in the title bar:

-
在 Antigravity 面板或设置中收到提示时,使用您的个人 Google 账号或 Gemini Enterprise 凭据登录(IDE 扩展程序现已支持企业版功能:VS Code、Visual Studio、JetBrains、Zed、Xcode 和 Eclipse 已正式发布,Android Studio 目前处于预览版阶段)。
-
Install the official Antigravity Python package inside a Python 3.10+ virtual environment:
pip install google-antigravityIf you use Poetry or uv for package management:
# Poetry poetry add google-antigravity # uv uv add google-antigravity -
Authenticate and configure your environment:
Configure your API credentials in your environment before initializing the agent harness:
export GEMINI_API_KEY="your_api_key_here"
启动项目
Agents operate within Projects, which define the repository boundaries, file scopes, and security permissions for your workspaces.
-
Click the New Project icon (folder with a plus sign) in the left sidebar.
-
Click Add Folder to select one or more local Git repositories or working directories.
-
点击 Create(创建)。
-
Type your instruction in the prompt input (for example:
Add unit tests for the authentication handlers) and press Enter. -
在设置弹窗中选择一种模式以启动 Agent(在软件工程界面布局下):
- 本地模式 (Local mode):Agent 直接在你当前活动的文件夹中执行操作。
- 新建工作树模式 (New worktree mode):Agent 在隔离的 Git worktree 中执行操作。
在知识工作界面布局下,对话会直接在项目的文件夹中运行,而不会提示选择 Git worktree;您也可以直接从主页开始对话,无需先创建项目。
Navigate to any codebase directory in your terminal and start a session:
-
Create or navigate to a project directory and launch the TUI:
mkdir agy-demo && cd agy-demo agy -
Enter your first task prompt and press Enter:
编写一个简单的 Python 脚本来获取网页文本Agent 会为工作区建立索引,并在您的工作区中创建
main.py。出现提示时按 Y 批准创建文件(在auto模式下,工作区编辑和沙箱内命令会自动运行)。 -
随时检查差异或审阅产物:
- 运行
/diff打开交互式差异查看器并检查每轮对话所做的更改,或在收到通知时按 Ctrl + R 审阅生成的产物(如实施方案;按 Esc 可返回提示词输入框)。 - 如果您想在
auto、plan、default和accept-edits执行模式之间切换,请在提示词输入框内按 Shift + Tab。
- 运行
-
使用 Agent 执行测试命令以验证输出:
运行该 Python 脚本并向我展示输出结果按 Y 确认并运行
python3 main.py(在auto模式下,Agent 会自动在终端沙箱内运行该命令)。完成后,按 Ctrl + D(或输入/exit)关闭 TUI 会话。
- Open your workspace folder, repository, or solution in your preferred editor.
- Open the Antigravity panel or agent view in your IDE (for example, click the Antigravity icon in the VS Code Activity Bar, press Ctrl + \, Ctrl + Alt + L in Visual Studio, select Antigravity > Toggle Chat in Eclipse, or select Antigravity in JetBrains AI, Zed External Agents, or Xcode Intelligence).
- Enter a task prompt in the conversation panel to start an agent session that shares context and customizations with the rest of the Antigravity ecosystem.
- Inspect interactive implementation plans, review granular inline diffs, and execute multi-step engineering tasks directly inside your editor.
-
Create a file named
hello_agent.pyto instantiate and run an autonomous agent:import asyncio from google.antigravity import Agent, LocalAgentConfig async def main(): # Initialize the local agent harness config = LocalAgentConfig() async with Agent(config) as agent: response = await agent.chat("What files are in the current directory and what is their purpose?") print(await response.text()) if __name__ == "__main__": asyncio.run(main()) -
Execute the agent script in your terminal:
python hello_agent.py -
Configure declarative tool policies:
Use
LocalAgentConfigandgoogle.antigravity.hooks.policyto define explicit tool execution rules:from google.antigravity import LocalAgentConfig from google.antigravity.hooks.policy import allow, deny config = LocalAgentConfig( policies=[ deny("*"), allow("view_file"), ] )
快捷键与命令
导航快捷键
| 操作 | macOS | Windows / Linux | 描述 |
|---|---|---|---|
| Conversation picker | Cmd + K | Ctrl + K | 按标题或全文搜索历史对话并切换到目标对话 |
| File search | Cmd + P | Ctrl + P | 按名称搜索当前项目中的文件并打开目标文件 |
| 命令 | Cmd + Shift + P | Ctrl + Shift + P | 搜索并运行应用命令 |
| Find | Cmd + F | Ctrl + F | 在当前对话或打开的文件中查找文本 |
| 聚焦输入框 | Cmd + L | Ctrl + L | 将光标焦点直接跳转到消息框 |
| 新建对话 | Cmd + N | Ctrl + N | Start a fresh autonomous agent session |
| 上一个或下一个对话 | Option + ↑ / ↓ | Alt + ↑ / ↓ | 切换到侧边栏中的上一个或下一个对话 |
如需详细了解如何搜索对话、文件和命令,请参阅搜索与命令面板。
核心斜杠命令
| 命令 | 描述 |
|---|---|
/goal | Runs the task autonomously until completion without pausing for intermediate input. |
/grill- | Prompts the agent to interview you about requirements before beginning implementation. |
/schedule | Runs an instruction as a one-time delayed task or recurring cron schedule. |
/browser | 将实时 UI 测试、屏幕截图和网页检查委派给浏览器子 Agent(个人账号 v2.30.0+ 使用内置浏览器,或使用 Google Chrome)。 |
/plugin | Manages installed Marketplace plugins or creates and configures custom plugin bundles. |
常用 CLI 命令
| 命令 | 描述 |
|---|---|
agy | Launches the interactive TUI in the current directory. |
agy -i "prompt" | 使用初始提示词启动交互式会话。 |
agy -p "prompt" | 以非交互方式运行单条提示词并输出响应。 |
/agents | Switches between active background subagents. |
/statusline | Toggles or configures the terminal status line display. |
/usage | Displays current model credit consumption and quota limits. |
/exit | Closes the TUI and restores your original shell session. |
键盘快捷键
| 快捷键 | 操作 |
|---|---|
| Ctrl + R | Open the Artifact Review screen to inspect plans and diffs |
| Tab 补全 | Inspect file diffs and tool execution details |
| Ctrl + C | Interrupt current agent generation |
| Ctrl + O | Expand or collapse active tool execution pill |
| Ctrl + D | Exit the active Antigravity CLI session |
| Esc | Exit diff inspector or close active overlay |
编辑器命令与快捷键
| IDE | Shortcut / Command | 操作 |
|---|---|---|
| VS Code | Cmd + Shift + X / Ctrl + Shift + X | Open Extensions sidebar to install or manage Google Antigravity |
| Visual Studio | Ctrl + \, Ctrl + Alt + L | Open the Antigravity tool window |
| Zed | Cmd + Shift + P / Ctrl + Shift + P → agent: open settings | Open Agent settings to configure External Agents |
| JetBrains | JetBrains AI > Settings > Agents | Install or configure the Antigravity agent |
| Xcode | Cmd + , → Intelligence | Manage and authenticate Antigravity in Xcode Settings |
| Eclipse | Cmd + Option + E / Ctrl + Alt + K | 切换 Antigravity 对话视图 |
身份验证配置
Auth type (auth.type) | Account tier | 描述 |
|---|---|---|
"oauth- | Individual Google Accounts | Authenticates personal Free, Pro, and Ultra plans. |
"oauth- | Gemini Enterprise (Preview) | Authenticates corporate identity with gcp.project and gcp.location. |
"gemini- | Gemini API | Authenticates using a Gemini API key. |
"agent- | Agent 平台(预览版) | 通过 API 密钥或 ADC 使用 Gemini Enterprise API 进行身份验证。 |
常用 SDK 方法与配置
| Method / Command | 描述 |
|---|---|
await agent. | Sends a user prompt to the agent and returns the turn response. |
Local | Configures declarative tool execution policies (allow, deny, ask_user). |
Local | Customizes the agent persona and system instructions. |
export GEMINI_ | Sets Gemini API credentials in the environment. |