cmt is a CLI tool that automatically generates meaningful commit messages by analyzing your staged changes using I. No API keys required, it uses the Claude Code CLI for authentication.
- AI-Powered Messages - Generates contextual commit messages using Claude AI (supports Haiku, Sonnet, and Opus models)
- AI-Driven Absorb - Intelligently assigns staged hunks to previous commits using semantic analysis (like git-absorb but smarter)
- Interactive Review UI - Built-in TUI for reviewing, regenerating, or editing messages before committing
- Secret Detection - Scans staged files for 15+ secret patterns (AWS keys, GitHub tokens, JWTs, private keys)
- Smart Diff Processing - Filters binary files, minified code, and generated files; truncates large diffs intelligently
- Flexible Configuration - Local
.cmt.yml, global config, and environment variable overrides - No API Keys - Uses Claude Code CLI for authentication (no separate API setup required)
- Claude Code CLI installed and available in your PATH
- Git repository
brew install --cask gussy/tap/cmtDownload the .deb package from GitHub Releases and install:
# Download the latest .deb package
wget https://github.com/gussy/cmt/releases/download/v0.x.x/cmt_0.x.x_amd64.deb
# Install with dpkg
sudo dpkg -i cmt_0.x.x_amd64.deb
# Or install with apt (resolves dependencies automatically)
sudo apt install ./cmt_0.x.x_amd64.debShell completions are automatically installed to standard locations.
Download the .rpm package from GitHub Releases and install:
# Download the latest .rpm package
wget https://github.com/gussy/cmt/releases/download/v0.x.x/cmt_0.x.x_x86_64.rpm
# Install with rpm
sudo rpm -i cmt_0.x.x_x86_64.rpm
# Or install with dnf/yum (resolves dependencies automatically)
sudo dnf install cmt_0.x.x_x86_64.rpmShell completions are automatically installed to standard locations.
Download the .apk package from GitHub Releases and install:
# Download the latest .apk package
wget https://github.com/gussy/cmt/releases/download/v0.x.x/cmt_0.x.x_x86_64.apk
# Install with apk (use --allow-untrusted for unsigned packages)
sudo apk add --allow-untrusted cmt_0.x.x_x86_64.apkShell completions are automatically installed to standard locations.
Download the .pkg.tar.zst package from GitHub Releases and install:
# Download the latest Arch package
wget https://github.com/gussy/cmt/releases/download/v0.x.x/cmt_0.x.x_x86_64.pkg.tar.zst
# Install with pacman
sudo pacman -U cmt_0.x.x_x86_64.pkg.tar.zstShell completions are automatically installed to standard locations.
Download the latest release for your platform from GitHub Releases:
# Download and extract (replace with actual release version and platform)
tar -xzf cmt_darwin_arm64.tar.gz
# Move to your PATH
mv cmt /usr/local/bin/
# Verify installation
cmt --helpShell completions are automatically installed with Homebrew. For manual installations, generate completion scripts for your shell:
Bash:
cmt completion bash > ~/.local/share/bash-completion/completions/cmtZsh:
cmt completion zsh > "${fpath[1]}/_cmt"Fish:
cmt completion fish > ~/.config/fish/completions/cmt.fishAfter installing completions, restart your shell or source your shell configuration file.
Create a .cmt.yml in your project root or ~/.config/cmt/config.yml globally:
model: haiku-4.5 # Options: haiku-4.5, sonnet-4.5, opus-4.1
format: conventional # Options: conventional, gitmoji, semantic
verbose: false
skip_secret_scan: falseSee config.example.yml for all available options.
Override any configuration option with CMT_* prefix:
export CMT_MODEL=sonnet-4.5
export CMT_VERBOSE=true
export CMT_ABSORB_STRATEGY=direct
export CMT_ABSORB_CONFIDENCE=0.8- Stage your changes with
git addor usecmt --stage-all - Run
cmtto analyze your staged changes - Claude AI generates a contextual commit message based on your diff
- Review, edit, or regenerate the message in the interactive UI
- Accept to commit, optionally push with
--push
# Basic usage (commit staged changes)
cmt
# Stage all changes and commit
cmt --stage-all
# Auto-accept generated message
cmt --yes
# Generate and push in one command
cmt --stage-all --push
# Preview changes without committing
cmt diff
# Use a different model
cmt --model sonnet-4.5
# Initialize config file
cmt initThe cmt absorb command uses AI to intelligently assign staged changes to previous commits based on semantic similarity. This is similar to git-absorb but with AI-powered understanding of code context and meaning.
- Analyzes your staged changes and splits them into individual hunks
- Uses AI to match each hunk with the most semantically related previous commit
- Creates fixup commits that can be autosquashed into the target commits
- Provides an interactive UI to review and modify assignments
- Optionally performs an autosquash rebase automatically
# Basic absorb (analyzes unpushed commits)
cmt absorb
# Skip interactive review
cmt absorb --yes
# Analyze specific number of commits
cmt absorb --depth 5
# Analyze all commits back to branch point
cmt absorb --to-branch-point
# Dry run to preview without changes
cmt absorb --dry-run
# Automatically rebase after creating fixup commits
cmt absorb --rebase
# Undo the last absorb operation
cmt absorb --undoAdd to your .cmt.yml:
# Absorb-specific settings
absorb_strategy: fixup # fixup (default) or direct
absorb_range: unpushed # unpushed (default) or branch-point
absorb_ambiguity: interactive # interactive (default) or best-match
absorb_auto_commit: true # Create new commit for unmatched hunks
absorb_confidence: 0.7 # Min confidence threshold (0.0-1.0)# Make various fixes across multiple files
vim src/auth.js # Fix auth bug
vim src/api.js # Update API endpoint
vim tests/auth.js # Fix related test
# Stage all changes
git add -A
# Use AI to absorb changes into relevant commits
cmt absorb
# Review assignments in the interactive UI
# - Navigate with arrow keys or tab
# - Press 'a' to see alternative assignments
# - Press 'u' to unassign a hunk
# - Press 'y' to accept assignments
# Complete with autosquash rebase
git rebase --autosquash -i HEAD~3