This CLI tool generates Git commit messages using an LLM. It analyzes staged changes and provides a suggested commit message so devs can focus on writing code instead of commit messages. It can also generate humorous commit messages for fun.
-
Clone the Repository:
git clone https://github.com/SubhasmitaSw/commitgen.git cd commitgen -
Create a
.envFile:- Copy
.env.exampleto.env:cp .env.example .env
- Edit
.envand add your Relax AI API key or replace with your preferred LLM API key.
- Copy
-
Create a Virtual Environment:
python -m venv venv
-
Activate the Virtual Environment:
- On Windows:
venv\Scripts\activate
- On macOS/Linux:
source venv/bin/activate
- On Windows:
-
Install the Package:
pip install .
- Install the Package:
pip install --user .
If you have Poetry installed, you can also use it to manage dependencies.
-
Install Poetry: Follow the instructions on the Poetry installation page.
-
Install Dependencies:
poetry install
-
Stage Your Changes:
git add . -
Generate a Commit Message:
commitgen
-
Review and Commit:
- Review the suggested commit message.
- Confirm or edit the message to commit.
--bonkers: Go bonkers and generate a humorous commit message.
Contributions are welcome! Please fork the repository and submit a pull request.
This project is licensed under the MIT License.