Skip to content

Commit

Permalink
Enhance README and update commit message hook logic (#19)
Browse files Browse the repository at this point in the history
* Please set the OPENAI_API_KEY environment variable.
Update readme

* Fix check
  • Loading branch information
guibranco authored Sep 17, 2024
1 parent 5997ec3 commit c8b6ea5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .githooks/prepare-commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ LC_ALL=C

COMMIT_MSG_FILE=$1

if [[ -z "$COMMIT_MSG_FILE" ]]; then
if [[ -n "$COMMIT_MSG_FILE" ]]; then
exit 0
fi

Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# ![GIT Hooks + OpenAI - Generate GIT commit messages from Open AI](docs/images/splash.png)

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

---

## What does I do

Generates a commit message based on `git diff` result using the [OpenAI](https://platform.openai.com/docs/overview) API.

---

## Getting started

```ps
dotnet tool install -g AiCommitMessage
cd my-project/
dotnet-aicommitmessage install-hook
```

1. Install the tool globally.
2. Move to the project folder.
3. Install the Git hook on the default `hooks` directory.

---

0 comments on commit c8b6ea5

Please sign in to comment.