antigravity-usage
v0.1.1
Published
CLI tool to check Antigravity model quota via Google Cloud Code API
Maintainers
Readme
Antigravity Usage
A fast, lightweight, and powerful CLI tool to track your Antigravity model quota and usage. Works offline with your IDE or online with multiple Google accounts.
Inspired by ccusage.
Quick Start (No Login Required) 🚀
If you have Antigravity running in your IDE (VSCode, JetBrains, etc.), you can check your quota immediately without logging in.
# Install globally
npm install -g antigravity-usage
# Check quota immediately (uses your IDE's connection)
antigravity-usageThat's it! The tool automatically connects to your local Antigravity server to fetch the exact same data your IDE sees.
Power User Guide ⚡️
Want to check quota for multiple accounts or when your IDE is closed?
1. Login with Google
antigravity-usage login2. Add more accounts
antigravity-usage accounts add3. Check everything at once
antigravity-usage quota --allHow It Works 🛠️
Antigravity Usage employs a smart "Dual-Fetch" strategy to ensure you always get data:
- Local Mode (Priority): First, it tries to connect to the Antigravity Language Server running inside your IDE.
- Pros: Fast, works offline, no extra login required.
- Cons: IDE must be open.
- Cloud Mode (Fallback): If Local Mode fails (or if managing multiple accounts), it uses the Google Cloud Code API.
- Pros: Works anywhere, supports multiple accounts.
- Cons: Requires one-time login.
By default, antigravity-usage runs in Auto Mode, seamlessly switching between these methods.
Features
🔐 Multi-Account Management
Seamlessly juggle multiple Google accounts (e.g., Personal vs Work).
- Parallel Fetching: optional
--allflag fetches data for all accounts simultaneously. - Privacy Focused: Tokens are stored locally on your machine, never sent to third-party servers.
🔌 Offline Capabilities
Designed for plane rides and spotty wifi.
- Direct IDE Access: Reads directly from the local server loopback.
- Smart Fallbacks: If the internet cuts out, it defaults to the last known state from your local IDE.
⚡️ Smart Caching
To keep the CLI snappy and avoid hitting API rate limits:
- Quota data is cached for 5 minutes.
- Use the
--refreshflag to force a new fetch:antigravity-usage quota --refresh
📱 Responsive UI
Tables automatically adapt to your terminal size, switching between "Compact" and "Spacious" views to show you the most relevant data without wrapping.
Command Reference
antigravity-usage (Default)
Alias for quota. Fetches and displays usage data.
antigravity-usage # Auto-detect (Local -> Cloud)
antigravity-usage --all # Fetch ALL accounts
antigravity-usage --method local # Force local IDE connection
antigravity-usage --json # Output JSON for scriptsantigravity-usage accounts
Manage your roster of Google accounts.
antigravity-usage accounts list # Show all accounts & status
antigravity-usage accounts add # Login a new account
antigravity-usage accounts switch <email> # Set active account
antigravity-usage accounts remove <email> # Logout & delete dataantigravity-usage doctor
Troubleshoot issues with your setup. Checks env vars, auth status, and local server connectivity.
antigravity-usage status
Quickly check if your auth tokens are valid or expired.
Configuration
Data is stored in your system's standard config location:
- macOS:
~/Library/Application Support/antigravity-usage/ - Linux:
~/.config/antigravity-usage/ - Windows:
%APPDATA%/antigravity-usage/
Development
npm run dev -- quota --all
npm testLicense
MIT
