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.0.tar.gz (56.9 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.0-py3-none-any.whl (44.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: geminiai_cli-5.1.0.tar.gz
  • Upload date:
  • Size: 56.9 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.0.tar.gz
Algorithm Hash digest
SHA256 695aa2311e14ac27ff2992450064dc16820e011b4a354130dda8dbbe37d434e6
MD5 c9bd2e3d4f9979cc0171845a8cb95a06
BLAKE2b-256 4496941cb0ba971983d457f2c938b9d97bbbe0b60019cd661f0286890f7a611b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: geminiai_cli-5.1.0-py3-none-any.whl
  • Upload date:
  • Size: 44.2 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ccb92a49dfbe14ef5210ba83ff971c517ac8e7ad244a023ba08ee9527c674539
MD5 37d29f30c901de2dc3a94ec3c1730086
BLAKE2b-256 e648f9aef3aff01033142aab6938c8fffbe19c1dd2e17eda18d03dd0b97a4163

See more details on using hashes here.

Provenance

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