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

gh-streak-cli

v1.2.6

Published

πŸ“Š Visualize GitHub contribution streaks & heatmaps in your terminal

Readme

gh-streak-cli πŸ“Š

Visualize your GitHub contribution heatmap, streaks, and insights β€” right in your terminal.

gh-streak NameetMehta
gh-streak NameetMehta --insights
gh-streak NameetMehta --compare torvalds
gh-streak NameetMehta --compare torvalds --export duel.png
gh-streak NameetMehta --watch 21:00
gh-streak NameetMehta --export my-streak.png

Features

| Flag | What it does | |------|-------------| | (default) | Contribution heatmap + streak stats + breakdown bars + profile | | --compare <user> | Head-to-head duel with win/loss breakdown | | --insights | Best day of week, best month, 6-month trend, consistency score | | --watch HH:MM | Background alarm β€” desktop notification if no commits by set time | | --export [file] | Export heatmap as a shareable PNG card | | --refresh | Bypass 1-hour cache and fetch fresh data |

Flags combine freely β€” --compare + --export generates a side-by-side duel card PNG.


Installation

npm install -g gh-streak-cli

Then use from anywhere:

gh-streak <username>

Requires Node.js β‰₯ 18. Check with node -v.


Setup (first time)

1. Get a GitHub token

  1. Go to github.com/settings/tokens
  2. Click Generate new token (classic)
  3. Select only the read:user scope
  4. Copy the token

2. Set your token permanently

macOS / Linux:

echo 'export GH_TOKEN=your_token_here' >> ~/.zshrc && source ~/.zshrc

Windows (Git Bash / WSL):

echo 'export GH_TOKEN=your_token_here' >> ~/.bashrc && source ~/.bashrc

Windows (PowerShell):

[System.Environment]::SetEnvironmentVariable("GH_TOKEN", "your_token_here", "User")

You never need to pass --token again after this.

3. Run it

gh-streak your-github-username

Usage Examples

# Your own stats
gh-streak NameetMehta

# Full insights β€” best day, month, 6-month trend
gh-streak NameetMehta --insights

# Head-to-head duel in the terminal
gh-streak NameetMehta --compare torvalds

# Export your heatmap as a shareable PNG card
gh-streak NameetMehta --export my-streak.png

# Export a duel card β€” two heatmaps + winner
gh-streak NameetMehta --compare torvalds --export duel.png

# Watch mode β€” notify at 9 PM if no commits today
gh-streak NameetMehta --watch 21:00

# Force fresh data (bypass 1-hour cache)
gh-streak NameetMehta --refresh

PNG Export

--export saves a shareable card as a PNG file.

Single user:

gh-streak NameetMehta --export streak.png

Generates a card with your heatmap, contribution count, current streak, and longest streak.

Duel card:

gh-streak NameetMehta --compare torvalds --export duel.png

Generates a side-by-side card with both heatmaps, stats, and a winner line at the bottom. Great for sharing on LinkedIn, Twitter, or Discord.


Watch Mode

--watch HH:MM keeps the process running and checks at the time you set (24h format).

gh-streak NameetMehta --watch 21:00
  • No commits today β†’ fires a desktop notification + prints a red warning
  • Already committed β†’ confirms your streak is safe, no notification
  • Resets automatically at midnight for the next day
  • Press Ctrl+C to stop

Run it in the background with tmux so it persists across terminal sessions:

tmux new -d -s streak 'gh-streak NameetMehta --watch 21:00'

Insights

--insights adds a full analysis section below the normal output:

  🧠 Insights: @NameetMehta
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  πŸ“† Day of Week
  Sun   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 1.2
  Mon   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘ 3.1  ← peak
  ...

  πŸ“… Best Month
     March was your strongest month with 187 total contributions.

  πŸ† Best Week
     Week of Mar 4 β€” 52 contributions.

  πŸ“ˆ 6-Month Trend
     ↑ 23% more active than your previous 6 months.

  ⚑ Consistency
     61% of days had at least one contribution.
     Longest dry spell: 9 consecutive days without a commit.

Tech Stack

  • Node.js β€” ESM modules
  • GitHub GraphQL API v4 β€” single query fetches all data
  • @napi-rs/canvas β€” PNG card generation
  • node-notifier β€” cross-platform desktop notifications
  • chalk β€” terminal colors
  • commander β€” CLI argument parsing

Contributing

PRs welcome. To run locally:

git clone https://github.com/NameetMehta/gh-streak
cd gh-streak
npm install
node index.js <username>

License

MIT