Skip to main content

A CLI tool for AI-powered Git commit messages using Google Gemini API.

Project description

🚀 AutoCommit-CLI: AI-Powered Git Commit Messages

AutoCommit-CLI is a powerful command-line tool that automates the process of writing meaningful Git commit messages using Google Gemini AI. No more struggling to come up with good commit messages—just let AI do it for you! 🎯

✨ Features

  • 🔍 Analyze Git changes and generate meaningful commit messages.
  • 🔄 Auto-commit staged changes with AI-generated messages.
  • ☁️ Push changes to the repository automatically.
  • Works with Google Gemini API for intelligent commit suggestions.
  • 🏗 Easy to use & install as a CLI tool.

📦 Installation

1️⃣ Install via pip

pip install autocommit-cli

2️⃣ Set Up Google Gemini API Key

AutoCommit-CLI requires a Google Gemini API key. Get yours from Google AI Studio and store it in a .env file in your project:

GEMINI_API_KEY="your_api_key_here"

🛠 Usage

1️⃣ Analyze Changes & Get a Suggested Commit Message

autocommit --analyze

📌 Example Output:

💡 Suggested Commit Message:
fix: resolved authentication issue in login flow

2️⃣ Commit with AI-Generated Message

autocommit --commit

📌 Example Output:

✅ Committed Successfully: fix: updated error handling in user registration

3️⃣ Auto-Commit & Push

autocommit --commit --push

📌 Example Output:

✅ Committed Successfully: refactor: improved API response handling
🚀 Pushed changes to remote repository!

⚙️ How It Works

  1. The tool fetches staged Git changes using git diff --staged.
  2. It sends these changes to the Google Gemini API to generate a relevant commit message.
  3. It commits the changes with the generated message.
  4. (Optional) It pushes the changes to the repository if --push is used.

🔧 Development & Contribution

Want to improve AutoCommit-CLI? Follow these steps:

Clone the repository:

git clone https://github.com/yourusername/Autocommit-CLI.git
cd Autocommit-CLI

Install dependencies:

pip install -r requirements.txt

Run locally for testing:

python autocommit.py --analyze

Contribute:

  • Fork the repo ✅
  • Create a new branch ✅
  • Make your changes ✅
  • Submit a pull request ✅

📝 License

This project is licensed under the MIT License.


❤️ Support

If you like this project, give it a ⭐ on GitHub! 🙌

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

autocommit-cli-0.1.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autocommit_cli-0.1.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file autocommit-cli-0.1.1.tar.gz.

File metadata

  • Download URL: autocommit-cli-0.1.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.3

File hashes

Hashes for autocommit-cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0bb469203bec74f27fde47265f2685a3d9e3495e421d094914c68e6be07971b9
MD5 56ee3a7278fda1bd4f61f6ecf37194b9
BLAKE2b-256 5b4d73c497241603179bbf28ae660bf55529a38ca11cb2043c85150146e4b784

See more details on using hashes here.

File details

Details for the file autocommit_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: autocommit_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.3

File hashes

Hashes for autocommit_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f1fe76d486c92565eb87ec223c2d5fe873cfea200c4fe40d770d5b433af42e83
MD5 91c4fa30232a8635381d6a54ebfb056d
BLAKE2b-256 720a0fe792dd8b084221c9b83483331267687d4f526139627ecab249ea74c207

See more details on using hashes here.

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