Skip to content

Instantly share code, notes, and snippets.

@tinacious
Last active September 2, 2022 00:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tinacious/37ccc9ac519e7339ca332fc19de32b4c to your computer and use it in GitHub Desktop.
Save tinacious/37ccc9ac519e7339ca332fc19de32b4c to your computer and use it in GitHub Desktop.
Get all of the public repositories by name for a Github user
# Replace "octocat" with you, or the user you're creeping.
export GIST_GITHUB_USERNAME="octocat";
export GIST_GITHUB_PAGE="1";
curl https://api.github.com/users/$GIST_GITHUB_USERNAME/repos\?sort\=created\&direction\=desc\&page\=$GIST_GITHUB_PAGE | jq '.[].html_url'
# Other properties of relevance:
# html_url description license.url
# Given username = tinacious
# curl https://api.github.com/users/tinacious/repos | jq .[].full_name
# Outputs
# "tinacious/<repo-name-1>"
# "tinacious/<repo-name-2>"
# References
# - Github v3 API: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#list-repositories-for-a-user
# Dependencies
# - curl
# - jq: https://stedolan.github.io/jq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment