npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@phoenixaihub/git-why

v0.1.0

Published

git blame tells you WHO. git-why tells you WHY.

Downloads

128

Readme

git-why

git blame tells you WHO. git-why tells you WHY.

Traces any line of code back through commits → PRs → issues to explain the intent behind a change. No LLM required — pure extraction + template summarization. Fast, free, deterministic.

CI npm License: MIT


Install

npm install -g @phoenixaihub/git-why

Prerequisites:

  • Node.js ≥ 18
  • git CLI
  • gh CLI (for GitHub PR/issue lookups — gh auth login required)

Usage

Explain a line

git-why src/auth/token.ts:42
📌 Line 42: src/auth/token.ts
   const TOKEN_EXPIRY = 3600 * 24;

🔗 Commit: a1b2c3d (2024-03-15) by Jane Smith
   Fix auth token expiry

📋 PR #42: "Fix auth token expiry"
   Extended token lifetime from 1h to 24h after user complaints
   about frequent logouts during long sessions.
   https://github.com/owner/repo/pull/42

🎯 Issue #38: "Users logged out after 1 hour"
   Reported by 12 users. Root cause: default token expiry too aggressive.
   https://github.com/owner/repo/issues/38

✅ Intent: Added in PR #42 ("Fix auth token expiry") to resolve issue #38 ("Users logged out after 1 hour"). Author: Jane Smith. Date: 2024-03-15.

Explain a range of lines

git-why src/auth/token.ts:40-50

Explain why a function exists

git-why src/auth/token.ts --function validateToken

File evolution timeline

git-why src/auth/token.ts --history

Repository intent coverage stats

git-why --stats
📊 Repository Intent Coverage

  Total commits analyzed:   142
  Commits linked to PRs:    78.2% (111)
  Commits linked to issues: 52.1% (74)

  Intent Coverage Score: 67.9% [█████████████░░░░░░░]

  💡 Tip: Good coverage — consider adding issue descriptions.

How it works

  1. git blame — finds the commit SHA for the target line(s)
  2. Ref extraction — scans commit message for #123, closes #N, GH-123, PR URLs
  3. GitHub API (via gh CLI) — fetches PR description + linked issues
  4. Graceful degradation — if no PR found, tries GitHub's commit→PR lookup; if no issue, shows PR only; always useful
  5. Cache — stores results in .git-why/cache.json (TTL: 24h) to avoid re-fetching

Supported ref patterns

| Pattern | Example | Type | |---------|---------|------| | #N | #42 | PR candidate | | closes/fixes/resolves #N | closes #38 | Issue (definitive) | | GH-N | GH-123 | PR candidate | | PR URL | github.com/owner/repo/pull/42 | PR | | Issue URL | github.com/owner/repo/issues/38 | Issue |


VS Code Integration (coming soon)

A VS Code extension will show inline "why" tooltips on hover — powered by git-why under the hood.


License

MIT © Phoenix AI Hub


Architecture

git-why
├── src/
│   ├── cli.ts         # Commander CLI entry point
│   ├── blame.ts       # git blame wrapper + line extraction
│   ├── refs.ts        # Commit message ref pattern extraction
│   ├── github.ts      # gh CLI wrapper for PR/issue lookups
│   ├── cache.ts       # .git-why/cache.json with TTL
│   └── format.ts      # Terminal output formatting
└── tests/

Flow: git blame lineextract commit SHAparse commit message for refsgh api lookup PR + issuerender


CI Setup

# .github/workflows/ci.yml
name: CI
on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - run: npm test
      - run: npm run build

Contributing

See CONTRIBUTING.md.