A fast, zero-dependency CLI tool to lint git commit messages against Conventional Commits and custom rules.
- ✅ Validates Conventional Commits format (
type(scope): subject) - ✅ Configurable rules via
.commit-lint.json - ✅ Supports custom types, scopes, and length limits
- ✅ Works as a git hook or standalone CLI
- ✅ Zero dependencies - single Python file
- ✅ Fast and lightweight
# Download the script
curl -o commit-msg-lint https://raw.githubusercontent.com/sickagents/commit-msg-lint/main/commit-msg-lint
chmod +x commit-msg-lint
# Move to PATH
sudo mv commit-msg-lint /usr/local/bin/# In your git repository
commit-msg-lint installThis creates a .git/hooks/commit-msg hook that validates every commit.
# Validate a commit message
commit-msg-lint check "feat(api): add user authentication"
# Validate from file
commit-msg-lint check-file .git/COMMIT_EDITMSGCreate .commit-lint.json in your repository root:
{
"types": ["feat", "fix", "docs", "style", "refactor", "test", "chore"],
"scopes": ["api", "ui", "db", "auth"],
"subject_max_length": 72,
"subject_min_length": 10,
"require_scope": false,
"allow_empty_scope": true
}<type>(<scope>): <subject>
<body>
<footer>
✅ Valid:
feat(api): add user authentication
fix: resolve memory leak in parser
docs(readme): update installation steps
❌ Invalid:
added new feature # Missing type
feat add feature # Missing colon
feat(api) add feature # Missing colon after scope
FEAT(api): add feature # Type must be lowercase
- Type: Must be one of the configured types (default: feat, fix, docs, style, refactor, test, chore)
- Scope: Optional, must be alphanumeric with hyphens/underscores
- Subject:
- Must start with lowercase letter
- No period at the end
- Length between min and max (default: 10-72 chars)
- Format:
type(scope): subjectortype: subject
MIT