Skip to main content

Gemini AI CLI Tool for automation

Project description

geminiai-cli logo

PyPI version Python Wheel Release

Build status Codecov Test Coverage Code style: black Ruff Security

Downloads PyPI Downloads OS Python Versions

License: MIT

Gemini AI Automation Tool

The Swiss Army Knife for Gemini AI Automation - Backups, Cloud Sync, and Account Management.

About

geminiai-cli is a powerful, "batteries-included" command-line interface designed to supercharge your Gemini AI experience. Whether you need to manage multiple accounts, ensure your configuration is safely backed up to the cloud (S3 or B2), or track your free tier usage to avoid rate limits, this tool has you covered. It wraps complex operations into simple, memorable commands.

๐Ÿš€ Quick Start

Prerequisites

  • Python: 3.8 or higher
  • Dependencies: b2sdk, boto3, rich (installed automatically)

One-Command Installation

pip install geminiai-cli
# Or from source
pip install .

Usage Example

Get up and running immediately. You can use geminiai, geminiai-cli, or the shorthand ga.

# Run a local backup
geminiai backup

# Sync your backups to the cloud (Push to S3 or B2)
geminiai sync push

# Get the next best account recommendation
ga recommend

# Check your account cooldown status
ga cooldown

# Use a specific profile (e.g., work)
ga --profile work backup

# View all available commands
geminiai --help

โœจ Key Features

  • ๐Ÿ›ก๏ธ God Level Backups: Create local or Cloud-based backups (AWS S3 & Backblaze B2) of your Gemini configuration and chats.
  • โ˜๏ธ Multi-Cloud Support: Native support for AWS S3 and Backblaze B2 for redundant cloud storage.
  • ๐Ÿ”„ Unified Cloud Sync: Seamlessly push and pull backups between your local machine and the cloud.
  • ๐Ÿ‘ค Configuration Profiles: Manage multiple environments (e.g., personal, work) with the --profile flag and profile command.
  • ๐Ÿ’ฌ Chat Management: Backup, restore, resume, and cleanup chat sessions and logs.
  • ๐Ÿง  Smart Recommendation: Automatically switch to the best available account based on cooldowns and usage history.
  • โฑ๏ธ Resets Management: Track your Gemini free tier reset schedules to maximize usage without hitting limits.
  • โ„๏ธ Cooldown Tracking: Monitor account cooldown status to avoid rate limiting.
  • ๐Ÿ“Š Visual Usage Stats: Visualize usage patterns over the last 7 days.
  • ๐Ÿฉบ Doctor Mode: Run a system diagnostic check to identify and fix issues.
  • ๐Ÿ” Credential Management: Securely handle credentials via CLI, Environment Variables, or Doppler.
  • โšก Integrity Checks: Verify your configuration integrity against backups.
  • ๐Ÿ”„ Automated Updates: Built-in self-update mechanism.
  • ๐Ÿง™ Interactive Wizard: Guided setup process for easy configuration (config --init).

โš™๏ธ Configuration & Advanced Usage

Environment Variables

You can configure credentials using .env files, environment variables, or Doppler. The priority order is: CLI Args > Doppler > Env Vars > .env file > Saved Config.

Variable Description
GEMINI_AWS_ACCESS_KEY_ID Your AWS Access Key ID (for S3).
GEMINI_AWS_SECRET_ACCESS_KEY Your AWS Secret Access Key (for S3).
GEMINI_S3_BUCKET The name of your AWS S3 Bucket.
GEMINI_S3_REGION The AWS Region (default: us-east-1).
GEMINI_B2_KEY_ID Your Backblaze B2 Application Key ID.
GEMINI_B2_APP_KEY Your Backblaze B2 Application Key.
GEMINI_B2_BUCKET The name of your Backblaze B2 Bucket.
DOPPLER_TOKEN Token for fetching secrets from Doppler.

CLI Commands

Command Description Key Arguments
backup Backup configuration and chats. --src, --archive-dir, --dest-dir-parent, --cloud, --bucket, --dry-run
restore Restore configuration from backup. --from-dir, --from-archive, --search-dir, --cloud, --force, --auto
sync Sync backups with Cloud (S3/B2). push, pull, --backup-dir, --bucket, --b2-id, --b2-key
chat Manage chat history. backup, restore, cleanup (w/ --dry-run, --force), resume
list-backups List available backups. --cloud, --search-dir, --bucket
prune Delete old backups. --keep, --cloud, --cloud-only, --dry-run, --bucket
check-integrity Verify configuration integrity. --src
check-b2 Verify B2 credentials. --bucket, --b2-id, --b2-key
config Manage persistent settings. set, get, list, unset, --init, --force
resets Manage free tier reset schedules. --list, --next (w/ email/id), --add, --remove
cooldown Show account cooldown status. --cloud, --remove, --bucket
recommend Suggest next best account. (No arguments) (Alias: next)
stats Show usage statistics. (No arguments) (Alias: usage)
profile Manage configuration profiles. export, import (w/ --force)
doctor Run system diagnostics. (No arguments)

Global Options

Option Description
--profile <name> Specify a configuration profile to use (e.g., work).
--login Login to Gemini CLI.
--logout Logout from Gemini CLI.
--session Show current active session.
--update Reinstall/update Gemini CLI.
--check-update Check for updates.

๐Ÿ—๏ธ Architecture

The project is structured as a modular Python CLI application using argparse for command handling and rich for the UI.

src/geminiai_cli/
โ”œโ”€โ”€ cli.py             # Main Entry Point & Argument Parsing
โ”œโ”€โ”€ cloud_factory.py   # Cloud Provider Factory (S3/B2)
โ”œโ”€โ”€ cloud_s3.py        # AWS S3 Integration
โ”œโ”€โ”€ b2.py              # Backblaze B2 Integration
โ”œโ”€โ”€ backup.py          # Backup Logic
โ”œโ”€โ”€ restore.py         # Restore Logic
โ”œโ”€โ”€ chat.py            # Chat History Management
โ”œโ”€โ”€ sync.py            # Cloud/Local Sync Logic (Push/Pull)
โ”œโ”€โ”€ recommend.py       # Smart Account Recommendation
โ”œโ”€โ”€ profile.py         # Profile Import/Export Logic
โ”œโ”€โ”€ stats.py           # Visual Usage Statistics
โ”œโ”€โ”€ integrity.py       # Integrity Check Logic
โ”œโ”€โ”€ prune.py           # Backup Pruning Logic
โ”œโ”€โ”€ doctor.py          # System Diagnostics
โ”œโ”€โ”€ cooldown.py        # Cooldown Tracking
โ””โ”€โ”€ reset_helpers.py   # Reset Schedule Management

๐Ÿ—บ๏ธ Roadmap

โœ… Completed

  • Account Management: Seamless login/logout.
  • Multi-Cloud Support: AWS S3 & Backblaze B2 integration.
  • Unified Sync: Push and Pull backups seamlessly.
  • Profiles: Support for multiple configuration profiles.
  • Resets & Cooldowns: Smart rate limit management.
  • Automated Updates: Self-updating mechanism.
  • Health Checks: Doctor mode for diagnostics.
  • Chat Management: Backup, restore, and cleanup capabilities.
  • Smart Recommendations: Intelligent account switching.
  • Interactive Config: Wizard-style setup.

๐Ÿšง Upcoming

  • Google Cloud Storage Support: Native GCS integration.
  • Enhanced TUI: Rich dashboards and real-time progress bars.
  • Webhooks: Integration with Slack/Discord for alerts.
  • AI-Driven Anomaly Detection: Smart backup analysis.

๐Ÿค Contributing & License

Contributions are welcome! Please submit a pull request or open an issue on the GitHub repository.

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geminiai_cli-12.0.0.tar.gz (96.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geminiai_cli-12.0.0-py3-none-any.whl (67.3 kB view details)

Uploaded Python 3

File details

Details for the file geminiai_cli-12.0.0.tar.gz.

File metadata

  • Download URL: geminiai_cli-12.0.0.tar.gz
  • Upload date:
  • Size: 96.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for geminiai_cli-12.0.0.tar.gz
Algorithm Hash digest
SHA256 17c9d1eb3518a8fa1e7f0c1e7684e6669a334f44fef656dc8c9c0af83e714ae4
MD5 b7e8a7553b011d5b96255da30c2ca2f4
BLAKE2b-256 ad7632f6c37a8174e5710925fba6a99a8304a5d8edf4e05970823d5746bac2f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for geminiai_cli-12.0.0.tar.gz:

Publisher: publish.yml on dhruv13x/geminiai-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file geminiai_cli-12.0.0-py3-none-any.whl.

File metadata

  • Download URL: geminiai_cli-12.0.0-py3-none-any.whl
  • Upload date:
  • Size: 67.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for geminiai_cli-12.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eca7665ed767466ba2b64369e2d95aa4fa3945436d5500b00eb21383c87594a0
MD5 eb9515c48144c4dd47a888612246a3e6
BLAKE2b-256 b6df26d7fc69790cd465d0ab4bb7876575628a6449cda43f022c9902854621a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for geminiai_cli-12.0.0-py3-none-any.whl:

Publisher: publish.yml on dhruv13x/geminiai-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page