Antigravity CLI: Switch or Change Accounts
Save the currently active Antigravity CLI login with `aisw add antigravity <profile> --from-live`, then switch to it with `aisw use antigravity <profile>`. AI Switcher applies the saved account to Antigravity CLI's live local state and records which profile is active. Start a new `agy` session after each switch.
Antigravity CLI (agy) keeps one live account at a time. If you have separate work, personal, or client logins, signing out and back in by hand makes it easy to start agy under the wrong identity. aisw works as an Antigravity CLI account switcher: each login becomes a named local profile, and switching is one command you can verify.
Before you start
Install aisw and make sure Antigravity CLI is signed in to the account you want to save first. The profiles stay on your machine. aisw does not create Antigravity accounts, proxy agent traffic, or replace Antigravity’s own sign-in.
CLI method
1. Save the account that is currently active.
aisw add antigravity work --from-liveReplace work with a label such as personal. If nothing is signed in, aisw stops instead of saving an empty profile:
no live Antigravity credentials found — run 'agy' and sign in first, then retry 'aisw add antigravity work --from-live'.2. Add another account.
Use Antigravity CLI’s own sign-in flow, then capture the new live account:
aisw add antigravity personal --from-liveaisw list antigravityYou can also let aisw run the sign-in. aisw add antigravity personal without --from-live launches agy, waits up to three minutes for the login to finish, saves the new state, and then puts your previous live account back unless you pass --set-active. If agy was already signed in to that account, nothing changes and aisw tells you to use --from-live instead.
3. Switch accounts.
aisw use antigravity personalCheck the result, then start a new process:
aisw status --tool antigravityaisw verifyagyHow Antigravity CLI switching works
Claude Code and Codex CLI have a config directory per profile. Antigravity CLI does not document one, so aisw switches shared live state. On every aisw use antigravity <profile> for a signed-in account it restores:
- the OS keyring entry Antigravity reads its login from (service
gemini, accountantigravity): macOS Keychain, Linux Secret Service, or Windows Credential Manager ~/.gemini/antigravity-cli/and~/.gemini/config/
The switch output says this directly:
Antigravity switching restores the shared live OS keyring credential and the documented ~/.gemini config roots for this profile.Upstream does not currently document an isolated per-profile auth root or profile selector for Antigravity.Two consequences follow. First, there is no --state-mode for Antigravity; aisw rejects it. Second, a running agy process keeps the account it started with. Switching changes what the next agy reads, so restart after every switch.
Use two Antigravity CLI accounts on one machine
You can keep several logins saved, but only one is live. Switch before you start each session instead of trying to run two accounts side by side:
aisw use antigravity workaisw verifyagy
aisw use antigravity personalaisw verifyagyIf the split is mainly work and personal, the work and personal Antigravity accounts guide covers that setup and binds the personal account to your own repositories.
API-key profiles use GEMINI_API_KEY
Antigravity CLI can also run on a Gemini API key. aisw stores the key as a profile, but agy reads it from the GEMINI_API_KEY environment variable, which a separate aisw process cannot set in your shell.
aisw add antigravity work-api-key --api-key "$GEMINI_API_KEY"Added profile Tool : Antigravity CLI Profile : work-api-key Auth : api_key Antigravity auth: api_key_environment
Effects Antigravity API-key auth uses GEMINI_API_KEY; use the shell hook or --emit-env when running agy.aisw use antigravity work-api-key sets "modelProvider": "gemini" in ~/.gemini/antigravity-cli/settings.json. To put the key into your shell, install the aisw shell hook, which runs the switch with --emit-env for you, or apply it yourself:
eval "$(aisw use antigravity work-api-key --emit-env)"Without either, aisw verify fails for that profile and tells you what to run:
Antigravity CLI Status : fail Active : work-api-key live tool credentials do not match the recorded active profileFix Run 'aisw use agy work-api-key --emit-env' through the aisw shell hook so GEMINI_API_KEY reaches agyThe hint names the tool by its binary, agy, but aisw use takes the tool name antigravity, so the command to run is aisw use antigravity work-api-key --emit-env.
Desktop method
Open AI Switcher Desktop, find the Antigravity CLI column, and select Add from live for the account currently signed in. After saving more than one profile, choose Activate on the profile you need. The app shows the active and live-match state so you can verify the switch visually. Use the CLI when the switch belongs in shell hooks or scripts; both use the same local profiles.
Keep the right account with a repository
If an account belongs to a client repository, put it in a context and bind that context to the repository. Here client-acme stands for one client’s Antigravity profile:
aisw context create client-acme --antigravity client-acmeaisw workspace bind . --context client-acmeaisw workspace guard --mode strictWith the shell hook installed, strict mode blocks agy when the active account does not match the repository binding. Prevent the wrong account in a repository explains warn and strict mode, and switch all four tools together shows the same context switching Claude Code, Codex CLI and Gemini CLI at once.
Common issue: the live account does not match
Run aisw verify and read the Antigravity CLI block. For a signed-in account, run aisw use antigravity <profile> to restore the saved keyring entry and config roots. For an API-key profile, use the shell hook or the --emit-env command shown above.
If you signed in to a different account directly in agy, the live state now belongs to that account. Save it under its own name with aisw add antigravity <profile> --from-live, or refresh a saved profile by signing in again through Antigravity’s own flow. aisw fails explicitly when it cannot read the live keyring entry instead of silently creating a profile with unknown credentials.
Frequently asked questions
I moved from Gemini CLI to Antigravity CLI. How do I save my agy account?
Antigravity CLI accounts are saved separately from Gemini CLI accounts. Sign in with agy, then save that login with aisw add antigravity <profile> --from-live. Your Gemini CLI profiles are not changed.
Does this work with the agy command?
Yes. agy is the Antigravity CLI binary, so an agy account switcher and an Antigravity CLI account switcher are the same thing here. aisw switches the account agy uses, and with the shell hook installed the workspace guard checks the active account each time you start agy in a bound repository.
Can I switch Antigravity CLI accounts on Windows?
Yes. aisw supports Antigravity CLI on Windows, macOS and Linux. Save each account with aisw add antigravity <profile> --from-live, then switch with aisw use antigravity <profile> from PowerShell or any terminal.
How do I change the account Antigravity CLI uses?
Save the account you are signed in to with aisw add antigravity <profile> --from-live, sign in to the other account through Antigravity CLI's own sign-in flow and save it the same way, then run aisw use antigravity <profile> whenever you want to change. Start a new agy session after switching.
Can I switch Antigravity CLI accounts without signing in every time?
Yes. Capture each account as a named local aisw profile, then activate the profile you need. You only need to use the provider's native sign-in flow when adding or refreshing an account.
Can I use two Antigravity CLI accounts on one machine?
Yes, as saved profiles you switch between. You cannot run both at the same time: Antigravity CLI keeps one live credential in a shared OS keyring entry, so aisw applies one profile at a time and the next agy process uses it.
Does Antigravity CLI use isolated profiles?
No. Upstream does not document an isolated per-profile auth root or profile selector, so aisw supports Antigravity CLI through shared-state switching. It keeps each saved profile separately and restores one into the live keyring entry and ~/.gemini config roots at a time. --state-mode is rejected for Antigravity.
Does switching Antigravity CLI accounts bypass provider limits?
No. aisw manages which local account is active. It does not track usage, rotate accounts, or bypass authentication, quotas, or provider terms.