Skip to content

Commitrix - A Git commit quality linter built with Node.js that enforces semantic commit conventions. Features include interactive commit building, smart suggestions, team analytics, and CI/CD integration. Demonstrates CLI development, git hooks, configuration management, and developer tooling expertise.

License

Notifications You must be signed in to change notification settings

ZMelliti/commitrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

40 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Commitrix 🎯

A powerful Git commit quality linter that enforces semantic commit conventions with intelligent suggestions and team collaboration features.

npm version CI License: MIT

✨ Features

  • πŸ” Semantic Commit Validation - Enforces conventional commit format
  • πŸͺ Git Hook Integration - Automatic validation on commit
  • 🎨 Interactive Builder - Guided commit message creation
  • πŸ’‘ Smart Suggestions - Intelligent commit message fixes
  • πŸ“Š Team Analytics - Repository commit statistics
  • βš™οΈ Configurable Rules - Customize for your team
  • πŸš€ CI/CD Ready - Validate commits in pipelines
  • πŸ” Commit Search - Find commits by message, type, or author

πŸš€ Quick Start

# Install globally
npm install -g commitrix

# Initialize in your project
commitrix init

# Install git hooks (auto-runs on npm install)
commitrix install

πŸŽ₯ Demo

# ❌ Invalid commit gets rejected
$ git commit -m "fix bug"
❌ Commit message issues:
  β€’ Must start with: feat, fix, docs, style, refactor, test, chore

πŸ’‘ Suggested fix:
  fix: bug

# βœ… Valid commit passes
$ git commit -m "fix: resolve authentication timeout"
βœ… Commit message looks good!

πŸ“– Usage

# Lint a commit message
commitrix "feat: add user authentication"

# Interactive commit builder
commitrix build

# Get suggestions for invalid commits
commitrix suggest "fix bug"

# View repository statistics
commitrix stats

# Search commit messages
commitrix search "authentication"

# Search by type and author
commitrix search "bug" --type fix --author john

# Validate recent commits (CI/CD)
commitrix validate --count 10

βš™οΈ Configuration

Create .commitrix.json in your project root:

{
  "types": ["feat", "fix", "docs", "style", "refactor", "test", "chore"],
  "maxLength": 72,
  "minLength": 10,
  "scopes": ["api", "ui", "docs"],
  "enforceScope": false
}

πŸ”§ Commands

Command Description
commitrix <message> Lint commit message
commitrix build Interactive commit builder
commitrix install Install git hooks
commitrix init Initialize project
commitrix stats Show commit statistics
commitrix suggest <message> Get suggestions
commitrix validate Validate recent commits
commitrix check Check project setup
commitrix config [key] [value] Show/set configuration
commitrix template --type <type> Generate commit template
commitrix history --count <n> Analyze commit history
commitrix help Show help information
commitrix lint <message> Lint specific message
commitrix fix <message> Auto-fix commit message
commitrix reset Reset config to defaults
commitrix doctor Run health check on setup
commitrix scan --count <n> Scan repository for issues
commitrix benchmark Run performance benchmark
commitrix report --format <fmt> Generate quality report
commitrix search <query> Search commit messages

πŸ“‹ Examples

Health Check

$ commitrix doctor
🩺 Running Commitrix Health Check...
βœ… Git repository detected
βœ… Configuration file found
βœ… Git hook installed
πŸŽ‰ Health check complete: 0 issue(s) found

Repository Scan

$ commitrix scan --count 20
πŸ” Scanning last 20 commits...
πŸ“Š Scan Results:
βœ… Valid commits: 18
❌ Invalid commits: 2
πŸ“ˆ Quality score: 90%

Performance Benchmark

$ commitrix benchmark
⚑ Running Commitrix Performance Benchmark...
πŸ“Š Benchmark Results:
πŸš€ Average per lint: 0.085ms
πŸ“ˆ Throughput: 11,811 lints/second

Commit Search

$ commitrix search "auth"
πŸ” Found 3 matching commits:

a1b2c3d [feat] feat: add user authentication
e4f5g6h [fix] fix: resolve auth token expiry
i7j8k9l [docs] docs: update auth documentation

πŸ“Š Search completed: 3 results

$ commitrix search "bug" --type fix --count 10
πŸ” Found 2 matching commits:

x1y2z3a [fix] fix: resolve login bug
b4c5d6e [fix] fix: fix memory leak bug

πŸ“Š Search completed: 2 results

Quality Report

$ commitrix report
πŸ“Š Commit Quality Report
πŸ“ˆ Quality Score: 96%
βœ… Valid: 26 | ❌ Invalid: 1
πŸ‘₯ Authors: 2
🏷️ Top Types: chore(5), fix(6), feat(8)

πŸ—οΈ CI/CD Integration

Add to your GitHub Actions workflow:

- name: Validate Commits
  run: npx commitrix validate --count 10

πŸ› οΈ Development

# Clone repository
git clone https://github.com/zmelliti/commitrix.git
cd commitrix

# Install dependencies
npm install

# Run tests
npm test

# Test locally
node src/index.js "feat: test message"

🀝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md for guidelines.

πŸ“ License

MIT Β© ZMelliti


Made with ❀️ for the community by Zied MELLITI

About

Commitrix - A Git commit quality linter built with Node.js that enforces semantic commit conventions. Features include interactive commit building, smart suggestions, team analytics, and CI/CD integration. Demonstrates CLI development, git hooks, configuration management, and developer tooling expertise.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published