gh(1)

NAME

gh-completion - Generate shell completion scripts

SYNOPSIS

gh completion -s

DESCRIPTION

Generate shell completion scripts for GitHub CLI commands.

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

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.

  bash

Add this to your /.bash_profile:

    eval "$(gh completion -s bash)"

  zsh

Generate a _gh completion script and put it somewhere in your $fpath:

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

Ensure that the following is present in your /.zshrc:

    autoload -U compinit
    compinit -i

Zsh version 5.7 or later is recommended.

  fish

Generate a gh.fish completion script:

    gh completion -s fish >  /.config/fish/completions/gh.fish

OPTIONS

-s, --shell=""
    Shell type: {bash|zsh|fish|powershell}

OPTIONS INHERITED FROM PARENT COMMANDS

--help[=false]
    Show help for command

SEE ALSO

gh(1)