Skip to content

duongductrong/antigravity-kit

Repository files navigation

Antigravity Tools Logo

Antigravity Kit

A CLI toolkit to manage Google Antigravity IDE authentication profiles. Seamlessly switch between multiple Google accounts without the hassle of signing in and out.

npm version License: MIT

✨ Features

  • πŸ” Multi-account support - Manage multiple Google accounts for Antigravity IDE
  • ⚑ Quick switching - Switch between profiles in seconds
  • πŸ’Ύ Profile backup - Each profile is stored separately with all settings intact
  • πŸ–₯️ Cross-platform - Works on macOS, Linux, and Windows
  • πŸ”‘ OAuth authentication - Secure Google sign-in with automatic token storage
  • πŸ“Š Quota monitoring - Real-time quota tracking with auto-refresh
  • πŸ”’ Keychain storage - Secure token storage in macOS Keychain

πŸ“¦ Installation

# Using npm
npm install -g antigravity-kit

# Using pnpm
pnpm add -g antigravity-kit

# Using yarn
yarn global add antigravity-kit

🎯 Quick Start

# Interactive menu - select from available actions
agk auth

# Or use direct commands:
agk auth add      # Add your first account
agk auth list     # List all profiles
agk auth switch   # Switch to a different profile
agk auth quota    # Monitor quota usage
agk upgrade       # Upgrade to latest version

πŸ“– Commands

The CLI can be invoked using any of these aliases:

  • antigravity-kit
  • antigravikit
  • agk (recommended - shortest)

auth add

Add a new Google Antigravity account profile.

# Default: OAuth sign-in (opens browser)
agk auth add

# Manual: IDE-based login
agk auth add --manual

# Force file storage instead of Keychain
agk auth add --insecure

Options:

Flag Description
--manual Use manual IDE login instead of OAuth (opens Antigravity IDE)
--insecure Store tokens in local file instead of macOS Keychain

How it works:

OAuth Flow (default):

  1. Opens your browser for Google sign-in
  2. Captures authentication and creates a profile
  3. Stores refresh token securely (Keychain on macOS)
  4. Shows available quota for the account

Manual Flow (--manual):

  1. If an existing Antigravity login is detected, you'll be prompted to add it as a profile
  2. If no login exists, Antigravity IDE will open for you to sign in
  3. The CLI watches for authentication and saves your profile automatically

Example output:

β—† Add a new account

This will:
1. Open your browser for Google sign-in
2. Capture your login and create a profile
3. Store tokens for quota checking

πŸ” Tokens will be stored in macOS Keychain

Saving profile...

β”Œ Profile Created ─────────────────────────────┐
β”‚                                              β”‚
β”‚  Email: user@gmail.com                       β”‚
β”‚  Profile: ~/.antigravity-kit/profiles/...   β”‚
β”‚  Status: Active                              β”‚
β”‚  Quota: 5 models available                   β”‚
β”‚                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

βœ” Account user@gmail.com added successfully!

auth list

List all saved Google Antigravity profiles.

agk auth list

Example output:

β—† Saved Profiles

   Email                          OAuth  Storage   Claude            Gemini            Size        Created
──────────────────────────────────────────────────────────────────────────────────────────────────────────────
● user@gmail.com                    βœ“      πŸ”        100%              80% (2h45m)       45.2 MB     Dec 15, 2024
β—‹ work@company.com                  βœ“      πŸ”        β€”                 β€”                 38.7 MB     Dec 10, 2024
β—‹ personal@gmail.com                βœ—      β€”         β€”                 β€”                 42.1 MB     Nov 28, 2024
──────────────────────────────────────────────────────────────────────────────────────────────────────────────

  Active: user@gmail.com

  Legend: ● Active  βœ“ OAuth  πŸ” Keychain  N% Quota (reset)
  Total: 3 profiles

  ⟳ Auto-refresh in 30s | Press 'r' to reload | Press 'q' to exit

Legend:

  • ● (green) - Active profile
  • β—‹ (dim) - Inactive profile
  • βœ“ - OAuth token stored (quota checking enabled)
  • βœ— - No OAuth token (added with --manual)
  • πŸ” - Token stored in Keychain
  • N% - Quota usage percentage (with reset time if available)

auth switch

Switch between Google Antigravity profiles.

# Interactive selection
agk auth switch

# With workspace options
agk auth switch --workspace select    # Choose workspace interactively
agk auth switch -w my-project         # Open specific workspace by name

Options:

Flag Alias Description
--workspace <name> -w Specify a workspace to open. Use select to choose interactively.

How it works:

  1. Displays a list of all saved profiles
  2. Select the profile you want to switch to
  3. OAuth check: If the profile has no OAuth token, you'll be prompted to sign in
  4. If Antigravity is running, you'll be prompted to close it
  5. Profile data is restored and Antigravity can be launched
  6. Workspace persistence: Your previously open workspace is remembered and reopened automatically

Example output:

β—† Switch Profile

Current profile: user@gmail.com

? Select a profile to switch to:
  ● user@gmail.com (active)
  β—‹ work@company.com
  β—‹ personal@gmail.com

⚠ work@company.com has no OAuth token. Quota checking won't work.
? What would you like to do?
  β€Ί Sign in with OAuth first
    Continue without OAuth
    Cancel

Antigravity is currently running. Close it to continue? … yes

Closing Antigravity...

? Launch Antigravity with the new profile? … yes

βœ” Switched to work@company.com and opened my-project

auth remove

Remove a Google Antigravity profile.

agk auth remove

How it works:

  1. Displays a list of all saved profiles with sizes
  2. Select the profile to remove
  3. Confirm deletion (shows disk space that will be freed)
  4. If the active profile is removed, another profile becomes active

Example output:

β—† Remove Profile

? Select a profile to remove:
  ● user@gmail.com (active)     45.2 MB
  β—‹ work@company.com            38.7 MB

? Are you sure you want to remove work@company.com?
  This will free up 38.7 MB of disk space. … yes

Removing profile...

βœ” Profile work@company.com removed

auth quota

Monitor quota usage for Google Antigravity accounts in real-time.

# Check quota for active profile
agk auth quota

# Check quota for specific account
agk auth quota --account user@gmail.com

# Set custom refresh interval (seconds)
agk auth quota --interval 60

Options:

Flag Alias Description
--account <email> -a Email of the account to check (defaults to active profile)
--interval <seconds> -i Auto-refresh interval in seconds (default: 30, min: 10)

Interactive Controls:

  • Press r to manually reload quota data
  • Press q to exit the monitor

Example output:

β—† Quota Monitor

  Monitoring quota for user@gmail.com
  Refresh interval: 30s

  πŸ“Š Quota Status - user@gmail.com
  πŸ’Ž Subscription: Gemini Business

  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚ Model                      β”‚ Quota            β”‚ Reset Time    β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ gemini-2.0-flash           β”‚ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘  80%  β”‚ in 2h 45m     β”‚
  β”‚ gemini-2.0-pro             β”‚ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘  60%  β”‚ in 2h 45m     β”‚
  β”‚ claude-3.5-sonnet          β”‚ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 100%  β”‚ β€”             β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

  ⟳ Auto-refresh in 28s | Press 'r' to reload | Press 'q' to exit

Requirements:

  • OAuth token must be stored for the account
  • Use agk auth add (without --manual) to enable quota checking

upgrade

Upgrade antigravity-kit to the latest version.

# Interactive check and upgrade
agk upgrade

# Upgrade to latest stable version
agk upgrade --latest

# Upgrade to latest beta version
agk upgrade --beta

# Check for updates only
agk upgrade --check

Options:

Flag Description
--latest Upgrade to the latest stable version
--beta Upgrade to the latest beta version
--check Check for updates without installing

How it works:

  1. Checks npm registry for new versions.
  2. Compares with your current installed version.
  3. Allows interactive selection of version (Stable vs Beta) if not specified via flag.
  4. Runs npm install -g antigravity-kit@<version> to perform the upgrade.

πŸ” Token Security

Antigravity Kit supports secure token storage for OAuth authentication:

Platform Storage Method Notes
macOS Keychain Default. Uses macOS Keychain for secure storage
Linux File Stored in ~/.antigravity-kit/tokens/
Windows File Stored in ~/.antigravity-kit/tokens/

Flags:

  • Use --insecure with auth add to force file-based storage on macOS
  • Keychain storage may require user permission on first use

πŸ–₯️ Platform Support

Platform Status Notes
macOS βœ… Looks for Antigravity.app in /Applications or ~/Applications
Linux βœ… Uses antigravity command or checks /usr/bin, /usr/local/bin
Windows βœ… Supports Git Bash, MSYS, Cygwin. Looks in Program Files

πŸ“ Profile Storage

Profiles are stored in ~/.antigravity-kit/profiles/. Each profile contains a complete copy of the Antigravity user data directory, including:

  • Authentication tokens
  • Settings and preferences
  • Extensions (if any)
  • Workspace data

βš™οΈ Requirements

  • Node.js >= 18.0.0
  • Antigravity IDE installed on your system

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE.md file for details.

πŸ™ Acknowledgments


Made with ❀️ by duongductrong

About

The essential CLI toolkit for Antigravity

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors