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-5.0.0.tar.gz (55.6 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.0.0-py3-none-any.whl (42.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: geminiai_cli-5.0.0.tar.gz
  • Upload date:
  • Size: 55.6 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.0.0.tar.gz
Algorithm Hash digest
SHA256 0ea432806702e45b0fb77d99f7fe7aaa6accc6acd1d9ada0e2c25a88e24685c8
MD5 b0ff40a7fc58f70bc48a1f0d7b269ba8
BLAKE2b-256 3b81b9623ca424132c37f3182c0c952cb5c23fdc76aee9fdd5d2deb7ba535c48

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: geminiai_cli-5.0.0-py3-none-any.whl
  • Upload date:
  • Size: 42.6 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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49ebc2f32006815d355443dd65b4accd7f0bc47f5ed9a8ddad8ced791eb0e710
MD5 4a446c78c95c04e7ae70f82e48e64034
BLAKE2b-256 2f45cb8ae61eeadae815194a8fcabf69641d6245ae8cf9a0ac150ad65d914439

See more details on using hashes here.

Provenance

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