A project to generate commit messages using AI
Project description
🤖 AI Commit Message
📚 Table of Contents
🚀 Tl;DR
-
🤖 An pre-commit hook that generates the perfect commit message for you
-
🌐 Supports all projects and programming languages, built on the
pre-commit
git hooks framework -
🔗 Works alongside all your other git hooks
📺 Usage
TODO - Insert video of usage
This tool currently supports the following LLM source...
-
Open AI: gpt-4o-mini(default), gpt-4o, gpt-3.5
-
Anthropic: claude-3-haiku, claude-3-sonnet, claude-3-opus
-
Local Ollama: llama3, mistral, phi-3, gemma
🚀 Let's Get Started
🤖 Auto Setup
- Run the auto setup command:
git_ai_commit hook --setup
- Set your OpenAI key:
git_ai_commit config --openai-key=<insert-your-key>
🛠️ Manual Setup
- Install the
pre-commit
git hooks framework
brew install pre-commit
pre-commit --version
- Create a
.pre-commit-config.yaml
files and add the following config
touch .pre-commit-config.yaml
🚨 Make sure you include prepare-commit-msg
in default_install_hook_types
🚨
default_install_hook_types:
- prepare-commit-msg
repos:
- repo: https://github.com/ming1in/ai-commit-msg
rev: v0.0.1
hooks:
- id: git_ai_commit
- Based on the config above, install your git hooks script
pre-commit install
- Setup your OpenAI key, see their docs for help
git_ai_commit config --openai-key=<insert-your-key>
🛠️ CLI
Subcommands
✨ config: This subcommand allows you to show your current config settings
git_ai_commit config
Config flags are used to configure various settings in your configuration.
-
🔑 --openai-key, -k: This flag allows you to set a new or update the OpenAI API key for the CLI to use. Replace
<your-new-key>
with your actual API key to enable the functionality.git_ai_commit config --openai-key=<your-new-key>
-
🔑 --anthropic-key, -a: This flag allows you to set or update the Anthropic API key for AI-powered commit messages.
git_ai_commit config --anthropic-key=<your-anthropic-key>
-
🌐 --ollama-url, -ou: This flag allows you to set the Ollama URL for local LLM models.
git_ai_commit config --ollama-url=<ollama-url>
-
🔄 --reset, -r: Use this flag to reset the entire configuration database to its default state.
git_ai_commit config --reset
This will reset all settings, including the OpenAI API key and logger status
-
🖨️ --logger, -l: This flag displays the log status for the CLI
git_ai_commit config --logger=<boolean>
-
🧠 --model, -m: This flag allows you to set the OpenAI model to use for generating commit messages.
git_ai_commit config --model=<model-name>
-
📚 help, -h: This subcommand displays a list of all available commands and their usage, helping users understand how to interact with the CLI.
git_ai_commit help
🤝 Wanna Contribute?
If you would like to contribute code and improve our product, please read our Local Development Wiki
🎉 Fun Facts
- Every commit prefixed with
✨
was generated by AI
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file prepare_commit_msg_hooks-0.1.4.tar.gz
.
File metadata
- Download URL: prepare_commit_msg_hooks-0.1.4.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3de993f20508cf5be7095311a03e5facc45ba26d63683f6b9c7d6d8058105fa3 |
|
MD5 | 0bd0711e7ac768a3ff0369c7e3b83c29 |
|
BLAKE2b-256 | 60d1bb7bda3bec5a917756ad852b058be89ad52414cca0920025f970d490aad9 |