Skip to content

gh - github cli

install github-cli

brew install gh

configure options

the config is stored in ~/.config/gh/config.yml

set pager

gh config set pager cat

configure editor

gh config set editor "code --wait"

github stars

list all starred repos

GH_PAGER="" gh api user/starred --paginate --jq '.[].full_name'

removed starred repo

turns out, you can't unstar a repo on the web which was taken down by a DMCA request

gh api -X DELETE user/starred/username/repo

manage pull requests

list pull requests

gh pr list

(squash) merge and delete remote branch

replace 23 with your pr id

gh pr merge 23 --auto -s -d

close without merging and delete remote branch

replace 42 with your pr id

gh pr close 42 -d