Skip to content

joeeeeey/ai-commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ai-commit

Automatically generate commit messages with AI whenever you run git commit.
This repo provides a cross-platform Go binary and a Git prepare-commit-msg hook that integrates an AI prompt.


Demo

Here's a quick GIF showing how ai-commit works in action:

demo gif


Quick Install

Install by CURL

The following command will auto add git-hook under the current directory with .git

curl -sL https://raw.githubusercontent.com/joeeeeey/ai-commit/main/install.sh | bash

Uninstall

# cd $dir_with_git
rm .git/hooks/prepare-commit-msg
rm .git/hooks/commit_msg_generator

Test by curl

curl -X POST 'https://api.dify.ai/v1/workflows/run' \
--header "Authorization: Bearer ${AI_COMMIT_TOKEN}" \
--header 'Content-Type: application/json' \
--data-raw '{
    "inputs": {
      "repo_name": "k8s",
      "diff_text": "-    local prodReplicas = if context.Region == 'us-west-1' then 9 else 1, \n+    local prodReplicas = if context.Region == 'us-west-1' then 1 else 1,"
  },
    "response_mode": "blocking",
    "user": "abc-123"
}'

About

Generate commit message automatically.

Resources

Stars

Watchers

Forks

Packages

No packages published