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

ghlog

v0.2.0

Published

Fetch commit history from a GitHub organization and output structured JSON or LLM-friendly Markdown

Downloads

193

Readme

ghlog

Fetch commit history from a GitHub organization and output structured JSON or LLM-friendly Markdown. Feed the output to Claude to generate polished changelogs for a multi-repo organization.

Installation

npm install -g ghlog

Or run directly:

npx ghlog --org my-org --since 2026-01-01

Authentication

ghlog needs a GitHub token. It tries these in order:

  1. GitHub CLI - if gh is installed and authenticated, it uses gh auth token
  2. Environment variable - set GITHUB_TOKEN
# Option 1: GitHub CLI (recommended)
gh auth login

# Option 2: Environment variable
export GITHUB_TOKEN=ghp_...

Usage

ghlog --org <name> --since <date> [options]
ghlog --org <name> --since-map <file> [options]

Required:
  --org, -o <name>        GitHub organization name

Required (one of):
  --since, -s <date>      Start date (YYYY-MM-DD) — global or fallback for new repos
  --since-map <file>      JSON file {"repo": "sha"} — per-repo start commit SHA

Options:
  --include-new           Include repos not in --since-map (requires --since)
  --until, -u <date>      End date [default: today]
  --format, -f <format>   json | markdown [default: markdown]
  --repos, -r <repos>     Comma-separated repo filter
  --output <file>         Write to file instead of stdout
  --patch                 Download .patch files for each commit
  --patch-dir <dir>       Directory for patch files [default: ./patches]
  --help, -h              Show help
  --version, -v           Show version

Examples

# Markdown output for an org since Jan 1
ghlog --org my-org --since 2026-01-01

# JSON output for specific repos
ghlog --org my-org --since 2026-01-01 -f json -r api,web,docs

# Save to file
ghlog --org my-org --since 2026-01-01 --output changelog.md

# Download .patch files for all commits
ghlog --org my-org --since 2026-01-01 --patch

# Download patches to a custom directory (--patch-dir implies --patch)
ghlog --org my-org --since 2026-01-01 --patch-dir ./my-patches

# Pipe to clipboard (macOS)
ghlog --org my-org --since 2026-01-01 | pbcopy

Incremental fetching with --since-map

--since-map lets you start each repo from a specific commit SHA rather than a date. This is more precise than --since (no day-boundary ambiguity) and is the natural way to implement incremental runs — save the last-seen SHA per repo, pass it on the next run.

# Create a map of last-seen SHAs
echo '{"api": "a1b2c3d", "web": "e4f5g6h"}' > since.json

# Fetch only new commits for repos in the map (others are skipped)
ghlog --org my-org --since-map since.json

# Also include repos not in the map, using --since as a date fallback
ghlog --org my-org --since-map since.json --include-new --since 2026-01-01

The SHA is resolved to its exact commit timestamp before fetching, so commits are never double-counted or missed at day boundaries.

Development

bun install
bun run dev -- --help
bun run dev -- --org my-org --since 2026-01-01
bun run typecheck
bun run lint
bun run build

License

MIT