Skip to content

faetschi/git-gen-commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-gen-commit

AI-powered commit message generator for Git, with PowerShell & Git Bash support and Ollama LLM backend.

Features

  • Generates high-quality, conventional commit messages using local or remote LLMs (Ollama API)
  • Interactive menu: commit, edit, regenerate, shorten, or add context to messages
  • Supports custom model selection and configuration
  • Works in PowerShell and Windows environments
  • Easily extensible and configurable

Installation

  1. Open PowerShell

  2. Navigate to the project directory:

    cd path\to\git-gen-commit
  3. Set execution policy (if needed):

    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
    
  4. Adjust your Ollama API URL in git-gen-commit.ps1

  5. Run the installer:

    .\installer.ps1

Configuration

  • The tool uses a model-config.json file for model and prompt settings.
  • You can adjust the Ollama API URL, model names and prompt templates in this file after installation.
  • Default config location: C:\Users\<YourUser>\bin\git-gen-commit\model-config.json

Usage

After installation, use from any terminal in a Git repository:

git gen-commit

Options

  • -h Output all usage guide
  • --only-message Output only the commit message, useful for scripting
  • --verbose Enable verbose output
  • --model MODEL Specify model variant
  • --set-model MODEL Set the model for commit message generation
  • --reset Reset configuration to defaults
  • --context NUM Set diff context lines (default: 3)
  • --limit NUM Limit response to maximum number of characters

Requirements

  • PowerShell 7+ recommended
  • Git must be installed and available in PATH
  • Access to an Ollama server (local or remote)

Planned Features

  • Ability to select custom external LLM provider (OpenAI, Anthropic, etc.)
  • More configurable parameters (e.g. LLM params like temperature, top_p, etc.)
  • Cross-platform installer (Linux, macOS, Windows)
  • Enhanced prompt customization (per-project templates)
  • Unit and integration tests
  • VS Code extension integration
  • Improved error handling
  • Support for multi-language commit messages

Contributing

Pull requests and issues are welcome!

Please open an issue for bugs or feature requests.

License

MIT - Free to use, modify, and distribute. No warranty provided.

About

Script to generate git commit messages using local LLMs via git alias (git gen-commit)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published