Skip to main content

🤖 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...

🚀 Let's Get Started

🤖 Auto Setup

  1. Run the auto setup command:
git_ai_commit hook --setup
  1. Set your OpenAI key:
git_ai_commit config --openai-key=<insert-your-key>

🛠️ Manual Setup

  1. Install the pre-commit git hooks framework
brew install pre-commit
pre-commit --version 
  1. 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
  1. Based on the config above, install your git hooks script
pre-commit install
  1. 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)

Source distribution for prepare-commit-msg-hooks 0.1.4
File Size Uploaded
prepare_commit_msg_hooks-0.1.4.tar.gz 12.3 kB Details

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

Release history Release notifications | RSS feed

This release

0.1.4 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page