gh-completion
generate shell completion scripts
TLDR
Generate bash completions
SYNOPSIS
gh completion -s shell
DESCRIPTION
gh completion generates shell completion scripts for the GitHub CLI. These scripts enable tab completion for gh commands, subcommands, flags, and dynamic values like repository names and branches.
The completions integrate with each shell's native completion system, providing context-aware suggestions. Dynamic completions query GitHub for repositories, issues, and pull requests.
Completion scripts should be regenerated after gh updates to include new commands.
PARAMETERS
-s SHELL, --shell SHELL
Shell type: bash, zsh, fish, powershell.--help
Display help information.
CAVEATS
Output must be saved to appropriate shell completion directory. Shell may need restart or sourcing to load completions. Dynamic completions require authentication.
HISTORY
gh completion is built into the GitHub CLI, following Unix conventions for providing shell integration via completion scripts.
