gh-star-history
v0.4.5
Published
Visualize and compare GitHub star history as interactive charts, powered by gh CLI
Maintainers
Readme
gh-star-history

Visualize GitHub star history and regional breakdown as interactive charts. Powered by the GitHub CLI - no API tokens needed. Features date range selection, star growth tracking with period comparison, and dynamic regional breakdown.
For example, if you want to see the star growth of claude-code-tips:
npx gh-star-history ykdojo/claude-code-tips
Or compare multiple repos:
npx gh-star-history vuejs/vue withastro/astro sveltejs/svelte
Generates a self-contained HTML file with an interactive Plotly chart.
Prerequisites
- Node.js >= 16
- GitHub CLI installed and authenticated (
gh auth login)
Usage
npx gh-star-history <owner/repo or URL> ... [options]Accepts both formats, and multiple repos:
npx gh-star-history ykdojo/claude-code-tips
npx gh-star-history https://github.com/ykdojo/claude-code-tips
npx gh-star-history vuejs/vue withastro/astro sveltejs/svelteOptions
| Flag | Description |
|------|-------------|
| --style <name> | Chart style: blue (default), green, purple (single repo only) |
| --output <path> | Output file path (default: star-history.html) |
| --no-open | Don't auto-open the browser |
| --no-cache | Skip cache and fetch fresh data |
| -h, --help | Show help |
Examples
# Default blue style
npx gh-star-history ykdojo/claude-code-tips
# Green accent
npx gh-star-history ykdojo/claude-code-tips --style green
# Save to specific file
npx gh-star-history torvalds/linux --output linux-stars.html
# Compare multiple repos
npx gh-star-history vuejs/vue withastro/astro sveltejs/svelteStyles
Three styles matching GitHub's dark theme palette:
- blue (default) -
#58a6ff - green -
#3fb950 - purple -
#bc8cff
How it works
- Fetches stargazer timestamps via GitHub's GraphQL API (no pagination limit)
- Caches results to
~/.gh-star-history/(one file per repo) - subsequent runs only fetch new stars - Generates a self-contained HTML file with Plotly.js loaded from CDN
- Opens it in your default browser
The cache saves after every batch, so even if a large fetch gets interrupted, progress is kept. Single-repo charts show both cumulative stars (line) and stars per day (bars) on a dual-axis layout. Multi-repo charts show cumulative lines with a legend for comparison.
Region breakdown
You can also generate a region breakdown chart showing where stargazers are from, based on their public GitHub location. Since location strings are freeform, AI is needed to classify them - use the /gh-star-region-breakdown skill in Claude Code to handle fetching, classification, and chart generation.

The region breakdown includes:
- A stacked bar chart showing stars by region over time (top 7 regions per day)
- An overall breakdown horizontal bar chart with percentages
- Dynamic top N control - choose how many regions to show individually vs grouped into "Other"
- Hover over "Other" to see the full breakdown of smaller regions
The top N regions are recomputed based on the selected date range, so you can see which regions are trending in any time period.
Claude Code plugin
If you use Claude Code, you can install the plugin:
/plugin marketplace add ykdojo/gh-star-history
/plugin install gh-star-history@gh-star-historyThen run /gh-star-region-breakdown <owner/repo> to fetch stargazer locations, classify them, and generate the chart.
Development
git clone https://github.com/ykdojo/gh-star-history.git
cd gh-star-history
node bin/cli.js ykdojo/claude-code-tips