AI-powered Git commit message generator using Claude AI.
CommitAid is a CLI tool that uses Claude AI to generate intelligent, context-aware commit messages based on your staged changes. It analyzes your git status and diff, generates a commit message, and lets you edit it before committing.
- π€ AI-generated commit messages using Claude
- βοΈ Interactive editing before committing
- π Conventional Commits format by default
- π¨ Custom commit specifications/guidelines (optional)
- βοΈ Optional automatic Signed-off-by line
- βοΈ Simple configuration management
- Python 3.8+
- Git - Must be installed and in PATH
- Claude CLI - Install from Claude Code documentation
pip install commitaidOr install from source:
git clone https://github.com/yourusername/commitaid.git
cd commitaid
pip install -e .Navigate to your git repository and run:
commitaidThis will:
- Check if you're in a git repository
- Verify Claude CLI is installed
- Install the
/commitaidcommand if needed - Generate a commit message using Claude AI
- Open your editor to review/edit the message
- Create the git commit
By default, CommitAid uses the Conventional Commits specification. You can override this with custom guidelines:
commitaid config set commit-spec "Use Angular commit style with type(scope): description and detailed body"To view the current specification:
commitaid config view commit-specAutomatically add a Signed-off-by line to commits:
commitaid config set auto-signoff enabledTo disable:
commitaid config set auto-signoff disabledView all configuration:
commitaid config viewView specific configuration:
commitaid config view commit-specDisplay help information:
commitaid help| Key | Type | Description |
|---|---|---|
commit-spec |
string | Custom commit message specification/guidelines for Claude (defaults to Conventional Commits) |
auto-signoff |
enabled/disabled | Automatically add Signed-off-by line to commits |
-
Validation: CommitAid checks that you're in a git repository and that required tools (git, claude) are installed
-
Command Installation: If the
/commitaidClaude command doesn't exist, it's automatically downloaded and installed to~/.claude/commands/ -
AI Generation: Claude analyzes your git status and diff to generate a contextual commit message following the Conventional Commits specification (or your custom
commit-specif configured) -
Interactive Editing: The generated message opens in your preferred editor (
$EDITORor$VISUAL, defaults to vim) -
Commit: After you save and close the editor, CommitAid creates the git commit with your message (and optional sign-off)
EDITORorVISUAL- Preferred text editor (defaults to vim)COMMITAID_SPEC- Commit specification (set automatically from config)
- Configuration:
~/.config/commitaid/config.json - Claude command:
~/.claude/commands/commitaid.md - Temporary edit file:
.git/COMMIT_EDITMSG_*.txt
# Stage your changes
git add .
# Generate and create commit
commitaid# Set your commit style
commitaid config set commit-spec "
- Use conventional commits (feat:, fix:, docs:, etc.)
- Keep first line under 72 characters
- Include ticket number if available
- Add detailed explanation in commit body
"
# Generate commits following your specification
commitaid# Enable sign-off
commitaid config set auto-signoff enabled
# All commits will include Signed-off-by line
commitaidInstall Claude CLI from the official documentation.
Ensure you're running commitaid from within a git repository:
git rev-parse --git-dirSet your preferred editor:
export EDITOR=nano # or vim, emacs, code --wait, etc.# Clone repository
git clone https://github.com/yourusername/commitaid.git
cd commitaid
# Install in editable mode
pip install -e .commitaid/
βββ src/
β βββ commitaid/
β βββ __init__.py # Package initialization
β βββ cli.py # CLI entry point and argument parsing
β βββ config.py # Configuration management
β βββ workflow.py # Main workflow logic
βββ pyproject.toml # Package configuration
βββ README.md # This file
MIT License - See LICENSE file for details
Contributions are welcome! Please feel free to submit a Pull Request.
- Built with Claude AI
- Powered by Claude CLI