Append the gh completion script to ~/.bashrc

gh completion

  • Generate shell completion scripts for GitHub CLI commands.
    More information: <https://cli.github.com/manual/gh_completion>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

gh completion --shell {{bash}} >> {{~/.bashrc}}

click the source code to copy install gh completion on any operating system with command-not-found.com