Skip to main content

Generate commit messages with AI (Google Gemini) automatically using `git diff`.

Project description

commitmessagegenerator

Generate objective and technical commit messages with AI (Google Gemini) automatically using your git diff.

📦 Install

pip install commitmessagegenerator

Or, if you're using a venv:

python -m venv venv
source venv/bin/activate  # or .\venv\Scripts\activate in Windows
pip install commitmessagegenerator

⚙️ Configuring

commitgen -cf

Run this and type you API key to the terminal so the package creates the .env file and automatically adds it to the .gitignore

Or do it manually:

IMPORTANT - BEFORE CREATING THIS FILE ADD '.venv' TO YOUR .gitignore SO YOUR API KEY ISN'T EXPOSED

Create a .env file in the directory where you will run commitgen (usually the root of your Git project):

GEMINI_API_KEY=your-gemini-api-key

🚀 Usage

With the terminal, inside any Git repository with pending changes, run:

commitgen (-c/-cp)

The command will:

  • Read the git diff;
  • Send it to the Google Gemini API;
  • Return a commit message suggestion directly in your terminal.

🧩 Requisites

  • Python 3.8 or higher
  • Gemini API Key (Google Generative AI, free at: https://aistudio.google.com/app/apikey)
  • Initialized Git repository
  • Python dependencies (Automatically installed with the package):
    • GitPython
    • google-generativeai
    • python-dotenv

📄 License

MIT License

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

commitmessagegenerator-1.3.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

commitmessagegenerator-1.3.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file commitmessagegenerator-1.3.1.tar.gz.

File metadata

  • Download URL: commitmessagegenerator-1.3.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for commitmessagegenerator-1.3.1.tar.gz
Algorithm Hash digest
SHA256 8ef80013c90032d78f4f5c52da34f8d266e097564ba0c78486f971287879fa9c
MD5 71dd995e3e6322c0b4265d53ec8df6f0
BLAKE2b-256 3a3526b32003df1c5819ff3bc03a07c5bcffdf36961a2702b7f4ca356d00af25

See more details on using hashes here.

File details

Details for the file commitmessagegenerator-1.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for commitmessagegenerator-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe7e82566f8f4a97837c2419fa2ab85eeef8e884384f9013050e9cb4731c329e
MD5 e6cc0a6b5718088e6d73a70be5c8d14a
BLAKE2b-256 c4c7ebc033d83b02bc87085749af6a4cf4e2633b93087cc26f0e2c6b115277f8

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