agy-switch
Switch between multiple Antigravity CLI (agy) accounts.
On Linux, agy stores its login in the system keyring (GNOME Keyring, KWallet or another
Secret Service provider). If no keyring is available, it uses
~/.gemini/antigravity-cli/antigravity-oauth-token instead. agy-switch keeps a copy of the
login for each profile in ~/.agy-switch/profiles/<name>/ and puts the right one back in
place when you switch accounts.
On Windows, agy stores its login in the Windows Credential Manager (a generic credential
named gemini:antigravity), and agy-switch reads and writes it there.
Saved profiles are unencrypted files, protected only by their permissions (0700/0600), even
when agy itself uses the keyring.
Requirements
- Linux, macOS or Windows
- Python 3.12 or newer
- pipx
- Antigravity CLI (
agy) installed and on yourPATH
Installation
pipx install agy-switch
This installs the agy-switch command into ~/.local/bin (%USERPROFILE%\.local\bin on
Windows). If the shell can't find it, add that directory to your PATH:
pipx ensurepath # then open a new terminal
If your default Python is older than 3.12, point pipx to a newer one:
pipx install --python python3.12 agy-switch
Check the installation:
agy-switch --version
To update:
pipx upgrade agy-switch
To uninstall:
pipx uninstall agy-switch
Saved profiles in ~/.agy-switch are not removed. Delete that directory if you don't need them.
Usage
# 1. With agy logged in to your personal account:
agy-switch add personal
# 2. Add another account (logs out, opens agy so you can sign in, then saves it):
agy-switch add work --login
agy-switch list # * marks the active profile
agy-switch use personal
agy-switch use work
agy-switch current
agy-switch remove personal # asks for confirmation (-y to skip)
| Command | Description |
|---|---|
add NAME [--login] [--force] |
Save the current agy login as a profile. --login signs in to a new account first. --force overwrites an existing profile. |
list (ls) |
List profiles and their emails. |
use NAME (switch) |
Switch agy to the given profile. |
current |
Show the active profile and warn if agy is logged in to a different account. |
remove NAME [-y] (rm) |
Delete a saved profile. |
Details
agyrefreshes its token on its own. Before switching accounts,agy-switchsaves the current token back into the active profile, as long as the email still matches. This keeps profiles from holding an expired token.- Before overwriting the login,
agy-switchsaves a backup to~/.agy-switch/backups/(keeps the 10 most recent). - Close any running
agysessions before switching accounts. - On macOS, only the file is supported. A login that
agykeeps in the Keychain isn't detected. - On Windows,
~means your user folder (%USERPROFILE%), so profiles live in%USERPROFILE%\.agy-switch. File permissions are not enforced there; the profiles are protected only by your user account's folder permissions. - Environment variables:
AGY_HOME(default~/.gemini/antigravity-cli) andAGY_SWITCH_HOME(default~/.agy-switch).
Development
Run from a clone with uv:
uv run agy-switch --help
To publish a release, set the new version, then build and upload it:
uv version --bump patch # or minor / major
rm -rf dist
uv build
uv publish # needs a PyPI token in UV_PUBLISH_TOKEN
Metadata
Release files for agy-switch 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agy_switch-0.2.0.tar.gz | 8.9 kB | Without provenance | Details for agy_switch-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agy_switch-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for agy_switch-0.2.0-py3-none-any.whl |
Total release size: 18.5 kB
Release files / agy_switch-0.2.0.tar.gz
| Download URL | agy_switch-0.2.0.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9f6fade0fbb67e2e76db85f17a525b2b49693aebff8a9a19554069d5d15292c6
|
|
BLAKE2b-256 checksum How to use checksums |
36c913e8f628a34a4131fafe86629e737f499d38c5cd048d7245e9410d02c623
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / agy_switch-0.2.0-py3-none-any.whl
| Download URL | agy_switch-0.2.0-py3-none-any.whl |
|---|---|
| Size | 9.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3ca0a41b9d2f3899f96f9d534d3ac8eb2559296daa3abef66189ed76b5ebdf7d
|
|
BLAKE2b-256 checksum How to use checksums |
8523549caa492d5b7a963577080cb2410fd1fb3db9538670c85c278b8035784b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for agy-switch 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.