A suite of safe, offline utility scripts to maintain and fix Google DeepMind's Antigravity desktop coding assistant.
-
One-Click Startup Launcher (
launch.bat/launch_antigravity.py): Recommended daily usage. Automatically runs the workspace deduplicator (to clean up configurations from your last session), checks for new terminal CLI chats, copies them into your GUI client directory, resets data migration flags to trigger imports, and then opens the Antigravity GUI application. -
Workspace Deduplicator (
clean_antigravity.py): Resolves the issue where version upgrades split old conversations into standalone projects (e.g.project 2,project 3). Safely consolidates duplicate configurations and maps conversation history to their primary project ID in the database (agyhub_summaries_proto.pb) without loss of history. -
Black Screen Patcher (
patch_blackscreen.py): Diagnoses and patches the application when stuck on a black/loading screen due to transient network changes (ERR_NETWORK_CHANGED) or local loopback self-signed SSL/TLS verification issues (ERR_CERT_AUTHORITY_INVALID). It extractsapp.asar, injects retry and cert bypass logic, and repackages it. -
CLI/GUI History Syncer (
sync_history.py): Manual tool. Copies conversation history logs from your terminal-based CLI configuration (antigravity-cli) into your GUI app directory and resets migration flags inantigravity_state.pbtxtto force the GUI to register and import CLI chats. -
Start Menu Shortcut Creator (
create_shortcut.py): Windows-only utility. Automatically creates or updates the Windows Start Menu Programs shortcut to point tolaunch.bat(our launcher), making it easy to start the automated sync flow.
The automated launcher (launch_antigravity.py / launch.vbs) automatically detects if a Clash proxy is running on local port 7890.
- GUI Application: If Clash is detected, the launcher automatically configures
HTTP_PROXY,HTTPS_PROXY, andALL_PROXYenvironment variables and starts the Electron GUI with the--proxy-serverargument. This routes both the GUI client and its background Language Server (which communicates with Google's API endpoints) through Clash. No TUN mode is required. - CLI Application: If you are using the CLI (
agycommand), you can manually set the proxy environment variables in your active shell before running commands:- Command Prompt (CMD):
set HTTP_PROXY=http://127.0.0.1:7890 set HTTPS_PROXY=http://127.0.0.1:7890 set ALL_PROXY=socks5://127.0.0.1:7890
- PowerShell:
$env:HTTP_PROXY="http://127.0.0.1:7890" $env:HTTPS_PROXY="http://127.0.0.1:7890" $env:ALL_PROXY="socks5://127.0.0.1:7890"
- Command Prompt (CMD):
Instead of launching the GUI application directly, double-click launch.bat (Windows) or run the Python launcher:
python launch_antigravity.pyThis automatically handles database cleanup, stages any new CLI files for importing, and starts the GUI client.
Close the Antigravity desktop app, then:
# Patch the client (requires node/npx installed)
python patch_blackscreen.py patch
# Revert to original backed-up state if needed
python patch_blackscreen.py restorepython create_shortcut.pypython clean_antigravity.py用于维护和修复 Google DeepMind Antigravity 桌面端编程助手的一系列安全、离线的实用脚本工具包。
-
一键智能启动器 (
launch.bat/launch_antigravity.py): 推荐日常使用。启动时自动运行重复项目清理脚本(解决上一次运行产生的文件碎片),检测并同步来自终端 CLI 的最新对话,重置迁移标志以引导客户端自动导入,随后拉起桌面端 GUI 客户端。 -
重复项目清理与合并 (
clean_antigravity.py): 解决版本升级后,旧对话被拆分为独立项目(例如产生my-project 2、my-project 3)的问题。在二进制层面对数据库(agyhub_summaries_proto.pb)重新映射,把所有对话关联到唯一主项目下,并删除冗余的 JSON 文件,确保不丢失历史记录。 -
黑屏/加载卡死修复 (
patch_blackscreen.py): 解决客户端由于网络状态变动(ERR_NETWORK_CHANGED)或本地环回自签名证书 SSL 校验失败(ERR_CERT_AUTHORITY_INVALID)导致启动卡在黑屏或加载界面的问题。通过解包app.asar并向utils.js/languageServer.js注入重试及证书信任逻辑后重新打包。 -
CLI/GUI 历史对话同步 (
sync_history.py): 手动同步工具。将终端 CLI 版(antigravity-cli)的聊天历史记录同步复制到桌面端(antigravity)中,并重置antigravity_state.pbtxt中的数据迁移状态,强制桌面客户端在下次启动时对这部分 CLI 对话进行读取和导入。 -
开始菜单快捷方式生成器 (
create_shortcut.py): Windows 专用小工具。自动在 Windows 「开始菜单」的程序列表中创建或更新指向launch.bat的快捷方式,便于直接搜索启动。
一键启动器 (launch_antigravity.py 或通过桌面/开始菜单快捷方式运行 launch.vbs) 会在启动时自动检测本地 7890 端口(Clash 默认混合端口)是否处于监听状态:
- GUI 客户端:若检测到 Clash 处于运行状态,启动器将自动注入
HTTP_PROXY、HTTPS_PROXY和ALL_PROXY环境变量,并通过--proxy-server参数拉起 Electron 客户端。这使得 GUI 客户端以及后台的核心语言服务(Language Server,用于连接 Google API 服务端)的全部网络请求都直接走 Clash 代理,彻底摆脱了必须开启 TUN 模式的限制。 - CLI 终端工具:如果您使用的是终端 CLI 工具 (
agy命令行),可以在当前命令行会话中手动设置代理环境变量以走 Clash 代理:- 命令提示符 (CMD):
set HTTP_PROXY=http://127.0.0.1:7890 set HTTPS_PROXY=http://127.0.0.1:7890 set ALL_PROXY=socks5://127.0.0.1:7890
- PowerShell:
$env:HTTP_PROXY="http://127.0.0.1:7890" $env:HTTPS_PROXY="http://127.0.0.1:7890" $env:ALL_PROXY="socks5://127.0.0.1:7890"
- 命令提示符 (CMD):
日常使用时,无需直接运行 Antigravity,只需双击运行目录下的 launch.bat (Windows) 或通过终端运行启动器:
python launch_antigravity.py它会在后台完成项目去重、CLI 对话的复制与预准备工作,并安全地拉起 GUI 桌面客户端。
确保完全关闭客户端后,执行:
# 运行补丁(需要系统已安装 Node.js/npx)
python patch_blackscreen.py patch
# 如需从备份还原:
python patch_blackscreen.py restorepython create_shortcut.pypython clean_antigravity.pyMIT License