🤖 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-commitgit 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-commitgit hooks framework
brew install pre-commit
pre-commit --version
- Create a
.pre-commit-config.yamlfiles 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
Metadata
Release files for prepare-commit-msg-hooks 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| prepare_commit_msg_hooks-0.1.4.tar.gz | 12.3 kB | Without provenance | Details for prepare_commit_msg_hooks-0.1.4.tar.gz |
Release files / prepare_commit_msg_hooks-0.1.4.tar.gz
| Download URL | prepare_commit_msg_hooks-0.1.4.tar.gz |
|---|---|
| Size | 12.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3de993f20508cf5be7095311a03e5facc45ba26d63683f6b9c7d6d8058105fa3
|
|
BLAKE2b-256 checksum How to use checksums |
60d1bb7bda3bec5a917756ad852b058be89ad52414cca0920025f970d490aad9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.6
|
Security for prepare-commit-msg-hooks 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.