ivuorinen/branch-usage-checker

GitHub Project branch usage checker.

Installs: 4

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 1

Type:project

pkg:composer/ivuorinen/branch-usage-checker

0.1.1 2024-11-07 07:25 UTC

This package is auto-updated.

Last update: 2026-03-02 01:06:12 UTC


README

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.