Files
branch-usage-checker/README.md
Ismo Vuorinen d09d1c262f docs: rewrite README with install, usage, and dev sections (#47)
The previous README was minimal (17 lines). Expand it with requirements,
installation (Composer + PHAR), usage with example output, development
commands, and a CI status badge.
2026-02-24 21:49:12 +02:00

3.8 KiB

Branch Usage Checker

Packagist Version License CI

A CLI tool that cross-references GitHub branches with Packagist download statistics to identify branches safe to delete. Configure a lookback window (default 9 months), review a statistics table of per-branch downloads, and get a suggestion list of zero-download branches you can clean up.

Requirements

  • PHP 8.4+

Installation

Composer (global)

composer global require ivuorinen/branch-usage-checker

PHAR

Download the latest branch-usage-checker PHAR from GitHub Releases, then:

chmod +x branch-usage-checker
./branch-usage-checker check <vendor/package>

Usage

branch-usage-checker check <vendor/package> [months]
Argument Description Default
vendor/package Packagist package name
months Months to look back 9

Example

$ branch-usage-checker check ivuorinen/branch-usage-checker 6

 Branch usage statistics for ivuorinen/branch-usage-checker
 ┌────────────────────┬────────┬────────┬────────┬────────┬────────┬────────┐
 │ Branch             │ 2025-7 │ 2025-8 │ 2025-9 │ 2025-… │ 2025-… │ 2025-… │
 ├────────────────────┼────────┼────────┼────────┼────────┼────────┼────────┤
 │ dev-master         │     42 │     38 │     51 │     47 │     55 │     60 │
 │ dev-feat/dto       │      0 │      0 │      0 │      0 │      0 │      0 │
 │ dev-fix/timeouts   │      3 │      1 │      0 │      0 │      0 │      0 │
 └────────────────────┴────────┴────────┴────────┴────────┴────────┴────────┘

 Suggestions — branches with zero downloads (safe to delete)
 ┌────────────────────┐
 │ Branch             │
 ├────────────────────┤
 │ dev-feat/dto       │
 └────────────────────┘

Development

git clone https://github.com/ivuorinen/branch-usage-checker.git
cd branch-usage-checker
composer install
Command Description
composer test Run tests (Pest)
composer lint Check code style (PHPCS, PSR-12)
composer format Auto-fix code style (PHPCBF)
composer build Build PHAR to builds/

Pre-commit hooks (CaptainHook) are installed automatically and will run PHPCBF + PHPCS on staged PHP files.

License

MIT — see LICENSE for details.