My Cheatsheet for gh(Github CLI)


Install and login

With OS X it’s as simple as brew install gh.

For more options: https://github.com/cli/cli?tab=readme-ov-file#installation

How to list all pull requests of an organisation

# just a hello-world search
gh search prs org:MyOrgName

# created within a time range
gh search prs org:MyOrgName --created "2024-10-10..2024-12-10"

# only output the PR url
gh search prs org:MyOrgName --created "2024-10-10..2024-12-10" --json url

# set limit to max(1000)
gh search prs org:MyOrgName --created "2024-10-10..2024-12-10" --json url --limit 1000