How mhiqrambg/gsuite2router works
gsuite2router is a CLI for adding Google accounts as Antigravity connections on 9Router and scanning, deleting, or resetting connections based on quota and status. For adding, the CLI reads account credentials, requests OAuth authorization from 9Router, uses a fresh Chrome profile for Google login and consent, then exchanges the returned code to create a connection; successful accounts are removed from the input file. The delete command scans provider connections and usage, deletes selected connections, and resets/tests those kept. The OAuth excerpt is partial, so browser details beyond the documented flow are not expanded.
Main entry points: cli.py CLI commands · router_api.py 9Router API client · google_auth.py Google login flow · accounts.py Account file I/O
Components 12
CLI orchestration
- CLI commands
gsuite2router/cli.py
Inputs and config
- Config I/O
gsuite2router/config.py - Config file
- Account file I/O
gsuite2router/accounts.py - Account file
Google OAuth
- Google login flow
gsuite2router/google_auth.py
Connection management
- 9Router API client
gsuite2router/router_api.py - Quota scan and cleanup
gsuite2router/delete.py
Other components
- Operator
- 9Router instance
- Chrome browser
- Google OAuth
Connections 15
- Operator → CLI commands: runs commands
- CLI commands → Config I/O: loads and saves
- Config I/O → Config file: reads and writes
- CLI commands → Account file I/O: reads accounts
- Account file I/O → Account file: reads and edits
- CLI commands → 9Router API client: logs in and authorizes
- CLI commands → Google login flow: submits credentials
- Google login flow → Chrome browser: controls browser
- Chrome browser → Google OAuth: performs OAuth login
- Google login flow → CLI commands: returns auth code
- CLI commands → 9Router API client: exchanges auth code
- 9Router API client → 9Router instance: calls REST API
- CLI commands → Account file I/O: removes successes
- CLI commands → Quota scan and cleanup: runs cleanup
- Quota scan and cleanup → 9Router API client: scans and manages