Automates the creation of standardized Git commit messages using OpenAI's API.
- Automated Commit Messages: Generate standardized commit messages based on the changes in your repository.
- Automated Git Operations: Automatically add, commit, and push the changes to your repository.
- OpenAI API Key: Requires an API key from OpenAI to access the GPT-3 model for generating commit messages.
- Internet Connection: Requires an active internet connection to communicate with the OpenAI API.
- Requires a Git Repository: Needs to be run in a Git repository to access the changes for generating commit messages.
Commit Generator can be installed globally using npm:
npm install -g ai-diff-commit
Once you have set up the script using the installation instructions, you can use the ai-diff-commit
command to generate commit messages based on the changes in your repository.
-a
,--all
: Add all changes in the repository to the commit. By default, only the modified files are added.-h
,--help
: Display help information for the script.-m
,--model
: Specify the OpenAI API language model to use for generating commit messages. See the OpenAI API documentation for available models.-p
,--push
: Automatically push the changes to the remote repository after committing.- If a remote branch is not specified, the changes are pushed to a new remote branch with the same name as the current branch. (I plan to make this more configurable in the future.)
For example, to generate a commit message based on all changes in the repository and push the changes to the remote repository, you can use the following command:
ai-diff-commit -a -p
If you encounter any issues while using the script or have ideas for new features, please open an issue on GitHub.
This project is licensed under the MIT License - see the LICENSE file for details.