A small tool to aggregate merged PRs, commits, and additions/deletions per contributor on GitHub. Ships with a terminal TUI and an embedded web UI (Vite + React) inside the same binary.
- Fetches merged PRs, per-PR commit lists, and diff stats via the GitHub API; results are cached locally.
- Contributor table: PR count, commit count, lines added/removed.
- PR trends by week / month / quarter / year; one repo or a multi-select set.
- Co-authored-by trailers in any PR commit message are parsed (
Co-authored-by: … <email>). Onlyusers.noreply.github.comaddresses (includingid+username@form) are turned into a GitHub login. Each person is counted at most once per PR. Primary author and co-authors are all credited for PR count, commit count, and add/del (totals can exceed “unique repo lines” when a PR is shared, by design).
Examples use repo kubeovn/kube-ovn; your data and granularity will differ.
Single-repo view, monthly merge-PR trend plus per-contributor bars (left list + right chart, horizontal scroll for long ranges):
By week — top: repo-wide bar chart with PR counts; below: one row per contributor. Bottom slider scrubs the time range.
By quarter — same layout, quarter-based axis.
Requires Go (see go.mod) and Node.js (to bundle the web UI).
make build # runs frontend build, then go build -> ./commitlensor:
cd frontend && npm install && npm run build
go build -o commitlens .Copy the sample and adjust:
cp config.example.yaml ~/.commitlens/config.yaml| Key | Notes |
|---|---|
github.token |
Optional; if empty, gh auth token is used when available. |
repositories |
List of owner / repo pairs to aggregate. |
cache.dir |
Directory for raw PR data and derived stats. |
web.port |
Web mode port (overridable with --port on the CLI). |
TUI (default):
./commitlens --config /path/to/config.yaml
# or
make runWeb UI:
./commitlens --web --port 8080 --config /path/to/config.yaml
# or
make run-webThe first run syncs from GitHub; you can refresh from the TUI or the web. Aggregation and co-author parsing live under internal/stats (see coauthor.go).
make test
cd frontend && npm run lintcmd/— CLI, sync, wiringinternal/github/— GitHub clientinternal/stats/— aggregation +Co-authored-byinternal/tui/— Bubble Tea TUIinternal/web/— HTTP API + static frontendfrontend/— Vite + React, embedded with//go:embed


