.nh .TH "GH-COMPLETION" "1" "Oct 2022" "" "GitHub CLI manual" .SH NAME .PP gh-completion - Generate shell completion scripts .SH SYNOPSIS .PP \fB\fCgh completion -s \fR .SH DESCRIPTION .PP Generate shell completion scripts for GitHub CLI commands. .PP When installing GitHub CLI through a package manager, it's possible that no additional shell configuration is necessary to gain completion support. For Homebrew, see https://docs.brew.sh/Shell-Completion \[la]https://docs.brew.sh/Shell-Completion\[ra] .PP If you need to set up completions manually, follow the instructions below. The exact config file locations might vary based on your system. Make sure to restart your shell before testing whether completions are working. .SS bash .PP First, ensure that you install \fB\fCbash-completion\fR using your package manager. .PP After, add this to your \fB\fC~/.bash_profile\fR: .PP .RS .nf eval "$(gh completion -s bash)" .fi .RE .SS zsh .PP Generate a \fB\fC_gh\fR completion script and put it somewhere in your \fB\fC$fpath\fR: .PP .RS .nf gh completion -s zsh > /usr/local/share/zsh/site-functions/_gh .fi .RE .PP Ensure that the following is present in your \fB\fC~/.zshrc\fR: .PP .RS .nf autoload -U compinit compinit -i .fi .RE .PP Zsh version 5.7 or later is recommended. .SS fish .PP Generate a \fB\fCgh.fish\fR completion script: .PP .RS .nf gh completion -s fish > ~/.config/fish/completions/gh.fish .fi .RE .SS PowerShell .PP Open your profile script with: .PP .RS .nf mkdir -Path (Split-Path -Parent $profile) -ErrorAction SilentlyContinue notepad $profile .fi .RE .PP Add the line and save the file: .PP .RS .nf Invoke-Expression -Command $(gh completion -s powershell | Out-String) .fi .RE .SH OPTIONS .TP \fB\fC-s\fR, \fB\fC--shell\fR \fB\fC\fR Shell type: {bash|zsh|fish|powershell} .SH SEE ALSO .PP \fB\fCgh(1)\fR