Skip to main content

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.

Saved profiles are unencrypted files, protected only by their permissions (0700/0600), even when agy itself uses the keyring.

Requirements

  • Linux or macOS
  • Python 3.12 or newer
  • pipx
  • Antigravity CLI (agy) installed and on your PATH

Installation

pipx install agy-switch

This installs the agy-switch command into ~/.local/bin. 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

  • agy refreshes its token on its own. Before switching accounts, agy-switch saves 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-switch saves a backup to ~/.agy-switch/backups/ (keeps the 10 most recent).
  • Close any running agy sessions before switching accounts.
  • On macOS, only the file is supported. A login that agy keeps in the Keychain isn't detected.
  • Environment variables: AGY_HOME (default ~/.gemini/antigravity-cli) and AGY_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.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agy-switch 0.1.0
File Size Uploaded Provenance Actions
agy_switch-0.1.0.tar.gz 7.4 kB Without provenance Details for agy_switch-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agy-switch 0.1.0
File Interpreter ABI Platform Actions
agy_switch-0.1.0-py3-none-any.whl Python 3 none any Details for agy_switch-0.1.0-py3-none-any.whl

Total release size: 15.6 kB

Release files / agy_switch-0.1.0.tar.gz

Download URL agy_switch-0.1.0.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
876eacf350ffc5d2df606e550d8d146cb38b6649a2f13808c09c552bfb0c256a
BLAKE2b-256 checksum
How to use checksums
d24c983fd5ac65bc9fe1639a16a5e11e130049d195596b7405fb7d6f5a4cf6df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / agy_switch-0.1.0-py3-none-any.whl

Download URL agy_switch-0.1.0-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
260f53f3fe17f90ae3c342ac6ce8e474cd00c576c0ae672fc52b198613c551de
BLAKE2b-256 checksum
How to use checksums
d1897519d36baf737fa35aaf4a6203796bfbde84fbf4fe0eb77a4f86b75e0574
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for agy-switch 0.1.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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page