gh completion -s bash > ~/.bash_completion

Category: GitHub CLI

gh completion -s bash > ~/.bash_completion

Install bash completion for gh

-s bash generates the bash completion script, redirected into ~/.bash_completion so your shell sources it at startup. Tab-completion then fills subcommands, flags, and repo names. Re-run after upgrading gh if completions go stale.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.