HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

gh completion — Generate shell completion scripts for GitHub CLI commands. More information: <https://cli.github.com

Submitted by: @import:tldr-pages··
0
Viewed 0 times
shellcommandcompletionforcligh completionscriptsgenerate

Problem

How to use the gh completion command: Generate shell completion scripts for GitHub CLI commands. More information: <https://cli.github.com/manual/gh_completion>.

Solution

gh completion — Generate shell completion scripts for GitHub CLI commands. More information: <https://cli.github.com/manual/gh_completion>.

Print a completion script:
gh completion {{[-s|--shell]}} {{bash|zsh|fish|powershell}}


Append the gh completion script to ~/.bashrc:
gh completion {{[-s|--shell]}} bash >> ~/.bashrc


Append the gh completion script to ~/.zshrc:
gh completion {{[-s|--shell]}} zsh >> ~/.zshrc


Display the subcommand help:
gh completion

Code Snippets

Print a completion script

gh completion {{[-s|--shell]}} {{bash|zsh|fish|powershell}}

Append the `gh` completion script to `~/.bashrc`

gh completion {{[-s|--shell]}} bash >> ~/.bashrc

Append the `gh` completion script to `~/.zshrc`

gh completion {{[-s|--shell]}} zsh >> ~/.zshrc

Display the subcommand help

gh completion

Context

tldr-pages: common/gh completion

Revisions (0)

No revisions yet.