claude-lazygit
v1.1.1
Published
AI-powered commit message generator using Claude Code CLI
Maintainers
Readme
claude-lazygit
AI-powered commit message generator using Claude Code CLI. A variant of bunnai that uses Claude instead of OpenAI.
Features
- Zero config - Uses Claude Code CLI's existing authentication
- High-quality output - Generates one focused commit message with option to regenerate
- Conventional commits - Follows the Conventional Commits specification
- Lazygit integration - One-command install for lazygit custom commands
Prerequisites
- Node.js 18+ installed
- Claude Code CLI installed and authenticated
Installation
# Install globally from npm
npm install -g claude-lazygit
# Or with bun
bun install -g claude-lazygitFrom source
git clone https://github.com/godlyfast/claude-lazygit.git
cd claude-lazygit
bun install
bun run build
npm linkUsage
Generate commit message
# Stage your changes first
git add .
# Generate commit message
claude-lazygit
# Options
claude-lazygit --verbose # Enable verbose outputThe tool generates one high-quality commit message. You can then:
- Accept - Use the message
- Regenerate - Generate a new message
- Cancel - Exit without committing
Install lazygit integration
# Automatically configure lazygit (interactive)
claude-lazygit install
# Skip confirmation prompt
claude-lazygit install -yThis adds a custom command to lazygit. Press Ctrl+A in the files panel to generate AI commit messages.
Manual Lazygit Configuration
If you prefer to configure manually, add to ~/.config/lazygit/config.yml:
customCommands:
- key: "<c-a>"
description: "Generate AI commit message"
context: "files"
command: "claude-lazygit"
subprocess: trueHow it Works
- Gets the staged diff using
git diff --cached - Sends diff to Claude Code CLI with optimized prompt for conventional commits
- Displays the generated commit message
- Allows accept, regenerate, or cancel
- Outputs the accepted message to stdout
Commands
| Command | Description |
| ----------------------------- | ------------------------------------------- |
| claude-lazygit | Generate commit messages for staged changes |
| claude-lazygit install | Install lazygit integration (interactive) |
| claude-lazygit install -y | Install lazygit integration without confirm |
| claude-lazygit uninstall | Remove lazygit integration (interactive) |
| claude-lazygit uninstall -y | Remove lazygit integration without confirm |
| claude-lazygit --help | Show help |
Options
| Option | Alias | Default | Description |
| ----------- | ----- | ------- | --------------------- |
| --verbose | -v | false | Enable verbose output |
License
MIT
