Skip to main content

CLI tool that scans a Git repository and produces a health score (0-100) based on 20+ signals

Project description

Repo Health CLI logo

# repo-health

CI PyPI Python 3.10+ License: MIT

CLI tool that scans a Git repository and produces a health score (0-100) based on 20+ signals.

No single CLI tool gives a holistic repo health score with actionable recommendations. repo-health fills that gap — run it locally, in CI, or as a GitHub Action.

Install

pip install repo-health

Usage

# Scan current directory
repo-health

# Scan specific path
repo-health scan /path/to/repo

# JSON output for CI
repo-health scan --format json --output report.json

# Markdown report
repo-health scan --format markdown --output HEALTH.md

# Generate badge SVG
repo-health badge --output health-badge.svg

# Fail CI if below threshold
repo-health scan --min-score 70

# CI mode (JSON output, non-zero exit on failure)
repo-health scan --ci --min-score 60

Output Example

╭─────────────────────────────────────────────╮
│           🏥 Repository Health Report        │
│           my-project  ·  Score: 78/100  B+   │
╰─────────────────────────────────────────────╯

┌────────────┬───────┬────────────────────────────────┐
│ Category   │ Score │ Details                         │
├────────────┼───────┼────────────────────────────────┤
│ CI/CD      │ 90    │ ✅ CI config, ✅ tests in CI     │
│ Testing    │ 70    │ ✅ Tests exist, ⚠️ No coverage   │
│ Docs       │ 85    │ ✅ README, ✅ LICENSE, ❌ CHANGELOG│
│ Security   │ 60    │ ✅ .gitignore, ❌ SECURITY.md    │
│ Deps       │ 75    │ ✅ Lock file, ⚠️ 3 outdated      │
│ Community  │ 80    │ ✅ Issue template, ❌ COC         │
│ Release    │ 70    │ ✅ Tags, ❌ No release notes      │
│ Git        │ 90    │ ✅ Clean history                  │
└────────────┴───────┴────────────────────────────────┘

💡 Top Recommendations:
  1. Add CHANGELOG.md to track version history
  2. Create SECURITY.md with vulnerability reporting process
  3. Add coverage reporting to CI pipeline

Health Signals (20+)

Category Signals
CI/CD CI config exists, tests run in CI, build step, deploy step
Testing Test files exist, coverage config, coverage threshold
Documentation README quality (sections, badges), CONTRIBUTING, CHANGELOG, LICENSE
Security .gitignore completeness, no secrets in repo, SECURITY.md, dependency audit
Dependencies Manifest exists, lock file, version pinning, audit tool
Community Issue templates, PR templates, CODE_OF_CONDUCT, CONTRIBUTING
Release Tagged releases, semantic versioning, release notes
Git Hygiene Git repo, commit message quality, default branch

Configuration

Create .repo-health.toml in your repo root:

[weights]
ci = 15
testing = 20
documentation = 10
security = 15
dependencies = 10
community = 10
release = 10
git_hygiene = 10

[thresholds]
min_score = 70

[ignore]
scanners = []
files = ["vendor/"]

Or add to pyproject.toml:

[tool.repo-health.weights]
testing = 20

[tool.repo-health.thresholds]
min_score = 70

GitHub Action

- uses: repo-health/repo-health@v1
  with:
    min-score: 60
    format: json

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Run tests: pytest --cov
  4. Submit a pull request

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

repo_health-1.0.0.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

repo_health-1.0.0-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file repo_health-1.0.0.tar.gz.

File metadata

  • Download URL: repo_health-1.0.0.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for repo_health-1.0.0.tar.gz
Algorithm Hash digest
SHA256 22e3b7317f67e1037ba78284a115706733a0506b8943f1818bf544d3ed8f0d78
MD5 d40813df34d3ead7fa2da094104ed275
BLAKE2b-256 774f9779b46fd0fdbafef5b9a3906ed5cc1440f8f0d66297581b2a76c8c42e4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for repo_health-1.0.0.tar.gz:

Publisher: release.yml on bhayanak/repo-health

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file repo_health-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: repo_health-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 23.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for repo_health-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5bf28acd6040bc3b3839d545a02d153333b872c7a74ab4f6cd9acc03a97af0ab
MD5 07e6a75506b5ecaa66e73b15074b305a
BLAKE2b-256 f463e3eadae86b7efe8be697d5b8b14329011dfa98725787612059a4f6ad7717

See more details on using hashes here.

Provenance

The following attestation bundles were made for repo_health-1.0.0-py3-none-any.whl:

Publisher: release.yml on bhayanak/repo-health

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page