AiCommitMessage 0.8.0

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global AiCommitMessage --version 0.8.0                
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local AiCommitMessage --version 0.8.0                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=AiCommitMessage&version=0.8.0                
nuke :add-package AiCommitMessage --version 0.8.0                

GIT Hooks + OpenAI - Generate GIT commit messages from OpenAI

🧠 🧰 This tool generates AI-powered commit messages via Git hooks, automating meaningful message suggestions from OpenAI and others to improve commit quality and efficiency.

GitHub last commit GitHub license time tracker

Build Continuous Integration Infisical secrets check Linter check


[!CAUTION] This is still in development/beta. It will be GA when a major release 1 becomes available.

What this tool does

Generates a commit message based on the git diff result using the OpenAI API.


Requirements


Getting started

AICommitMessage NuGet Version AICommitMessage NuGet Downloads

This repository is available at NuGet under the name AICommitMessage.

Installation

  1. Install the tool globally (or per project/repository).
  2. Move to the project folder.
  3. Install the Git hook on the default 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.


Commit message pattern

The training model for the AI used is designed using as reference these guidelines:


Sequence of Execution

Here’s a flow diagram showing the sequence of execution of the prepare-commit-msg hook and its integration with dotnet-aicommitmessage to generate commit messages using the OpenAI API:

graph TD
    A[Git Commit] --> B[prepare-commit-msg Hook Trigger]
    B --> C[Invoke dotnet-aicommitmessage Tool]
    C --> D[Send Data to OpenAI API]
    D --> E[Generate Commit Message]
    E --> F[Check and append pre-defined commands to Commit Message]
    F --> G[Return Generated Commit Message]
    G --> H[Insert Commit Message into Git Commit]
    H --> I[Finalize Commit]

Commands

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-settings Set the OpenAI settings.
help Display information about this program.
version Display version information.

Example output

Here is an example of the commit messages generated in a real-world project:

example

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
0.8.6 35 11/15/2024
0.8.5 33 11/15/2024
0.8.4 65 11/12/2024
0.8.3 77 11/11/2024
0.8.2 69 11/11/2024
0.8.1 66 11/4/2024
0.8.0 74 11/1/2024
0.7.9 64 11/1/2024
0.7.8 66 11/1/2024
0.7.7 60 11/1/2024
0.7.6 68 11/1/2024
0.7.5 72 11/1/2024
0.7.4 65 10/28/2024
0.7.3 76 10/28/2024
0.7.2 70 10/28/2024
0.7.1 69 10/27/2024
0.7.0 69 10/26/2024
0.6.1 71 10/26/2024
0.6.0 69 10/22/2024
0.5.1 67 10/22/2024
0.5.0 64 10/22/2024
0.4.23 75 10/22/2024
0.4.22 67 10/22/2024
0.4.21 81 10/21/2024
0.4.20 155 10/19/2024
0.4.19 100 10/19/2024
0.4.18 99 10/19/2024
0.4.17 101 10/19/2024
0.4.16 97 10/19/2024
0.4.15 103 10/19/2024
0.4.14 112 10/19/2024
0.4.13 109 10/19/2024
0.4.12 110 10/19/2024
0.4.11 111 10/19/2024
0.4.10 109 10/19/2024
0.4.9 76 10/14/2024
0.4.8 74 10/14/2024
0.4.7 102 10/14/2024
0.4.6 84 10/8/2024
0.4.5 76 10/8/2024
0.4.4 78 10/8/2024
0.4.3 75 10/8/2024
0.4.2 77 10/8/2024
0.4.1 76 10/8/2024
0.4.0 79 10/8/2024
0.3.11 78 10/8/2024
0.3.10 113 10/8/2024
0.3.9 77 10/8/2024
0.3.8 87 10/8/2024
0.3.7 74 10/8/2024
0.3.6 74 10/8/2024
0.3.5 75 10/7/2024
0.3.4 77 10/7/2024
0.3.3 116 9/30/2024
0.3.2 86 9/30/2024
0.3.1 88 9/25/2024
0.3.0 77 9/25/2024
0.2.7 86 9/23/2024
0.2.6 89 9/23/2024
0.2.5 86 9/23/2024
0.2.4 86 9/23/2024
0.2.3 83 9/23/2024
0.2.2 121 9/23/2024
0.2.1 81 9/21/2024
0.2.0 86 9/20/2024
0.1.29 81 9/20/2024
0.1.28 75 9/20/2024
0.1.27 80 9/20/2024
0.1.26 82 9/20/2024
0.1.25 84 9/20/2024
0.1.24 91 9/20/2024
0.1.23 102 9/17/2024
0.1.22 92 9/17/2024
0.1.21 90 9/17/2024
0.1.20 90 9/17/2024
0.1.19 96 9/17/2024
0.1.18 90 9/17/2024
0.1.17 96 9/17/2024
0.1.16 94 9/16/2024
0.1.15 147 9/16/2024
0.1.14 91 9/16/2024
0.1.12 93 9/16/2024
0.1.11 94 9/16/2024