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-14.0.0.tar.gz (96.8 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-14.0.0-py3-none-any.whl (66.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for geminiai_cli-14.0.0.tar.gz
Algorithm Hash digest
SHA256 c0730be5008ef05417a1e93923acbe1d242cae626b71bbb926368e1f17576060
MD5 41e8f6275f9db803778b32a9dba9ea5e
BLAKE2b-256 dfd84cdb82804b952b555864ac4f9485d89b4cc6ca82d174537b91eff3c95ef8

See more details on using hashes here.

Provenance

The following attestation bundles were made for geminiai_cli-14.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-14.0.0-py3-none-any.whl.

File metadata

  • Download URL: geminiai_cli-14.0.0-py3-none-any.whl
  • Upload date:
  • Size: 66.9 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-14.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b03603b5b97fc4fa62e22b4316d00eafb657dbbf3d9585cb325356e90df27aa
MD5 68eb3e898883e9719b16da59de7f1862
BLAKE2b-256 05964b52983b43ec90d5974afad266a467b9d3c744d7aebb202ac3e5cd421461

See more details on using hashes here.

Provenance

The following attestation bundles were made for geminiai_cli-14.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