github shell

Retrieving Information (star/fork) of GitHub Repositories Using Linux Commands

Shou Arisaka
1 min read
Nov 21, 2025

You can retrieve the number of “stars” and “forks” of a repository from the command line.

#  e.g.ariya/phantomjs

# Retrieve the number of "stars" for a repository
curl --silent 'https://api.github.com/repos/ariya/phantomjs' -H 'Accept: application/vnd.github.preview' | jq '.watchers'

# Retrieve the number of "forks" for a repository
curl --silent 'https://api.github.com/repos/ariya/phantomjs' -H 'Accept: application/vnd.github.preview' | jq '.forks'

# Retrieve the number of "issues" for a repository
curl --silent 'https://api.github.com/repos/ariya/phantomjs' -H 'Accept: application/vnd.github.preview' | jq '.open_issues'

# Retrieve the "size" of a repository
curl --silent 'https://api.github.com/repos/ariya/phantomjs' -H 'Accept: application/vnd.github.preview' | jq '.size'

Share this article

Shou Arisaka Nov 21, 2025

🔗 Copy Links