Skip to content

Commit

Permalink
'gh repos $user_or_org' lists all repos owned by $user_or_org
Browse files Browse the repository at this point in the history
  • Loading branch information
rouge8 committed Dec 25, 2020
1 parent 3771ede commit 9dc7dbe
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .config/gh/config.yml.symlink
Expand Up @@ -8,3 +8,17 @@ pager:
aliases:
# Checkout a PR
co: pr checkout

# List all repos owned by $1
# From https://github.com/cli/cli/issues/642#issuecomment-693598673
repos: |
!gh api --paginate graphql -f owner="$1" -f query='
query($owner: String!, $per_page: Int = 100, $endCursor: String) {
repositoryOwner(login: $owner) {
repositories(first: $per_page, after: $endCursor, ownerAffiliations: OWNER) {
nodes { nameWithOwner }
pageInfo { hasNextPage endCursor }
}
}
}
' | jq -r '.data.repositoryOwner.repositories.nodes[].nameWithOwner' | sort

0 comments on commit 9dc7dbe

Please sign in to comment.