GitHub/CLI/Q/Using the gh cli, is there a quick way to list repositories with globs for user and repo name?
Properties
- logseq-entity
- Logseq/Entity/Question
Using the GitHub/CLI (
gh), is there a quick way to list repositories with globs for user and repo name?My Notes
- This might be a place where gh-dash shines ... need to check that out.
Answer
- AI/Response
- gh/repo/list
- No built-in shell-style globs.
gh repo listaccepts at most one<owner>(user or org) and has no flags to glob owners or repository names. You filter after listing or usegh search reposwith GitHub’s search syntax (qualifiers and keywords), which is not the same as*/?filename globs. - One owner, pattern-match names with
jq: list JSON and select with a regex (closest to a “repo name glob” in practice).
- No built-in shell-style globs.
- gh/repo/search
- Search across GitHub (or narrow by owner):
gh search reposuses the REST search API — combineuser:LOGIN,org:ORG, or--owner=…with terms andin:namefor name-oriented matches. See GitHub CLI manual —gh search reposand Searching for repositories.
- Search across GitHub (or narrow by owner):
- gh/repo/list in loop or gh/api call
- Many owners: loop over owners and run
gh repo list, or drivegh api/ GraphQL if you need somethingrepo listcannot express.
- Many owners: loop over owners and run
- gh/repo/list
- AI/Response