← All tools

aicommit2

Popularity 85 Updated Development & Build

Reactive CLI that generates commit messages for Git and Jujutsu with AI

homebrewauto-collected

Installation

Homebrew
brew install aicommit2

Install with Homebrew.

<div align="center" <div <img src="https://github.com/tak-bro/aicommit2/blob/main/img/demo-min.gif?raw=true" alt="aicommit2"/ <h1 align="center"aicommit2</h1 </div <p A Reactive CLI that generates commit messages for Git, YADM, and Jujutsu with Ollama, ChatGPT, Gemini, Claude, Mistral, and other AI </p </div

<div align="center" markdown="1"

[](https://www.npmjs.com/package/aicommit2) [](https://www.npmjs.com/package/aicommit2) [](#nix-installation) [](https://formulae.brew.sh/formula/aicommit2)

</div

Table of Contents

  • Quick start
  • Introduction
  • Key features
  • Supported providers
  • Setup
  • How it works
  • Version Control Systems
  • Usage
  • Integrations
  • LazyGit
  • Git Hooks
  • Configuration
  • General Settings
  • Diff Compression
  • Logging
  • Custom Prompt Template
  • Code Review
  • Watch Commit Mode
  • Upgrading
  • Contributing

Quick start

# Install via Homebrew (macOS/Linux)
brew install aicommit2

# Or install via npm
npm install -g aicommit2

# Set up AI providers (interactive wizard)
aicommit2 setup

# Or configure manually
aicommit2 config set OPENAI.key=<your-key>

git add . aicommit2

Also works with YADM and Jujutsu repositories (auto-detected)

yadm add <file aicommit2


## Introduction

_aicommit2_ automatically generates commit messages using AI. It supports [Git](https://git-scm.com/), [YADM](https://yadm.io/) (Yet Another Dotfiles Manager), and [Jujutsu](https://github.com/jj-vcs/jj) (jj) repositories with automatic detection. [AICommits](https://github.com/Nutlope/aicommits) inspired the core functionalities and architecture of this project.

## Key features

- **[VCS Support](#version-control-systems)**: Works with Git, YADM, and Jujutsu repositories
- **[Multi-AI Support](#cloud-ai-services)**: Integrates with OpenAI, Anthropic Claude, Google Gemini, Mistral AI, Cohere, Groq, Ollama and more
- **[OpenAI API Compatibility](docs/providers/compatible.md)**: Support for any service that implements the OpenAI API specification
- **[Reactive CLI](#usage)**: Enables simultaneous requests to multiple AIs and selection of the best commit message
- **[Code Review](#code-review)**: AI-powered structured code review with severity levels before committing
  • Git Hook Integration: Can be used as a prepare-commit-msg hook
  • Custom Prompt: Supports user-defined system prompt templates
  • Diff Compression: Reduces token usage by 30-60% with smart diff compression

Supported Providers

| Provider | Default Model | Documentation | |----------|---------------|---------------| | OpenAI | gpt-4o-mini | Guide | | Copilot SDK (Preview) | gpt-4.1 | Guide | | Claude Code (Preview) | sonnet | Guide | | Gemini CLI (Preview) | (CLI default) | Guide | | OpenRouter | openrouter/auto | Guide | | Anthropic | claude-sonnet-4-20250514 | Guide | | Gemini | gemini-3-flash-preview | Guide | | Mistral | mistral-small-latest | Guide | | Codestral | codestral-latest | Guide | | Cohere | command-a-03-2025 | Guide | | Groq | llama-3.3-70b-versatile | Guide | | Perplexity | sonar | Guide | | DeepSeek | deepseek-v4-flash | Guide | | GitHub Models | openai/gpt-4o-mini | Guide | | Bedrock | anthropic.claude-haiku-4-5-20251001-v1:0 | Guide | | Ollama | (user configured) | Guide |