GM AI Automation Tool
The Swiss Army Knife for GM AI Automation - Backups, Cloud Sync, and Account Management.
gemini-manager is a powerful, "batteries-included" command-line interface designed to supercharge your GM AI experience. It handles backups (Local, S3, B2), synchronizes data across devices, manages multiple profiles, and intelligently tracks account usage to bypass rate limits.
2. ⚡ Quick Start (The "5-Minute Rule")
Prerequisites
- Python: 3.8 or higher. (Compatible up to 3.13)
- Optional: Docker, AWS CLI, or Backblaze B2 CLI for credentials management.
Install
We recommend using uv for fast, reproducible installs, but standard pip works too.
# Install from PyPI
uv pip install gemini-manager # or pip install gemini-manager
# Or install from source
uv pip install . # or pip install .
Run
Get up and running immediately. Copy and paste this to initialize and use the tool:
# 1. Run the interactive setup wizard
gm config --init
# 2. Run your first local backup
gm backup
# 3. Push your backup to the cloud
gm sync push
# 4. Check the account dashboard
gm cooldown --cloud
# 5. Get a smart account recommendation
gm recommend
3. ✨ Features (The "Why")
Core Capabilities
- 🛡️ God Level Backups: Securely backup your configuration and chat history to Local, AWS S3, or Backblaze B2 storage. Supports GPG Encryption for sensitive data.
- 🌍 Machine-Time Adaptive: Automatically detects and uses your system's local timezone for all calculations and displays. No more manual IST/UTC conversions.
- ☁️ Unified Cloud Sync: Seamlessly
pushandpullbackups between your local machine and the cloud. - 💬 Chat History Management: Backup, restore, resume, and clean up temporary chat history with precision.
Smart Automation
- ⏱️ Smart Session Tracking: Tracks "First Used" timestamps to accurately predict GM's 24-hour rolling quota resets.
- 🧠 Intelligent Rotation: Automatically recommends the "healthiest" account based on session start times and Least Recently Used (LRU) logic.
- 🛡️ Accident Protection: Safeguards your session data by preventing accidental account switches from resetting your 24-hour quota clock.
Diagnostics & Management
- 📊 Visual Analytics: View beautiful, terminal-based bar charts of your usage history and account health (over the last 7 days).
- 🩺 Doctor Mode: Built-in diagnostic tool to validate your environment, dependencies, and configuration health.
- 🧹 Auto-Pruning: Automatically cleans up old backups and temporary files to keep your storage efficient.
- 👥 Profile Management: Export and import entire user profiles and their corresponding settings.
4. 🛠️ Configuration (The "How")
You can configure gemini-manager using Environment Variables, CLI Arguments, or the Interactive Config (gm config --init).
Priority Order: CLI Arguments > Environment Variables > .env / Doppler > Saved Config (~/.gemini-manager/settings.json)
Environment Variables
| Name | Description | Default | Required |
|---|---|---|---|
GEMINI_AWS_ACCESS_KEY_ID |
AWS Access Key ID for S3. | None | No (for S3) |
GEMINI_AWS_SECRET_ACCESS_KEY |
AWS Secret Access Key for S3. | None | No (for S3) |
GEMINI_S3_BUCKET |
AWS S3 Bucket Name. | None | No (for S3) |
GEMINI_S3_REGION |
AWS Region. | us-east-1 |
No |
GEMINI_B2_KEY_ID |
Backblaze B2 Application Key ID. | None | No (for B2) |
GEMINI_B2_APP_KEY |
Backblaze B2 Application Key. | None | No (for B2) |
GEMINI_B2_BUCKET |
Backblaze B2 Bucket Name. | None | No (for B2) |
GEMINI_BACKUP_PASSWORD |
Password for GPG encryption. | None | No (for --encrypt) |
DOPPLER_TOKEN |
Token for Doppler secrets management. | None | No |
CLI Arguments
Below are some of the most powerful and common CLI flags available. Run gm --help or gm <command> --help for a full list.
| Flag / Command | Description |
|---|---|
gm backup --encrypt |
Encrypt the backup archive using GPG. |
gm restore --auto |
Automatically select and restore the latest backup for the best available account. |
gm prune --cloud-only |
Only remove old backups from cloud storage, keeping local copies. |
gm cooldown --reset-all |
DANGER: Wipe all cooldown data (local and cloud). |
gm --profile <name> |
Specify a configuration profile to use (e.g., work, personal). |
gm check-integrity |
Verify integrity of current configuration against the latest backup. |
5. 🏗️ Architecture
The gemini-manager is built with modularity and extensibility in mind.
src/gemini_manager/
├── cli.py # 🚀 Entry Point & Argument Routing
├── config.py # ⚙️ Global Constants & Paths
├── backup.py # 📦 Backup Logic (Local & Cloud dispatch)
├── restore.py # ♻️ Restore Logic (Auto-selection & Session logs)
├── cooldown.py # ❄️ Master Dashboard & Adaptive Time Logic
├── recommend.py # 🧠 Recommendation Engine (Session-aware)
├── sync.py # 🔄 Unified Sync (Push/Pull)
├── cloud_factory.py # ☁️ Cloud Provider Abstract Factory
├── stats.py # 📊 Visualization Module
├── chat.py # 💬 Chat management and restoration
└── profile.py # 👥 Configuration profiles
Flow
- User Input: CLI args are parsed by
args.pyand routed bycli.py. - Configuration: Settings are loaded from
settings_cli.py(merging Env, CLI, Doppler, and Config). - Action:
- Backup: Compresses
~/.gemini-manager, encrypts (optional), and uploads viaCloudFactory. - Restore: Fetches list from cloud/local, decrypts, and extracts to
~/.gemini-manager. - Recommendation: Queries
cooldown.pyfor account status and selects the LRU "Ready" account.
- Backup: Compresses
- Persistence: Usage stats and cooldowns are saved to JSON files in
~/.gemini-manager.
6. 🐞 Troubleshooting (New in V3)
| Error Message | Possible Cause | Solution |
|---|---|---|
ModuleNotFoundError: No module named 'gemini_manager' |
Installation issue. | Run uv pip install -e . or ensure you are in the correct venv. |
gpg: decryption failed: No secret key |
Missing GPG key or wrong password. | Ensure GEMINI_BACKUP_PASSWORD is set or the GPG key is imported. |
ClientError: An error occurred (403) ... |
AWS/B2 Credentials invalid. | Check your GEMINI_* env vars, .env, or Doppler secrets. |
Permission denied: '~/.gemini-manager' |
File permission issues. | Run chown -R $USER ~/.gemini-manager or check directory permissions. |
[WARN] Found DOPPLER_TOKEN but failed to fetch secrets |
Network or Invalid Token. | Check network connectivity and verify DOPPLER_TOKEN validity. |
Debug Mode: Currently, you can increase verbosity by inspecting the logs or running with standard python tracebacks enabled (default).
7. 🤝 Contributing
We welcome contributions! Whether it's reporting a bug, suggesting a feature, or writing code.
See CONTRIBUTING.md for detailed instructions.
- Setup Dev Environment:
uv pip install -e .[dev] - Run Tests:
uv run pytest tests/ - Lint Code:
uv run ruff check src - Submit PR: Follow the guidelines in the contributing guide.
8. 🗺️ Roadmap
- Phase 1 (Completed): Core Backup/Restore, Multi-Cloud (S3/B2), Sync, Auto-Updates.
- Phase 2 (Completed): Machine-Time Adaptation, Session Tracking, Smart Rotation.
- Phase 3 (Upcoming):
- 🔔 Webhooks: Slack/Discord notifications for backup status.
- 🐍 Python SDK: Import
gemini_manageras a library in your own scripts.
- Phase 4 (Vision): AI-driven anomaly detection and self-healing infrastructure.
See ROADMAP.md for the full detailed vision.
Metadata
Release files for gemini-manager 26.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gemini_manager-26.0.0.tar.gz | 128.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gemini_manager-26.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 219.5 kB
Release files / gemini_manager-26.0.0.tar.gz
| Download URL | gemini_manager-26.0.0.tar.gz |
|---|---|
| Size | 128.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e5c51ae89a1a77c30d4061081a966d3793a25b7681c3d800f00fdd1e577a6411
|
|
BLAKE2b-256 checksum How to use checksums |
33038f9b4556410990c39a82fa456140e48fc4584d2a60842cf4b24756bfa9ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 17, 2026.
Transparency logRelease files / gemini_manager-26.0.0-py3-none-any.whl
| Download URL | gemini_manager-26.0.0-py3-none-any.whl |
|---|---|
| Size | 91.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7b140237d25c2dad5f0e4da67c23802cc040bd576d24e273e266ffc4244d7bf9
|
|
BLAKE2b-256 checksum How to use checksums |
124c0ad259bd161eb0fe0b0f0ec6acac94404e7e9e7070558dd66ccc015e13ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 17, 2026.
Transparency log