SkillsApr 6, 2026·2 min read

AI Commit — Auto-Generate Git Commits with AI

CLI tool that generates conventional commit messages from your staged changes using AI. Supports Claude, GPT-4, and local models. One command for perfect commit messages. 3,000+ stars.

TL;DR
AI Commit generates conventional commit messages from your staged diffs using LLMs.
§01

What it is

AI Commit is a CLI tool that generates conventional commit messages from your staged Git changes using AI. You stage your changes with git add, run the AI Commit command, and it analyzes the diff to produce a clear, descriptive commit message following conventional commit format. It supports Claude, GPT-4, and local models.

This tool targets developers who want consistently formatted commit messages without spending time writing them. It reads the actual code diff, understands what changed, and produces messages that describe the why rather than just listing file names.

§02

Why it saves time or tokens

Writing good commit messages takes thought. Most developers default to lazy messages like 'fix bug' or 'update code' because proper messages feel like overhead. AI Commit removes this friction by generating descriptive messages automatically. The tool sends only the staged diff to the AI, keeping token usage proportional to the change size rather than the entire codebase.

§03

How to use

  1. Install the CLI tool globally: npm install -g aicommit or via your preferred package manager
  2. Configure your preferred AI provider and API key
  3. Stage changes and run: aicommit to generate and apply a commit message
§04

Example

# Stage your changes
git add src/auth/login.ts src/auth/session.ts

# Generate commit message
aicommit

# Output:
# feat(auth): add session refresh on token expiry
#
# - Check token expiration before API calls
# - Refresh session automatically when within 5min of expiry
# - Add retry logic for failed refresh attempts
FeatureDescription
Conventional commitstype(scope): description format
Multi-modelClaude, GPT-4, Ollama, local models
Diff-basedAnalyzes actual code changes
InteractiveReview and edit before committing
ConfigurableCustom prompts and templates
§05

Related on TokRepo

§06

Common pitfalls

  • Very large diffs exceed model context limits; commit smaller, focused changes for better message quality
  • The generated message reflects what the AI infers, not your intent; always review before accepting
  • API key configuration varies by tool version; check the documentation for the correct environment variable or config file format

Frequently Asked Questions

What AI models does AI Commit support?+

AI Commit supports multiple providers including OpenAI (GPT-4, GPT-4o), Anthropic (Claude), and local models through Ollama. You configure the provider and model in a config file or environment variable. Some versions also support Google Gemini and other providers.

Does AI Commit follow conventional commit format?+

Yes. AI Commit generates messages in conventional commit format: type(scope): description. Types include feat, fix, refactor, docs, test, chore, and others. The scope is inferred from the changed file paths. You can customize the prompt to match your team's commit conventions.

How much does AI Commit cost per commit?+

Cost depends on the AI provider and diff size. A typical commit with a few hundred lines of diff costs a fraction of a cent with cloud providers. Using local models through Ollama makes it completely free. The tool sends only the staged diff, not your entire codebase.

Can I use AI Commit in CI/CD pipelines?+

AI Commit is designed for interactive local development, not CI/CD. In CI, commits are already made. However, you could use it in a pre-commit hook or a squash-merge workflow where the final commit message needs generating. Run it in non-interactive mode for automated contexts.

How do I customize the commit message format?+

Most AI Commit tools support custom prompts or templates. You can specify the commit types you use, require certain scopes, or add custom instructions like including ticket numbers. Check your specific tool's configuration for prompt customization options.

Citations (3)
🙏

Source & Thanks

Created by Nutlope. Licensed under MIT.

aicommits — ⭐ 3,000+

Thanks for eliminating "fix stuff" commits forever.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets