You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42-9Lines changed: 42 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
7
7

8
8
9
-
`AIGitCommit` is a command-line tool that generates meaningful, semantic commit messages from your staged Git changes using AI.
9
+
`AIGitCommit` is a command-line tool that generates meaningful, semantic commit messages from your staged Git changes using AI.
10
10
11
11
It inspects your diffs, summarizes the intent of your changes, and produces clear, concise commit messages that follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification.
12
12
@@ -26,7 +26,7 @@ It inspects your diffs, summarizes the intent of your changes, and produces clea
26
26
- Easy-to-use command-line interface with sensible defaults and confirm prompts (can be skipped with `--yes`).
27
27
- Uses libgit2 via the `git2` crate, avoiding external git commands for improved security and performance.
28
28
- Supports multiple OpenAI-compatible models and configurable API base, token, and proxy settings.
29
-
- Optional auto sign-off of commits when `GIT_AUTO_SIGNOFF=true`.
29
+
- Optional auto sign-off of commits when `AIGITCOMMIT_SIGNOFF=true` or `git config --bool aigitcommit.signoff true`.
30
30
- Proxy support: HTTP and SOCKS5 (set via `OPENAI_API_PROXY`).
31
31
32
32
@@ -83,18 +83,42 @@ Use `--yes` to skip interactive confirmations.
83
83
84
84
### Git hook
85
85
86
-
AIGitCommit ships a `hooks/prepare-commit-msg` hook you can copy into a repository's `.git/hooks/prepare-commit-msg` to automatically generate commit messages during `git commit`.
86
+
AIGitCommit ships a `hooks/prepare-commit-msg` hook that pauses your commit workflow, looks at the staged diff, and pre-populates `COMMIT_EDITMSG` with an AI-generated summary. This lets you fine-tune the final message instead of writing it from scratch.
87
87
88
-
To install globally:
88
+
**Prerequisites**
89
+
-`aigitcommit` must be installed and discoverable on your `PATH`.
90
+
- Required environment variables (`OPENAI_API_TOKEN`, `OPENAI_API_BASE`, etc.) should be configured in your shell before running `git commit`.
After copying, stage some changes and run `git commit`. The hook prints progress messages, writes the suggested commit text, and drops you into your editor so you can adjust the result. To verify the hook without creating a new commit, try `git commit --amend` against a throwaway repository.
102
+
103
+
If you need to disable the hook for a single commit, use `git commit --no-verify`.
104
+
105
+
**Global installation**
106
+
107
+
Install once and reuse across repositories:
89
108
90
109
```bash
91
110
mkdir -p ~/.git-hooks
92
-
# copy the file from this project into ~/.git-hooks/prepare-commit-msg
0 commit comments