automaton-git-commit
v1.0.0
Published
AI-powered git commit message generator with security protections
Maintainers
Readme
🤖 automaton-git-commit
AI-powered git commit message generator that analyzes your staged changes and suggests meaningful commit messages.
✨ Features
- 🧠 Smart analysis of git diffs
- 📝 Automatic commit message generation
- 🎯 Follows conventional commits format
- ⚡ Zero configuration required
- 🔒 Security-first design (shell injection protection)
📦 Installation
npm install -g automaton-git-commit🚀 Usage
Basic usage
# Stage your changes
git add .
# Generate and commit
automaton-git-commit commit
# or use the short alias
agc commitInteractive mode
The tool will:
- Analyze your staged changes
- Suggest a commit message
- Ask for your confirmation
- Execute the commit (or let you edit the message)
📝 How it works
- Analyzes your staged changes using
git diff --cached - Detects file types and change patterns
- Generates a commit message following conventional commits format
- Asks for your confirmation before committing
- Uses safe spawn methods to prevent shell injection
🔒 Security Features
This tool implements multiple security measures:
- Shell Injection Protection: Uses
spawnwith argument array instead of string interpolation - Input Validation: Validates commit messages for dangerous characters
- Size Limits: Limits diff analysis to prevent memory issues
- Interactive Confirmation: Always asks before executing git commands
- Git Repository Check: Verifies you're in a git repository before running
⚠️ Safety Notes
- Always review your changes before committing
- The tool shows a summary of changes before suggesting a message
- You can cancel or edit the suggested message at any time
- Never commit sensitive information (passwords, API keys, etc.)
☕ Support
If you find this tool helpful, consider buying me a coffee:
📄 License
MIT © Automaton
