
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
claude-commit
Advanced tools
AI-powered git commit message generator using Claude AI (API or Claude Code CLI)
🇺🇦 Українська версія | 🇬🇧 English
AI-powered git commit message generator using Claude AI. Supports both Anthropic API and Claude Code CLI (for Claude Pro subscribers).
# Install globally
npm install -g claude-commit
# Or use with npx (no installation needed)
npx claude-commit
Clone or download this repository
git clone https://github.com/uaoa/claude-commit.git
cd claude-commit
Install dependencies
npm install
Make script executable (Unix/Mac)
chmod +x generate-commit.mjs
Add to your project's package.json
{
"scripts": {
"commit": "node path/to/generate-commit.mjs"
}
}
If you have a Claude Pro subscription and want to use the CLI without an API key:
Install Claude Code CLI (if not already installed)
# Follow instructions at: https://docs.claude.com/claude-code
Verify installation
claude --version
Clone this repo and install dependencies
git clone https://github.com/uaoa/claude-commit.git
cd claude-commit
npm install
Get your API key from Anthropic Console
Create .env file in the project root:
ANTHROPIC_API_KEY=sk-ant-your-key-here
COMMIT_LANG=EN # Optional: EN or UA (default: EN)
No configuration needed! Just ensure Claude Code CLI is installed and authenticated.
Stage your changes
git add .
# or
git add specific-file.js
Run the generator
# If installed globally
claude-commit
# If using npm script
npm run commit
# If using npx
npx claude-commit
# With language selection
npm run commit -- --lang=en # English
npm run commit -- --lang=ua # Ukrainian
Review the generated message
Enter or y to confirm and create commite to edit with AI assistance (describe what to fix)n or Esc to cancelWhen you press e, you can describe what needs to be fixed - AI will apply changes automatically!
Examples:
# Add scope
What to fix? add scope "auth"
# feat: added OAuth → feat(auth): added OAuth
# Change type
What to fix? this should be fix, not feat
# feat: added validation → fix: added validation
# Shorten (to 50 chars)
What to fix? shorten to 50 characters
# feat: added new functionality for user authentication through OAuth providers
# → feat: added OAuth authentication
# Fix tense
What to fix? should be in past tense
# feat: add function → feat: added function
# Translate to Ukrainian
What to fix? translate to Ukrainian
# feat: added feature → feat: додано функцію
AI maintains Conventional Commits format and applies changes intelligently!
| Key | Action |
|---|---|
Enter | Confirm and create commit |
y | Confirm and create commit |
e | Open AI-powered editing |
n | Cancel commit |
Esc | Cancel commit |
Ctrl+C | Exit program |
The script generates messages in Conventional Commits format:
<type>(<scope>): <subject>
feat - new featurefix - bug fixrefactor - code refactoringdocs - documentation changesstyle - formatting, stylestest - adding/updating testschore - other changes (build, CI, etc.)perf - performance improvementsEnglish:
feat(auth): added Google OAuth provider
fix(api): fixed validation error
refactor(store): optimized state management
docs(readme): updated installation instructions
style(button): formatted button components
Ukrainian:
feat(auth): додано Google OAuth провайдер
fix(api): виправлено помилку валідації
refactor(store): оптимізовано управління станом
docs(readme): оновлено інструкції встановлення
feat: add feature # WRONG
fix: fix bug # WRONG
feat: додати функцію # WRONG
feat: added feature # CORRECT
fix: fixed bug # CORRECT
feat: додано функцію # CORRECT
The script selects the method in this order:
ANTHROPIC_API_KEY exists)npm run commit -- --lang=en # English
npm run commit -- --lang=ua # Ukrainian
# Add to .env for permanent use
COMMIT_LANG=EN # or UA (default: EN)
Priority:
--lang=COMMIT_LANG$ git add src/auth/oauth.js
$ npm run commit
🚀 Git Commit Generator
📝 Language: English
🤖 Generating commit message via API...
Generated commit message:
feat(auth): added Google OAuth provider
Confirm and create commit?
Enter/y - yes
e - edit
n/Esc - cancel
[Press Enter]
✅ Commit created successfully!
$ git add src/api/users.js
$ npm run commit
🚀 Git Commit Generator
📝 Language: English
🤖 Generating commit message via Claude Code CLI...
Generated commit message:
feat(api): added validation for user endpoint
Confirm and create commit?
Enter/y - yes
e - edit
n/Esc - cancel
[Press e]
Current message: feat(api): added validation for user endpoint
What to fix? this should be fix, not feat
🤖 Editing commit message...
Generated commit message:
fix(api): added validation for user endpoint
Confirm and create commit?
Enter/y - yes
e - edit
n/Esc - cancel
[Press Enter]
✅ Commit created successfully!
$ npm run commit
🚀 Git Commit Generator
📝 Language: Ukrainian
🤖 Generating commit message via API...
⚠️ API unavailable: Invalid API key
Switching to Claude Code CLI...
🤖 Generating commit message via Claude Code CLI...
Generated commit message:
refactor(store): оптимізовано управління корзиною
✅ Commit created successfully!
# Check status
git status
# Add files
git add .
Solution 1 - Use API:
# Add key to .env file
echo "ANTHROPIC_API_KEY=sk-ant-..." >> .env
Solution 2 - Use Claude Code CLI:
# Install Claude Code
# https://docs.claude.com/claude-code
# Verify installation
which claude
claude --version
The script will automatically switch to Claude Code CLI if it's installed.
If CLI is also unavailable:
# Check if Claude Code is installed
which claude
# If not installed, install via instructions
# https://docs.claude.com/claude-code
| Criteria | Claude API | Claude Code CLI |
|---|---|---|
| Cost | ~$0.01-0.02 per commit | Included in subscription |
| Speed | Faster | Slower |
| Reliability | High | Depends on CLI |
| Setup | Requires API key | Requires CLI |
| Offline | ❌ No | ❌ No |
claude-sonnet-4-5-20250929)@anthropic-ai/sdk (optional, for API method)Want to fork and publish your own version? See the Publishing Guide for detailed instructions.
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details
Zakharii Melnyk
Made with ❤️ using Claude AI
FAQs
AI-powered git commit message generator using Claude AI (API or Claude Code CLI)
We found that claude-commit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.