TIL: Speeding Up GitHub Operations With gh Aliases
GitHub CLI is powerful. Typing gh pr create –fill –reviewer team –label release every time is not. gh aliases shorten it.
gh alias set pc 'pr create --fill'
Now gh pc does the same thing. Two characters instead of a flag salad.
gh alias set prc 'pr create --fill --label "til-tuesday" --base main'
Custom alias for TIL Tuesday PRs. Fills the title and body from the commit, applies the label, targets main.
gh alias set prl 'pr list --state open --author @me'
List all open PRs you created. The @me placeholder resolves to the authenticated user.
gh alias set --shell browse-ci 'gh run list --limit 10 --json status,headBranch,url | jq'
The –shell flag runs the alias as a shell command instead of a gh subcommand. Combine with jq for formatted output.
Where are aliases stored?
~/.config/gh/aliases.yml. Share them with your team by committing the file to your dotfiles repo.