Account Switcher for Antigravity
English · 中文
English
Save several Google Antigravity (agy) accounts on Windows, switch between them in one click, and see the Gemini / Claude quota of each account in the sidebar.
Unofficial community extension. Not affiliated with, endorsed by or supported by Google.
Features
1. Save and switch accounts
- The account you are signed in with is saved automatically (can be turned off). Click + Add account at the top of the panel to add another account: Google sign-in opens in your browser, and the account is saved once you finish.
- Click Use on an account card, or the account name in the status bar, to switch the account agy uses in the editor. Only this window's agy backend is restarted; VS Code itself keeps running.
- Credentials stay on your machine, encrypted with Windows DPAPI for your Windows user. Nothing is uploaded anywhere.
2. Quota panel
- One card per account, with the limits split into two framed groups, each with its own icon:
- Gemini: 5-hour window and 7-day window;
- Claude: 5-hour window and 7-day window.
- One line per window: progress bar, percentage used, and time until reset (e.g.
4h12m, 5d3h). Hover to see the exact reset time.
- Bars are colour-coded: green = plenty left, amber = running low, red = used up. When a window has passed its reset time, the row shows
reset.
- The large number in the card's corner is the highest usage among that account's windows, so nearly exhausted accounts stand out.
- Quota is read from the agy running in the editor, so it is live for the active account. Other accounts show their last reading, taken while they were active, with its age (e.g.
3 h ago); switch to an account to update it.
3. Account health check
- Click ↻ on a card, or ↻ Check all at the top: the quota is refreshed and, at the same time, the account's own agy is asked for a one-word reply in the background to check that the account works (about 15 s, uses a tiny bit of quota). It runs hidden; no window pops up.
- Results appear as tags: ✓ OK, Verification needed (with a Verify button that opens Google's verification page), Region unavailable, Not signed in, and so on.
4. Automatic refresh
- The active account is synced when the panel opens and when the window regains focus, and its quota is refreshed periodically (every 60 minutes by default).
Getting started
- Click the extension icon in the Activity Bar to open the Accounts panel.
- The signed-in account appears automatically; click + Add account to add more.
- Use switches accounts; ↻ checks one account (quota + test).
- Each card also has ✎ Rename and 🗑 Remove (removes it from the list only; it does not sign the Google account out).
Settings
| Setting |
Default |
Description |
agyAccounts.afterSwitch |
restartBackend |
After switching: restartBackend restarts only this window's agy backend; reloadWindow reloads the window; none only writes the credential. |
agyAccounts.autoSaveLive |
true |
Automatically save the signed-in account if it is not saved yet. |
agyAccounts.refreshMinutes |
60 |
Refresh the quota every N minutes; 0 turns it off. |
agyAccounts.loginMethod |
terminal |
How new accounts sign in; keep the default unless troubleshooting. |
agyAccounts.statusFile |
empty (off) |
Optional path of a token-free JSON snapshot of every account's quota, for your own scripts. |
Commands
Type Account Switcher in the Command Palette (Ctrl+Shift+P): save current account, switch account, add account, refresh, show log.
Requirements
- Windows 10 / 11 with the Antigravity command line (
agy, installed at %USERPROFILE%\.gemini\bin\agy.exe) able to sign in.
- VS Code 1.85 or later (or an editor based on it).
How it works and what to know
- Switching writes the chosen account's saved credential into the Windows Credential Manager entry that agy reads, then restarts this window's agy backend.
- Adding an account runs the bundled
tools/agy-use.ps1 -Add, which uses agy's own sign-in in a separate, isolated home folder (%LOCALAPPDATA%\agy-accounts\homes\<email>), so your current account is not touched.
- Health check runs
agy -p "Reply with exactly one word: ok" in that account's isolated folder.
- Account data is stored in
%LOCALAPPDATA%\agy-accounts\. Removing the extension does not delete it; delete the folder yourself if you want it gone.
- This extension relies on how agy stores credentials and reports quota locally. These are not public interfaces; a future agy update may change them and break parts of the extension.
- Please follow Google's and Antigravity's terms of service. Use only accounts that belong to you, and do not use this extension to get around usage limits.
- Provided "as is" under the MIT License, without warranty. If something goes wrong, run Account Switcher: Show log first.
中文说明
在 Windows 上保存多个 Google Antigravity(agy)账号,一键切换,并在侧边栏查看各账号的 Gemini / Claude 额度。
非官方社区插件,与 Google 无关联,未获 Google 认可或支持。
主要功能
1. 账号保存与切换
- 当前登录的账号会自动保存(可在设置里关闭);点面板顶部的 + Add account 可添加新账号:浏览器会打开 Google 登录页,登录完成后自动保存。
- 点击账号卡片上的 Use,或点状态栏上的账号名,即可切换编辑器里 agy 使用的账号。切换后只重启本窗口的 agy 后台,不用重开 VS Code。
- 账号凭据只保存在本机,用当前 Windows 用户的 DPAPI 加密,不上传到任何地方。
2. 额度面板
- 每个账号一张卡片,按模型分成两组,各带图标和色框:
- Gemini:5 小时窗口、7 天窗口;
- Claude:5 小时窗口、7 天窗口。
- 每个窗口一行:进度条、已用百分比、距离重置的时间(如
4h12m、5d3h);鼠标悬停可看完整的重置时刻。
- 进度条按剩余量变色:绿色充足、黄色偏少、红色用完。窗口已到重置时间时显示
reset。
- 卡片右上角的大数字是该账号几个窗口里用得最多的那个百分比,方便一眼找出快用完的号。
- 额度从编辑器里运行的 agy 读取,所以当前账号是实时的;其他账号显示它上次作为当前账号时的读数,并标明是多久以前(如
3 h ago),切换过去即可更新。
3. 账号可用性测试
- 点卡片上的 ↻,或顶部的 ↻ Check all:刷新额度的同时,让该账号自己的 agy 在后台回答一句话,判断账号是否正常可用(约 15 秒,消耗极少额度)。测试在后台进行,不弹出任何窗口。
- 结果以标签显示:✓ OK(可用)、Verification needed(需验证账号,附 Verify 按钮直接打开 Google 的验证页)、Region unavailable(地区不可用)、Not signed in(未登录)等。
4. 自动刷新
- 打开面板、切回窗口时自动同步当前账号,并定期刷新它的额度(默认每 60 分钟)。
使用方法
- 在左侧活动栏点击插件图标,打开 Accounts 面板。
- 已登录的账号会自动出现在列表里;点 + Add account 添加更多账号。
- 点 Use 切换账号,点 ↻ 检查单个账号(刷新额度 + 测试)。
- 卡片底部还有 ✎(重命名)、🗑(从列表移除,不会退出 Google 账号)。
设置项
| 设置 |
默认值 |
说明 |
agyAccounts.afterSwitch |
restartBackend |
切换后做什么:restartBackend 只重启本窗口的 agy 后台;reloadWindow 重新加载窗口;none 只写入凭据。 |
agyAccounts.autoSaveLive |
true |
自动保存当前登录、但还没保存的账号。 |
agyAccounts.refreshMinutes |
60 |
每隔多少分钟自动刷新额度;0 为关闭。 |
agyAccounts.loginMethod |
terminal |
添加账号的登录方式,一般保持默认。 |
agyAccounts.statusFile |
空(关闭) |
可选:把各账号额度(不含令牌)写成 JSON 文件,供自己的脚本读取。 |
命令
在命令面板(Ctrl+Shift+P)里输入 Account Switcher:保存当前账号、切换账号、添加账号、刷新、查看日志(Show log)。
运行要求
- Windows 10 / 11,已安装 Antigravity 命令行(
agy,位于 %USERPROFILE%\.gemini\bin\agy.exe),能正常登录。
- VS Code 1.85 及以上(或基于它的编辑器)。
工作原理与注意事项
- 切换:把所选账号保存的凭据写入 agy 读取的 Windows 凭据管理器条目,然后重启本窗口的 agy 后台。
- 添加账号:运行插件自带的
tools/agy-use.ps1 -Add,在单独的隔离目录(%LOCALAPPDATA%\agy-accounts\homes\<邮箱>)里用 agy 自己的登录流程,不影响当前账号。
- 可用性测试:在该账号的隔离目录里运行
agy -p "Reply with exactly one word: ok"。
- 账号数据保存在
%LOCALAPPDATA%\agy-accounts\。卸载插件不会删除这些数据,如需清除请手动删除该文件夹。
- 插件依赖 agy 在本机保存凭据和报告额度的方式,这些都不是公开接口,agy 今后更新可能导致部分功能失效。
- 请遵守 Google 和 Antigravity 的服务条款:只使用属于你自己的账号,不要用本插件规避使用限制。
- 本插件按 MIT 许可证“按原样”提供,不作任何担保。出现问题时,先运行 Account Switcher: Show log 查看日志。
| |