sig-chiya
v1.0.5
Published
AI-powered Git commit message generator using Claude API
Maintainers
Readme
Commiti 🤖
AI-powered Git commit message generator using Claude API with Conventional Commits format.
Features
- 🧠 AI-powered: Uses Claude API to analyze staged changes and generate meaningful commit messages
- 📝 Conventional Commits: Follows the Conventional Commits specification
- 🎯 Multiple candidates: Generates multiple commit message options to choose from
- ✏️ Editable: Edit generated messages before committing
- ⚙️ Configurable: Customizable via
.commitirc.jsonfile - 🚫 File exclusion: Exclude specific files/patterns from analysis
- 🌐 Multilingual: Support for Japanese and English
Installation
npm installSetup
- Create a configuration file:
npm run dev -- --config- Edit
.commitirc.jsonand set your Claude API key:
{
"apiKey": "your-claude-api-key-here"
}Or set the environment variable:
export CLAUDE_API_KEY="your-claude-api-key-here"Usage
- Stage your changes:
git add .- Generate and commit:
npm run devDevelopment Commands
# Run in development mode
npm run dev
# Build the project
npm run build
# Create config file
npm run dev -- --config
# Show help
npm run dev -- --helpConfiguration
The .commitirc.json file allows you to customize:
{
"apiKey": "your-claude-api-key",
"model": "claude-3-haiku-20240307",
"conventionalCommits": {
"types": ["feat", "fix", "docs", "style", "refactor", "test", "chore"],
"scopes": ["api", "ui", "db", "auth"],
"maxLength": 50
},
"exclude": [
"*.log",
"node_modules/**",
"dist/**",
"build/**",
"*.lock"
],
"language": "ja",
"generateCount": 3
}Example Workflow
# Make some changes
echo "console.log('Hello, World!');" > hello.js
# Stage the changes
git add hello.js
# Run commiti
npm run devOutput:
🤖 Commiti - Analyzing staged changes...
📋 Staged changes:
1 file changed, 1 insertion(+), 0 deletions(-)
✅ hello.js (+1/-0)
ℹ️ Generating commit message candidates...
🤖 Generated commit message candidates:
1. feat: add hello world example script
2. chore: create initial hello.js file
3. feat(example): implement basic hello world output
✨ Select a commit message: 1
📝 Edit the commit message (press Enter to keep as is):
feat: add hello world example script
📄 Final commit message:
"feat: add hello world example script"
✅ Commit with this message? (y/N): y
🎉 Changes committed successfully!Development
# Install dependencies
npm install
# Run in development mode
npm run dev
# Build for production
npm run buildLicense
MIT
