1

For each user in github, there is "repositories" number which is owned by the user:

enter image description here

How do we enumerate all these repos programmatically?

There is a API called "https://api.github.com/users/{username}/repos" which can enumerate some of the repos, but it is not a complete list - as it is not listing a lot of the repos which I had created and is listed at the github.com website.

PS:

A somewhat similar question is asked here: List repos of a user but its answer is also not correct.

Peter Teoh
  • 6,337
  • 4
  • 42
  • 58

1 Answers1

1

Using the GitHub cli gh repo list command should help.

It should manage the API pagination, and return a full list.

The OP Peter Teoh adds in the comments:

To be precise, by default only 30 are listed, so I put "gh repo list -L 1000": a large number like 1000 as the max limit to list all.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Yes, to be precise, default only 30 are listed, so I put "gh repo list -L 1000" a large number like 1000 as the max limit to list all. – Peter Teoh Mar 22 '23 at 04:42