This tool leverages the llama3:latest
model from ollama
to create commit messages that follow conventional commit standards, ensuring that your commit history is informative and well-structured.
The following categories and emojis are used for generating commit messages:
docs
: 📝feat
: ✨fix
: 🐛style
: 🎨refactor
: 🔨chore
: 🚀config
: ⚙️ollama
:
ollama
from ollama's official website.ollama
is running and accessible at http://localhost:11434
.latest
version of the llama3
model. with the following command:
ollama pull llama3:latest
gum
(Optional for Enhanced UI/UX):
gum
enhanced script:
# macOS or Linux
brew install gum
# Arch Linux (btw)
pacman -S gum
# Windows (via WinGet or Scoop)
winget install charmbracelet.gum
scoop install charm-gum
To cater to different user preferences and environments, we provide three versions of the script:
Python Script (script.py
):
Bash Script without Dependencies (script.sh
):
Bash Script with gum
(gumscript.sh
):
gum
tool to be installed.You can choose the version that best fits your needs and preferences.
Clone the Repository:
git clone https://github.com/Osama-Yusuf/GitConvit.git
cd GitConvit
Make the Script Executable:
chmod +x gumscript.sh
Install Dependencies:
jq
installed for processing JSON responses:
sudo apt-get install jq
Add the Script to your bin directory:
sudo cp gumscript.sh /usr/local/bin/gitconvit
To generate and use a conventional commit message, run the script:
gitconvit
Check if the Current Directory is a Git Repository:
Get Changed Files and Diffs:
git diff --name-only
and git diff
to get the list of changed files and their diffs.Generate Commit Message:
llama3:latest
from ollama
to generate a conventional commit message with an appropriate emoji.Interactive Confirmation:
r
, or abort by pressing CTRL+C
.Commit and Push:
Here is an example of how the commit message might look:
📝 docs(README.md): added installation method with docker
Contributions are welcome! Please fork the repository and create a pull request with your changes.
This project is licensed under the MIT License. See the LICENSE file for details.
For any inquiries or support, please contact Osama Yusuf.