Skip to main content

Gemini AI CLI Tool for automation

Project description

gemini-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-4.0.2.tar.gz (53.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-4.0.2-py3-none-any.whl (41.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: geminiai_cli-4.0.2.tar.gz
  • Upload date:
  • Size: 53.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-4.0.2.tar.gz
Algorithm Hash digest
SHA256 089ac3936d6a11f8d82079d53ce12ded80a3dd645619402012b386a3fbc11cac
MD5 af71b96c0636de02f48826f5b4f38117
BLAKE2b-256 89e484ff8ef277f1f97fefdf24ebdae569685e086c1f09f823f93c6d588d78f0

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: geminiai_cli-4.0.2-py3-none-any.whl
  • Upload date:
  • Size: 41.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-4.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4447fac999975d59a2313c628d41eb8c0b0fbc51efc458d22a0cb971850fff46
MD5 18965713bd6395e3d9a10b261fc273dc
BLAKE2b-256 da2db66135bc772f0e82528aad9edcb17eed805f29a1131b3a3fd9cc72cb5e8d

See more details on using hashes here.

Provenance

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