Skip to content

About

GitHub CLI extension: repository traffic (views, clones, referrers) as tables, for one repo or many

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

gh-traffic

A GitHub CLI extension that shows repository traffic — views, clones and top referrers — as formatted tables, for one repo or several at once.

GitHub only keeps 14 days of traffic data and only shows it to people with push access, so this is a quick way to read it from the terminal and compare repos side by side.

Install

gh extension install imagewize/gh-traffic

Needs gh (authenticated) and jq.

Usage

gh traffic imagewize/nynaeve                       # views (default)
gh traffic --all imagewize/nynaeve imagewize/wp-ops
gh traffic --clones --days 7 imagewize/nynaeve
gh traffic --all --summary imagewize/nynaeve imagewize/wp-ops imagewize/aludra
gh traffic --all --json imagewize/nynaeve          # machine-readable
gh traffic --help
Flag Effect
-c, --clones Include clone counts
-r, --referrers Include top referring sites
-a, --all Views, clones and referrers
-d, --days N Limit day-series sections to the last N days (max 14)
-s, --summary Only the cross-repo rollup table
--sort-by COL Sort the summary by unique-views or unique-clones
-j, --json Raw JSON instead of tables
-q, --quiet Suppress header rows

With more than one repo, a summary table (one row per repo, 14-day totals) is printed first.

Reading the numbers

Views count page loads by humans. Clones count git clone, which is dominated by CI runners, mirrors and package resolvers rather than people. A repo with 3 unique viewers and 200 unique cloners is being fetched by automation, not read.

For longer-term tracking, run it on a schedule and append the --json output to a file — GitHub will not give you more than two weeks back.

History

This started as scripts/git/gh-traffic.sh in imagewize/wp-ops and moved here because it has nothing to do with WordPress.

License

MIT. See LICENSE.md.

About

GitHub CLI extension: repository traffic (views, clones, referrers) as tables, for one repo or many

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages