DEV Community

Discussion on: Get a list of all of your GitHub repositories

Collapse
 
nelsonaloysio profile image
Nelson • Edited

Had to do some simple edits for terminal execution (and add /users/ to the URL):

[[ $1 = "" ]] &&
echo Error: missing username argument. ||
curl --silent "https://api.github.com/users/$1/repos?page=1&per_page=100" |
npx jq '.[].ssh_url' |
while read repo
do
    repo="${repo%\"}"
    repo="${repo#\"}"
    echo "$repo"
done | sort
Enter fullscreen mode Exit fullscreen mode

Also omitted the username password request, but that's for generally faster usage. :)

Thanks for sharing!