GPHC (pronounced "githlth") is a Command-Line Interface (CLI) tool written in Go that audits local Git repositories against established Open Source best practices. It evaluates documentation quality, commit history standards, and repository hygiene, providing a comprehensive Health Score with actionable feedback.
# Install from GitHub
go install github.com/vahidaghazadeh/gphc/cmd/gphc@latest
# Or install from local source
git clone https://github.com/vahidaghazadeh/gphc.git
cd gphc
go install ./cmd/gphc
# Setup as git subcommand
./setup-git-hc.sh# Check current directory (must be a git repository)
git hc check
# Check specific repository
git hc check /path/to/repository
# Run pre-commit checks on staged files
git hc pre-commit
# Launch interactive terminal UI
git hc tui
# Start web dashboard server
git hc serve
# Scan multiple repositories
git hc scan ~/projects --recursive
# Analyze and manage Git tags
git hc tags --suggest --changelog CHANGELOG.md
# Scan for secrets in Git history
git hc security secrets --history
# Scan transitive dependencies for vulnerabilities
git hc security dependencies --depth deep
# Validate Git security policies
git hc security policy --check-signing
# Audit executable and large files
git hc security binaries --max-size 50mb
# Update GPHC to latest version
git hc update
# Show version information
git hc version
# Show help
git hc --help- Documentation & Project Structure: Essential files validation, setup instructions, gitignore checks
- Commit History Quality: Conventional commits, message length validation, commit size analysis
- Git Cleanup & Hygiene: Branch cleanup, stale branch detection, stash management
- Pre-commit Hook Mode: Fast execution for staged files with exit codes for CI/CD
- Historical Health Tracking: Track project health over time with trend analysis
- Multi-Repository Scan: Analyze multiple repositories simultaneously
- CI/CD Integration: Quality gates and pipeline integration
- Custom Rules Engine: Define project-specific health checks
- Slack/Webhook Notifications: Team notifications and real-time updates
- Semantic Commit Verification: Verify commit messages match actual changes
- Interactive Terminal UI (TUI): Beautiful terminal interface for health monitoring
- Web Dashboard: Local web server for team collaboration
- Tag Management: Git tag validation, semantic versioning, and release management
- Secret Scanning: Deep scan of Git history for exposed secrets and credentials
- Transitive Dependency Vetting: Comprehensive analysis of direct and indirect dependencies for security vulnerabilities
- Git Policy Validation: Validate Git security policies including commit signatures, push policies, and sensitive file detection
- Binary File Audit: Scan for executable files, large files, and suspicious file types that pose security risks
Detailed documentation for each feature is available in the docs/ directory:
- π Basic Usage - Getting started with GPHC
- π§ Git HC Integration - Using GPHC as git subcommand
- π Health Checks - Understanding health check categories
- π§ Pre-commit Hooks - Pre-commit integration guide
- π Historical Tracking - Health trend analysis
- π Multi-Repository Scan - Batch repository analysis
- π CI/CD Integration - Pipeline integration guide
- βοΈ Custom Rules - Custom rule engine configuration
- π’ Notifications - Slack and webhook setup
- β Semantic Commits - Commit verification guide
- π₯οΈ Terminal UI - Interactive terminal interface
- π Web Dashboard - Web server and team collaboration
- π€ Export Formats - Report export options
- π GitHub Integration - GitHub API integration
- π GitLab Integration - GitLab API integration
- π₯ Author Insights - Contributor analysis
- ποΈ Codebase Analysis - Structure and smell detection
- π·οΈ Tag Management - Git tag validation and release management
- π Secret Scanning - Git history secret detection and remediation
- π‘οΈ Transitive Dependency Vetting - Deep dependency vulnerability analysis
- βοΈ Git Policy Validation - Git security policy validation and compliance
- π Binary File Audit - Executable and large file security audit
$ git hc check
Git Project Health Checker
==========================
Repository: /path/to/project
Last Updated: 2024-01-15 10:30:00
Overall Health Score: 85/100 (B+)
Status: PASS
Documentation & Project Structure: 90/100 (A-)
Commit History Quality: 85/100 (B+)
Git Cleanup & Hygiene: 80/100 (B-)
Codebase Structure: 75/100 (C+)
Summary:
Total Checks: 12
Passed: 8
Failed: 2
Warnings: 2Create a gphc.yml file in your repository root to customize behavior:
# Custom rules
custom_checks:
- id: CUSTOM-900
name: "Has SECURITY.md"
path: "SECURITY.md"
score: 5
# Server configuration
server:
port: 8080
host: "localhost"
auth:
enabled: false
# Dashboard settings
dashboard:
title: "My Project Dashboard"
theme: "dark"
refresh_interval: "30s"We welcome contributions! Please see our Contributing Guide for details.
This project is licensed under the MIT License - see the LICENSE file for details.
- π Documentation - Comprehensive guides for all features
- π Issues - Report bugs or request features
- π¬ Discussions - Community discussions
- π§ Contact - Direct support
- Basic health checks
- Documentation validation
- Commit history analysis
- Git hygiene checks
- Pre-commit hook mode
- Export formats (JSON, YAML, Markdown, HTML)
- Health badges
- GitHub/GitLab integration
- Commit author insights
- Codebase smell detection
- Multi-repository analysis
- Historical trend analysis
- Team collaboration metrics
- Integration with popular Git hosting platforms
- Interactive Terminal UI (TUI)
- Web Dashboard
Made with β€οΈ for the Open Source community