GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
GH-COMPLETION(1) GitHub CLI manual GH-COMPLETION(1)

gh-completion - Generate shell completion scripts

gh completion -s <shell>

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 ⟨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.

First, ensure that you install bash-completion using your package manager.

After, add this to your ~/.bash_profile:

eval "$(gh completion -s bash)"

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.

Generate a gh.fish completion script:

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

Open your profile script with:

mkdir -Path (Split-Path -Parent $profile) -ErrorAction SilentlyContinue
notepad $profile

Add the line and save the file:

Invoke-Expression -Command $(gh completion -s powershell | Out-String)

-s, --shell <string>
Shell type: {bash|zsh|fish|powershell}

gh(1)
May 2022

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.