GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - nguyenvanduocit/ai-commit: CLI tool that use ChatGPT to generate commit message for your git repo.

BranchesTags
Open more actions menu

Latest commit

 

History

154 Commits
154 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
stuff
stuff
 
 
..HEAD
..HEAD
 
 
.gitignore
.gitignore
 
 
.goreleaser.yaml
.goreleaser.yaml
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
client.go
client.go
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
main.go
main.go
 
 
print.go
print.go
 
 

Repository files navigation

upvote

Preview

View Demo

ai-commit

No more headaches with commit messages.

AI-Commit is a command line tool that uses OpenAI's ChatGPT model to generate commit messages for your Git repositories. As a result, you can write meaningful commit messages without having to think about them.

Prerequisites

To use AI-Commit, you need to obtain an API key from OpenAI and set it as the value of the OPENAI_API_KEY environment variable.

export OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Sometime, the ChatGPT's response is not good (too long, too short, not meaningful). In that case, you can try custom the system prompt by set the AI_COMMIT_SYSTEM_PROMPT environment variable:

export AI_COMMIT_SYSTEM_PROMPT="You are a GitCommitGPT-4, You will help user to write commit message, commit message should be short (less than 100 chars), clean and meaningful. Only response the message."

By default, ai-commit use model gpt-3.5-turbo. You can change it by set the AI_COMMIT_MODEL environment variable:

export AI_COMMIT_MODEL="gpt-3.5-turbo"

Note: Using AI-Commit will result in charges from OpenAI for API usage, so be sure to understand their pricing model before use.

Install

There are two ways to install AI-Commit:

Use go

go install github.com/nguyenvanduocit/ai-commit@latest

Prebuilt binaries

You can download prebuilt binaries for Linux, macOS, and Windows from the releases page

Usage

  1. Stage the changes you want to commit in Git.
  2. Run ai-commit command.
  3. The tool will generate a commit message and print it to the console.
  4. Now you can chat with the AI to adjust the commit message. Press ctrl + c to stop.
  5. Finally, select the type of commit.

Auto commit, no interaction

When use -a flag, ai-commit will auto stage all changes then commit with generated message.

ai-commit -a

Auto tag

When use -t flag, ai-commit will auto create tag based on the commit messages between the last tag and the HEAD.

ai-commit -t

Auto push

When use -p flag, ai-commit will auto push to remote.

ai-commit -p

Todo

  • Auto split changes in to multiple commits.
  • Detect commit type.
  • Auto tags?

License

AI-Commit is released under the MIT license. See LICENSE for more information.

Contributing

Contributions are welcome! Please read the contribution guidelines first.

update

About

CLI tool that use ChatGPT to generate commit message for your git repo.

Topics

ai-commitautomachatgptcligitgit-commitopenai

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing
Activity

Stars

103 stars

Watchers

1 watching

Forks

5 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.