AI-powered git commit message generator
Project description
Genaicommit: Generate AI-Powered Git Commit Messages
Genaicommit is a command-line tool that automates the generation of git commit messages using OpenAI's language models. It ensures your commit messages are concise, informative, and follow conventional commit standards.
Features
- Generates concise git commit messages based on diff.
- Supports different commit message formats such as conventional commits.
- Integrates with git to ensure the tool is usable directly within a repository.
- Adds emojis to commit messages with devmoji (optional).
Requirements
- Python 3.6+
- Git
- OpenAI API Key
Installation
You can install genaicommit using pip. First, ensure you have pip installed, then run:
pip install genaicommit
Setup
- Generate an OpenAI API key from the OpenAI website.
- Configure
genaicommitwith your OpenAI API key (not required if you have OPENAI_API_KEY environment variable set)
genaicommit config set OPENAI_API_KEY=<your_api_key>
Configuration
You can configure genaicommit using the config set command. Here are the available configuration keys:
model: The OpenAI model to use (default:gpt-4).devmoji: Whether to use devmoji for commit messages (default:false).type: The type of commit message format (default:conventional).max-length: The maximum length of the commit message (default:50).locale: The language of the commit message (default:en).OPENAI_API_KEY: Your OpenAI API key for authenticating API requests.OPENAI_BASE_URL: The base URL for the OpenAI API (default:https://api.openai.com/v1).
Example:
genaicommit config set model=gpt-3.5-turbo (default: model)
genaicommit config set max-length=72 (default: 50)
genaicommit config set OPENAI_BASE_URL=http://localhost:11434/v1 (default https://api.openai.com/v1)
Usage
- Navigate to any git repository.
- Stage your changes:
git add <files>
- Run
genaicommitto generate and approve a commit message:
genaicommit
- Run
genaicommitwith the-goption to generate multiple commit messages:
genaicommit -g 5
Example
cd your-git-repo
git add .
genaicommit
Follow the prompts to approve the commit message and commit the changes.
Options
-g, --generate N: Generate N commit messages (default is 1).config set KEY=VALUE: Set a configuration key to a value.-h, --help: Show the help message and exit.
License
This project is licensed under the MIT License.
#Credits This project was inspired by aicommits, devmoji, and commitizen.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file genaicommit-0.1.0-py3-none-any.whl.
File metadata
- Download URL: genaicommit-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab20e462ab60367f34714ca04bc0d9db8bd1f7b8c4e7e4a5af651edbd1e794c4
|
|
| MD5 |
1157d808e05e56f0e2a5e8c372632e73
|
|
| BLAKE2b-256 |
cc74265e77a6f7988a6b4d39ab4524f79d1844f88cd87f234c1414afd83bb3d5
|