Skip to content

Instantly share code, notes, and snippets.

@mdrokz
Created November 8, 2021 13:49
Show Gist options
  • Save mdrokz/56f645750c297e07af30b0307518f820 to your computer and use it in GitHub Desktop.
Save mdrokz/56f645750c297e07af30b0307518f820 to your computer and use it in GitHub Desktop.
A fish function to get github public repos by username using gh cli.
function getRepos
gh api graphql -F login=$argv[1] -F first=$argv[2] -F query='
query($login: String!, $first: Int!) {
user(login: $login) {
repositories(first: $first) {
totalCount
nodes {
name
}
}
}
}'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment