
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.
smart-committer
Advanced tools
AI-assisted commit message generator that analyzes your code diffs (powered by Claude and other AI models)
AI-assisted commit message generator that analyzes your code diffs using multiple AI models (Claude and OpenAI).
npm install -g smart-committer
smart-committer [options]
--model <model> AI model to use (claude, openai) [default: claude]
--model-version <version> Specific model version (haiku, sonnet, opus for Claude; 4, 4-turbo, 3.5-turbo for OpenAI)
--diff <source> Diff source: staged, unstaged, all [default: staged]
--style <style> Commit message style: plain, conventional, emoji, gitmoji [default: plain]
--lang <lang> Language for commit message [default: en]
--batch Batch mode for analyzing multiple commits
--prompt <prompt> Custom prompt template
--config <path> Path to config file [default: .smartcommitter.json]
--apply Apply the generated message and commit changes
--dry-run Show what would be done without actually committing
--max-diff-size <size> Maximum diff size in characters [default: 10000]
--detect-scope Automatically detect scope from file paths
--scope <scope> Manually specify scope for conventional commits
--interactive Enable interactive mode to refine the commit message
--learn-history Analyze commit history to learn project conventions
--ensemble Use multiple AI models for generation
--template <name> Use a specific commit template
--analyze Generate commit statistics and insights
Install dependencies:
npm install
Set up your API keys:
CLAUDE_API_KEY=your_claude_api_key_hereOPENAI_API_KEY=your_openai_api_key_hereCreate a .env file in your project root or home directory:
CLAUDE_API_KEY=your_claude_api_key_here
OPENAI_API_KEY=your_openai_api_key_here
Basic usage:
git add .
smart-committer
Using conventional commit format with automatic scope detection:
smart-committer --style conventional --detect-scope
Using interactive mode to refine the commit message:
smart-committer --interactive
Using OpenAI model with ensemble generation:
smart-committer --model openai --ensemble
Batch mode for multiple commits:
smart-committer --batch
Using a custom template:
smart-committer --template conventional
Analyzing commit history and generating statistics:
smart-committer --learn-history --analyze
Using a config file:
smart-committer --config ./commit-config.json
Create a smart-committer.config.json file with your preferred settings:
{
"model": "claude-3-haiku-20240307",
"style": "conventional",
"lang": "en",
"diff": "staged",
"batch": false,
"detectScope": false,
"interactive": false,
"learnHistory": false,
"ensemble": false,
"template": "",
"templatesDir": "./commit-templates",
"analyze": false,
"hooks": {
"autoStage": false,
"fallbackMessage": "chore: auto-commit"
}
}
AI-assisted commit message generator for Git, powered by Claude. Generate clear, consistent, and customizable commit messages for any workflow.
Install dependencies:
pnpm install
# or
npm install
Set up your Claude API key:
Create a .env file in your project root:
CLAUDE_API_KEY=sk-...
(Optional) Create a config file:
smart-committer.config.json to your project root to set defaults (see below).Run the CLI:
node cli.js --commit
# or, if installed globally:
smart-committer --commit
Automatically detect the scope of changes based on file paths and include it in conventional commit messages.
smart-committer --style conventional --detect-scope
# or manually specify scope
smart-committer --style conventional --scope api
Refine AI-generated commit messages interactively with options to accept, edit, regenerate, or cancel.
smart-committer --interactive
Learn project conventions by analyzing previous commit messages.
smart-committer --learn-history
Generate commit messages using multiple AI models simultaneously.
smart-committer --ensemble
Use custom commit templates with variable substitution.
smart-committer --template conventional
Create templates in the ./commit-templates directory with variables like {{scope}}, {{style}}, {{lang}}, etc.
Generate analytics and insights on commit patterns.
smart-committer --analyze
Improved Git hook functionality with auto-stage and fallback message options.
Install hooks with:
node install-hook.js
--extra-prompt.smart-committer.config.json.smart-committer.config.json)Create this file in your repo root to set persistent defaults:
{
"model": "claude-3-haiku-20240307",
"style": "conventional",
"lang": "en",
"diff": "staged",
"type": "feat",
"extraPrompt": "",
"batch": false,
"detectScope": false,
"interactive": false,
"learnHistory": false,
"ensemble": false,
"template": "",
"templatesDir": "./commit-templates",
"analyze": false,
"hooks": {
"autoStage": false,
"fallbackMessage": "chore: auto-commit"
}
}
Precedence: CLI > config file > built-in defaults
| Option | Description |
|---|---|
--model <model> | Claude model to use (e.g., claude-3-haiku-20240307, claude-3-sonnet-20240229) |
--style <style> | Commit message style: plain, conventional, semantic, summary-body |
--lang <lang> | Language for the commit message (en, es, fr, de, zh, etc.) |
--diff <source> | Diff source: staged, unstaged, all |
--type <type> | Commit type for conventional style (feat, fix, chore, etc.) |
--extra-prompt <t> | Extra context to guide the AI (e.g., "security fix") |
--commit | Directly create a git commit with the generated message |
--batch | Batch mode: generate messages for a commit range |
--detect-scope | Automatically detect scope from file paths |
--interactive | Enable interactive mode to refine commit messages |
--learn-history | Analyze commit history to learn project conventions |
--ensemble | Use multiple AI models for generation |
--template <name> | Use a specific commit template |
--analyze | Generate commit statistics and insights |
Examples:
smart-committer --style conventional --detect-scope --commit
smart-committer --diff all --interactive --commit
smart-committer --ensemble --model claude-3-sonnet-20240229
smart-committer --template conventional --lang fr
Create custom commit templates in the ./commit-templates directory. Templates support variable substitution:
{{scope}} - Commit scope (detected or specified){{style}} - Commit style (conventional, plain, etc.){{lang}} - Language{{model}} - AI model being used{{diff}} - Git diff content{{detectedScope}} - Automatically detected scopeExample template (commit-templates/conventional.txt):
Generate a conventional commit message for the following code changes.
{{#if detectedScope}}Use the scope "{{detectedScope}}" if appropriate.{{/if}}
{{#if scope}}Use the specified scope "{{scope}}" if appropriate.{{/if}}
Git diff:
{{diff}}
Format the commit message as: <type>(<scope>): <description>
Generate commit messages for a range of commits (e.g., after rebase):
smart-committer --batch
You will be prompted for a commit range (e.g., HEAD~3..HEAD).
Install a prepare-commit-msg hook to auto-suggest messages:
node install-hook.js
This creates .git/hooks/prepare-commit-msg that runs smart-committer. Edit install-hook.js to customize style/language.
Enhanced hook features:
hooks section in your config fileGenerate detailed analytics on your commit patterns:
smart-committer --analyze
This provides insights on:
CLAUDE_API_KEY or OPENAI_API_KEY in your .env file.smart-committer.config.json if parsing fails.MIT
FAQs
AI-assisted commit message generator that analyzes your code diffs (powered by Claude and other AI models)
We found that smart-committer 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.