explaingit

nutlope/aicommits

8,972TypeScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

A command-line tool that reads your staged git changes and uses an AI service to automatically write a commit message for you, saving time and improving consistency.

Mindmap

mindmap
  root((repo))
    What it does
      Auto git commit messages
      Reads staged diff
      AI-powered
    Providers
      TogetherAI
      OpenAI
      Groq
      Ollama local
    Formats
      Plain text
      Conventional Commits
      Gitmoji
    Setup
      npm global install
      Git hook option
      Config file
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Automatically generate a git commit message from your staged diff instead of typing one by hand.

USE CASE 2

Install as a git hook so every `git commit` command triggers AI message generation before your editor opens.

USE CASE 3

Generate multiple commit message options at once and pick the one that best describes your change.

USE CASE 4

Produce Conventional Commits or gitmoji-formatted messages to match your team's changelog conventions.

Tech stack

TypeScriptNode.jsnpm

Getting it running

Difficulty · easy Time to first run · 5min

Requires Node.js v22+ and an API key for at least one supported AI provider (TogetherAI is recommended and free-tier friendly).

No license information is mentioned in the explanation.

In plain English

AI Commits is a command-line tool that automatically writes git commit messages for you by analyzing the code changes you have staged. Instead of thinking up a message yourself, you run the tool after staging your files and it calls an AI service to describe what changed. The project has around 8,900 GitHub stars and is written in TypeScript. Getting started requires Node.js v22 or higher. You install the package globally through npm and then run a setup command that walks you through picking an AI provider and entering your API key. The tool supports a range of providers including TogetherAI (listed as the recommended choice), OpenAI, Groq, xAI, OpenRouter, and two options for running models locally on your own machine via Ollama or LM Studio. You can also point it at any service that speaks the OpenAI API format. Once set up, you stage your files the normal way and then call the tool instead of typing a commit message by hand. It reads the diff, sends it to whichever AI you configured, and returns a suggested message. You can ask it to generate several options at once and pick the one you like best, though generating more uses more tokens. The tool also supports three commit message formats: plain text, the Conventional Commits style that many teams use for changelogs, and a gitmoji format that adds emoji prefixes. For teams or individuals who prefer to stay in a standard git workflow, the tool can install itself as a git hook. With the hook in place, you just run git commit as usual and the tool intercepts it, generates a message, and opens your editor so you can review or adjust before finalizing. You can override it at any time by passing your own message directly. Configuration can be managed through a config file in your home directory, environment variables, or command-line flags, with flags taking the highest priority. A custom prompt flag lets you steer the style of the output, for example asking for messages in a specific language or with a particular level of technical detail.

Copy-paste prompts

Prompt 1
I just installed aicommits, walk me through running `aicommits config set` to pick TogetherAI as my provider and set my API key.
Prompt 2
Show me how to install aicommits as a git prepare-commit-msg hook so it runs automatically on every `git commit`.
Prompt 3
How do I tell aicommits to generate 3 message options in Conventional Commits format so I can pick the best one?
Prompt 4
How do I configure aicommits to write commit messages in Spanish using a custom prompt flag?
Open on GitHub → Explain another repo

← nutlope on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.