Automatically generate semantic commit messages for your git projects using OpenAI's GPT model.
This tool provides an automated way to generate semantic commit messages based on the diff of your git commits. The generated messages are meaningful and provide clear information about the changes in the commit.
- Python 3
- An OpenAI API key
- Clone this repository to your local machine.
- Run the
install.sh
script:
$ ./install.sh
- During the installation, you'll be prompted to enter your OpenAI API key.
After successful installation, the gpt-commit
tool will be available in your path.
- Make changes to your project files.
- Instead of the regular git commit command, simply run:
$ gpt-commit
- The script will automatically generate a semantic commit message based on the changes and commit the changes.
The gpt-commit
tool does the following:
- Retrieves the git diff for all the changed files in your project.
- Uses OpenAI's GPT model to generate a semantic commit message based on the content of the diffs.
- Commits the changes with the generated message.
The tool is designed to ignore certain files like pnpm.lock
, yarn.lock
, and package-lock.json
.
If you have ideas or improvements, feel free to fork this repository and submit pull requests. Feedback is always welcome!
You can customize this further as needed, but I hope this gives you a good starting point for your README.md!