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

Docs

Gemini CLI Helper

A command-line interface (CLI) tool that acts as a wrapper around the official Gemini CLI, adding useful features for managing accounts, backups, and rate limits.

About

This tool was created to simplify the management of the Gemini CLI by providing a more user-friendly interface for common tasks such as logging in, managing backups, and tracking API rate limits. It aims to be a "batteries-included" solution for both new and experienced users.

🚀 Quick Start

Prerequisites

  • Python 3.8+
  • The dependencies listed in pyproject.toml:
    • b2sdk>=1.18.0
    • rich>=10.0.0

One-Command Installation

pip install .

Usage Example

Here's how to create a local backup of your Gemini configuration:

geminiai backup

✨ Key Features

  • Account Management: Seamlessly log in and out of your Gemini account.
  • Backup and Restore: God Level - Create local or cloud-based backups of your Gemini configuration and restore them with a single command.
  • Rate Limit Tracking: Keep track of API rate limits to avoid interruptions.
  • Automated Updates: Check for and install updates to the underlying Gemini CLI.
  • Cloud Sync: Synchronize your local backups with a Backblaze B2 bucket.

⚙️ Configuration & Advanced Usage

Environment Variables

For cloud-based backups with Backblaze B2, you can configure your credentials using the following environment variables:

  • B2_APPLICATION_KEY_ID: Your Backblaze B2 application key ID.
  • B2_APPLICATION_KEY: Your Backblaze B2 application key.
  • B2_BUCKET_NAME: The name of your B2 bucket.

Commands

Command Description Arguments
backup Backup Gemini configuration. --src, --archive-dir, --dest-dir-parent, --dry-run, --cloud, --bucket, --b2-id, --b2-key
restore Restore Gemini configuration from a backup. --from-dir, --from-archive, --search-dir, --dest, --force, --dry-run, --cloud, --bucket, --b2-id, --b2-key
check-integrity Check integrity of the current configuration. --src, --search-dir
list-backups List available backups. --search-dir, --cloud, --bucket, --b2-id, --b2-key
prune Prune old backups. --keep, --backup-dir, --cloud, --cloud-only, --dry-run, --bucket, --b2-id, --b2-key
check-b2 Verify Backblaze B2 credentials. --b2-id, --b2-key, --bucket
cloud-sync Sync local backups to the cloud. --backup-dir, --bucket, --b2-id, --b2-key
local-sync Sync cloud backups to local. --backup-dir, --bucket, --b2-id, --b2-key
config Manage persistent configuration. set, get, list, unset
doctor Run a system diagnostic check.
resets Manage Gemini free tier reset schedules. --list, --next, --add, --remove

Global Options

Option Description
--login Login to Gemini CLI.
--logout Logout from Gemini CLI.
--session Show the current active session.
--update Reinstall/update Gemini CLI.
--check-update Check for updates.

🏗️ Architecture

Directory Tree

src/
└── geminiai_cli/
    ├── __init__.py
    ├── cli.py
    ├── backup.py
    ├── restore.py
    ├── ...

Core Logic Flow

The main entry point is src/geminiai_cli/cli.py, which uses the argparse module to define the CLI commands and their arguments. Each command is then handled by a corresponding function in a separate file (e.g., backup.py, restore.py). The rich library is used to create a more user-friendly and visually appealing command-line interface.

🗺️ Roadmap

Completed

  • Account Management
  • Local and Cloud Backups
  • Rate Limit Tracking
  • Automated Updates

Upcoming

  • Support for other cloud providers (e.g., AWS S3, Google Cloud Storage)
  • A more interactive configuration process
  • Improved error handling and reporting

🤝 Contributing & License

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

This project is licensed under the MIT License. See the LICENSE file for more details.

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-5.1.1.tar.gz (60.1 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-5.1.1-py3-none-any.whl (45.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for geminiai_cli-5.1.1.tar.gz
Algorithm Hash digest
SHA256 ef51fac72d00c3b7251f468526add5732980f540cc084f450e9c82731dee7e8f
MD5 a2d50610e37764815579edc7dedc4bfa
BLAKE2b-256 de3b13954023e2c643bdb6b2d4fc45bb571a0c1904da39adf38f74bfd19911db

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: geminiai_cli-5.1.1-py3-none-any.whl
  • Upload date:
  • Size: 45.4 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-5.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 675408ee8eeef88248b33fde42cee2e2424db84dfa707476b2ff4a0ba9fe9de1
MD5 df42ecc8f9484d8a49473b78a948d28e
BLAKE2b-256 291d75fe512cfbcb6c90f307bf2c9f4d463ff979b7202a84bd70c81f6d84557e

See more details on using hashes here.

Provenance

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