| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A CLI tool to generate standardized Git commit messages with ease.
npm install -g @hamzarafique964/git-commit-gen # Install as dev dependency
npm install --save-dev @hamzarafique964/git-commit-gen
# Set up commitlint and husky (optional)
npx commitlint --installnpm install -g @hamzarafique964/git-commit-gengit-commit-genThe tool automatically detects unstaged changes and lets you:
# Make some changes to your files
echo "console.log('new feature');" >> feature.js
# Run the commit wizard
git-commit-gen
# Follow the interactive prompts:
? Select commit type: (Use arrow keys)
❯ feat: A new feature
fix: A bug fix
docs: Documentation changes
chore: Maintenance tasks
style: Code style changes
refactor: Code refactoring
test: Adding tests
? Enter commit message: add new authentication system
🔍 Validating commit message...
✓ Commit message validated!
📝 Generated: "feat: add new authentication system"
? Proceed with commit? Yes
✔ Committed successfully!The package includes built-in support for commit message validation:
# Test a commit message
echo "feat: add new feature" | npx commitlintWhen installed in a project, it sets up Husky hooks to automatically validate commit messages.
Create a commitlint.config.js file in your project root:
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [2, 'always', [
'feat', 'fix', 'docs', 'chore', 'style', 'refactor', 'test'
]]
}
};✅ Valid:
❌ Invalid:
# Add a test script to package.json
npm pkg set scripts.test="echo 'No tests'"
# Or skip hooks temporarily
git commit --no-verifynpm install --save-dev @commitlint/cli @commitlint/config-conventionalContributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
MIT © Hamza Rafique
| Back | FazBrowse Home | New Git URL |