# CLI Feature - Pull Request Summary ## What This PR Adds A complete **Command-Line Interface (CLI)** for Antigravity Manager with 18+ commands for power users. ## Key Features - ๐Ÿ“Š **Live Quota Monitoring** - Real-time tracking for Gemini & Claude models - ๐Ÿ”„ **Account Switching** - Seamless switching without manual token management - โœ… **Token Validation** - Auto-refresh expired tokens - ๐ŸŽฏ **Smart Auto-Switch** - Automatically pick best account by quota - ๐Ÿท๏ธ **Aliases** - Shortcut names for accounts (`work`, `personal`) - ๐Ÿ’พ **Backup/Restore** - Export/import account configurations - ๐ŸŽฎ **Interactive Mode** - Keyboard-navigated menus for beginners - ๐Ÿฉบ **Diagnostics** - System health checks ## Technical Highlights - **Zero Hardcoded Paths**: Intelligently discovers database and executable locations - **Cross-Platform Ready**: Uses environment variables and checks for Windows/Mac/Linux - **Secure**: Leverages existing DPAPI + AES-256-GCM encryption (same as GUI) - **Extensible**: Clean separation between core logic (`core.py`) and commands (`main.py`) ## File Structure ``` cli/ โ”œโ”€โ”€ README.md # Full documentation โ”œโ”€โ”€ requirements.txt # Python dependencies โ”œโ”€โ”€ core.py # Database, encryption, API logic โ”œโ”€โ”€ main.py # CLI commands and interactive UI โ””โ”€โ”€ proto_utils.py # Protobuf encoding helpers ``` ## Usage Examples ```powershell # Interactive mode agm # Quick status agm status # Switch accounts agm switch work # Auto-switch to best account agm auto-switch --model claude --min-quota 50 # Live monitoring agm watch ``` ## Testing - โœ… Tested on Windows 10/11 - โœ… No hardcoded paths (uses standard Windows env vars) - โœ… Works with both installed and development builds - โœ… Database encryption/decryption verified ## Dependencies All Python dependencies are self-contained in `cli/requirements.txt`: - `typer` - CLI framework - `rich` - Beautiful terminal output - `questionary` - Interactive menus - `pywin32` - Windows DPAPI support - `cryptography` - AES-256-GCM encryption - `httpx` - Async HTTP client - `psutil` - Process management - `protobuf` - Google API protocol buffers ## Platform Support - **Windows**: Full support (tested) - **macOS/Linux**: Partial support (no DPAPI, but core features work) ## Breaking Changes None. This is a pure additionโ€”no changes to existing GUI code. ## Future Enhancements - OAuth flow for adding new accounts via CLI - TUI (Terminal UI) with live dashboard - Scheduled auto-refresh via Windows Task Scheduler - Config file for user preferences ## Checklist - [x] Code follows existing style - [x] All commands have help text - [x] No hardcoded paths/credentials - [x] README with examples - [x] Dependencies in requirements.txt - [x] .gitignore updated for Python - [x] Works with fresh installs --- **Ready to merge!** ๐Ÿš€