gh completion -s zsh > /usr/local/share/zsh/site-functions/_gh

Category: GitHub CLI

gh completion -s zsh > /usr/local/share/zsh/site-functions/_gh

Install zsh completion for gh

Writes the zsh completion script into the standard site-functions directory, which zsh loads automatically. The file must be named _gh for zsh to associate it with the gh command. Requires a zsh version of 5.7 or later.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.