Replace <username>
with your GitHub username and be prepared to enter your GitHub password on the command line.
If you have more than 100 repositories, you'll need to run this command several times, editing the page=?
parameter each time.
Replace ssh_url
in the jq query with git_url
for git://
scheme, and with clone_url
for https://
scheme.
LISTFILE=repos.txt
curl -u "<username>" "https://api.github.com/user/repos?page=1&per_page=100" | jq '.[].ssh_url' | while read repo
do
repo="${repo%\"}"
repo="${repo#\"}"
echo "$repo" >> $LISTFILE
done