🧠🧰 This tool generates AI-powered commit messages via Git hooks, automating meaningful message suggestions from OpenAI and others to improve commit quality and efficiency.
[!CAUTION] This is still in development/beta. It will be GA when a major release 1 becomes available.
Generates a commit message based on the git diff
result using the OpenAI API.
This repository is available at NuGet under the name AICommitMessage.
hooks
directory.dotnet tool install -g AiCommitMessage
cd my-project/
dotnet-aicommitmessage install-hook
git add .
git commit -m ""
Use git log -1
to review the last commit details and find the automatically generated commit message.
The training model for the AI used is designed using as reference these two guidelines:
This tool accepts an argument as the command to execute. Here is a list of available commands:
Command | Description |
---|---|
install-hook |
Installs GIT hooks in the default .git/hooks directory or in the custom directory configured in GIT settings. |
generate-message |
Generates a commit message based on the current changes (git diff context). |
set-openai-url |
Configures a custom OpenAI API URL to generate commit messages. |
set-openai-key |
Sets or updates the OpenAI API key required to access the OpenAI service. |
set-cryptography-for-key |
Specifies whether the OpenAI API key should be stored in an encrypted format or as plain text in environment variables. |