Skip to main content

Switch between multiple Antigravity CLI accounts, with a quota dashboard for every account.

author-name project-version pypi-version build-status

Description

agyswap switches the Google account used by the Antigravity CLI (agy) without signing in again, and shows the quota left on every account. It does not work with the Antigravity IDE, Gemini CLI, or other Google AI products.

agy keeps its login in the OS keyring as a single OAuth token. agyswap stores a copy of each account's token, and switching writes another account's copy back to the keyring. The next agy you start runs as that account.

Inspired by claude-swap.

Status

Usable on Linux. Adding accounts, switching between them, the quota list, and the interactive dashboard all work, and switching between two real accounts without signing in again has been verified.

Not built yet: automatic switching when an account runs low, parallel sessions with different accounts, aliases, enable/disable, export/import, and macOS/Windows keyrings. TODO.md lists every open item.

Techstacks

Python 3.12+ managed with uv. The dashboard uses Textual and Rich; everything else is the standard library, plus secret-tool (libsecret) for the keyring.

Installation

$ uv tool install agyswap-cli    # or: pipx install agyswap-cli / pip install agyswap-cli
$ agyswap --help                 # the command is still agyswap

Until the first release is on PyPI, install from GitHub instead:

$ uv tool install git+https://github.com/rasvanjaya21/agyswap

agyswap needs Linux with a Secret Service keyring (GNOME Keyring or KWallet) and secret-tool (dnf install libsecret or apt install libsecret-tools).

Configuration

Variable What it does
AGYSWAP_HOME Where agyswap keeps its account store. Defaults to ~/.agyswap. The store, accounts.json, holds refresh tokens and is written with mode 0600.

Usage

Unlike Claude Code, agy has no account picker. To add an account, sign out of agy, sign in with that account, then store it:

$ agy             # /logout, then sign in with account A, then exit
$ agyswap add
$ agy             # /logout, then sign in with account B, then exit
$ agyswap add

Signing out of agy does not revoke the token agyswap already stored.

Run agyswap on its own (or agyswap tui) for the dashboard. It shows every account's quota for both model groups (Gemini, and Claude/GPT), each with its 5-hour and weekly window and reset times, and marks the active account. Usage refreshes every 2 minutes.

Key Action
enter / s Switch to the highlighted account
a Add the account agy is signed in with
d Remove the highlighted account
r Refresh usage
j / k Move
q Quit

The same actions are available as commands:

$ agyswap switch                  # rotate to the next account
$ agyswap switch 2                # by slot
$ agyswap switch user@gmail.com   # by email
$ agyswap list                    # quota of every account
$ agyswap status
$ agyswap remove 2                 # asks first; add --yes (-y) in scripts

Exit agy before you switch. A running agy reads the keyring only when it starts and saves its own token back every hour, which would undo the switch. agyswap switch refuses while agy is running; --ignore-running overrides that. --force switches without first copying the live login's token back into its slot.

Development

$ git clone https://github.com/rasvanjaya21/agyswap && cd agyswap
$ uv sync          # creates .venv with agyswap installed in editable mode
$ uv run agyswap

For a manual run against your real agy login, use a throwaway store and shred it afterwards:

$ export AGYSWAP_HOME=$(mktemp -d)
$ uv run agyswap add && uv run agyswap list
$ shred -u "$AGYSWAP_HOME/accounts.json"

Testing

$ uv run ruff format .    # formatter
$ uv run ruff check .     # linter
$ uv run pytest -q        # tests
$ uv build                # wheel and sdist into dist/

Tests never touch the real keyring, the network, or ~/.agyswap/. The keyring, the store, and every Google request are faked.

Deployment

Releases are published to PyPI by .github/workflows/publish.yml when a v* tag is pushed. The version lives only in pyproject.toml.

$ uv version --bump patch
$ uv lock
$ git commit -am "chore: release v$(uv version --short)"
$ git push                                  # wait for CI to pass
$ git tag "v$(uv version --short)" && git push origin "v$(uv version --short)"

A published version cannot be replaced. To roll back, yank it on PyPI and release a patch. The one-time PyPI and GitHub setup is in CONTRIBUTING.md.

Architecture

Design decisions and the reasoning behind them live in architecture/, one file per workflow that produced it. OBSERVE.md maps how agy stores its login and reports quota, with the evidence for each fact; SPEC.md specifies the current version; PLAN.md lays out the next tasks; REVIEW.md holds the latest code review.

AGENTS.md holds the conventions and the development cycle, and is the single channel shared by every agent working here. TODO.md holds open findings and is deleted entry by entry as they are resolved.

Credit

Member

  • @rasvanjaya21 [assigned]

Metadata

Release files for agyswap-cli 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 agyswap-cli 0.1.0
File Size Uploaded Provenance
agyswap_cli-0.1.0.tar.gz 23.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for agyswap-cli 0.1.0
File Interpreter ABI Platform
agyswap_cli-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 38.8 kB

Release files / agyswap_cli-0.1.0.tar.gz

Download URL agyswap_cli-0.1.0.tar.gz
Size 23.4 kB
Tags Source
SHA-256 checksum
How to use checksums
fe5c141f49e2e2500908aa97ec528d5be5676adeaf69853296ac8dcb4d5b18fe
BLAKE2b-256 checksum
How to use checksums
1eb142a7877103dae7fc96992cf6e4f2f5433b33988865b5059b717a91602cec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

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

Download URL agyswap_cli-0.1.0-py3-none-any.whl
Size 15.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd4c636f9d3d2f703d1b115756b871a1e6254743814eda87df5cec387c60e2df
BLAKE2b-256 checksum
How to use checksums
5fc59c667da1a3802270eeadb9becee097031a8639761174ae4c7eeaea5e9144
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Security for agyswap-cli 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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for agyswap_cli-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

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.

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