gh-cli
Provides a comprehensive reference for using GitHub CLI to manage repositories, issues, pull requests, and more from the command line.
Install this skill
Security score
The gh-cli skill was audited on Jun 15, 2026 and we found 21 security issues across 6 threat categories, including 5 high-severity. Review the findings below before installing.
Categories Tested
Security Issues
Command substitution pattern
| 33 | # Linux |
| 34 | curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg |
| 35 | echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null |
| 36 | sudo apt update |
| 37 | sudo apt install gh |
Command substitution pattern
| 2087 | ```bash |
| 2088 | # Run workflow and wait |
| 2089 | RUN_ID=$(gh workflow run ci.yml --ref main --jq '.databaseId') |
| 2090 | |
| 2091 | # Watch the run |
Command substitution pattern
| 2123 | ```bash |
| 2124 | # Add to ~/.bashrc or ~/.zshrc |
| 2125 | eval "$(gh completion -s bash)" # or zsh/fish |
| 2126 | |
| 2127 | # Create useful aliases |
Command substitution pattern
| 2150 | |
| 2151 | ```bash |
| 2152 | export GH_TOKEN=$(gh auth token) |
| 2153 | ``` |
| 2154 |
Curl to non-GitHub URL
| 32 | |
| 33 | # Linux |
| 34 | curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg |
| 35 | echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null |
| 36 | sudo apt update |
Access to SSH directory
| 667 | |
| 668 | # Add deploy key |
| 669 | gh repo deploy-key add ~/.ssh/id_rsa.pub \ |
| 670 | --title "Production server" \ |
| 671 | --read-only |
Access to SSH directory
| 1741 | |
| 1742 | # Add SSH key |
| 1743 | gh ssh-key add ~/.ssh/id_rsa.pub --title "My laptop" |
| 1744 | |
| 1745 | # Add key with type |
Access to SSH directory
| 1744 | |
| 1745 | # Add key with type |
| 1746 | gh ssh-key add ~/.ssh/id_ed25519.pub --type "authentication" |
| 1747 | |
| 1748 | # Delete SSH key |
Access to SSH directory
| 1760 | |
| 1761 | # Add GPG key |
| 1762 | gh gpg-key add ~/.ssh/id_rsa.pub |
| 1763 | |
| 1764 | # Delete GPG key |
Access to home directory dotfiles
| 667 | |
| 668 | # Add deploy key |
| 669 | gh repo deploy-key add ~/.ssh/id_rsa.pub \ |
| 670 | --title "Production server" \ |
| 671 | --read-only |
Access to home directory dotfiles
| 1741 | |
| 1742 | # Add SSH key |
| 1743 | gh ssh-key add ~/.ssh/id_rsa.pub --title "My laptop" |
| 1744 | |
| 1745 | # Add key with type |
Access to home directory dotfiles
| 1744 | |
| 1745 | # Add key with type |
| 1746 | gh ssh-key add ~/.ssh/id_ed25519.pub --type "authentication" |
| 1747 | |
| 1748 | # Delete SSH key |
Access to home directory dotfiles
| 1760 | |
| 1761 | # Add GPG key |
| 1762 | gh gpg-key add ~/.ssh/id_rsa.pub |
| 1763 | |
| 1764 | # Delete GPG key |
Access to home directory dotfiles
| 1943 | ```bash |
| 1944 | # Generate shell completion |
| 1945 | gh completion -s bash > ~/.gh-complete.bash |
| 1946 | gh completion -s zsh > ~/.gh-complete.zsh |
| 1947 | gh completion -s fish > ~/.gh-complete.fish |
Access to home directory dotfiles
| 1944 | # Generate shell completion |
| 1945 | gh completion -s bash > ~/.gh-complete.bash |
| 1946 | gh completion -s zsh > ~/.gh-complete.zsh |
| 1947 | gh completion -s fish > ~/.gh-complete.fish |
| 1948 | gh completion -s powershell > ~/.gh-complete.ps1 |
Access to home directory dotfiles
| 1945 | gh completion -s bash > ~/.gh-complete.bash |
| 1946 | gh completion -s zsh > ~/.gh-complete.zsh |
| 1947 | gh completion -s fish > ~/.gh-complete.fish |
| 1948 | gh completion -s powershell > ~/.gh-complete.ps1 |
| 1949 |
Access to home directory dotfiles
| 1946 | gh completion -s zsh > ~/.gh-complete.zsh |
| 1947 | gh completion -s fish > ~/.gh-complete.fish |
| 1948 | gh completion -s powershell > ~/.gh-complete.ps1 |
| 1949 | |
| 1950 | # Shell-specific instructions |
Access to home directory dotfiles
| 2122 | |
| 2123 | ```bash |
| 2124 | # Add to ~/.bashrc or ~/.zshrc |
| 2125 | eval "$(gh completion -s bash)" # or zsh/fish |
| 2126 |
Instruction to display credentials
| 367 | gh auth status --hostname github.com |
| 368 | |
| 369 | # Show token in output |
| 370 | gh auth status --show-token |
| 371 |
Shell profile modification
| 2122 | |
| 2123 | ```bash |
| 2124 | # Add to ~/.bashrc or ~/.zshrc |
| 2125 | eval "$(gh completion -s bash)" # or zsh/fish |
| 2126 |
Download and run instruction
| 1271 | gh run delete 123456789 |
| 1272 | |
| 1273 | # Download run artifacts |
| 1274 | gh run download 123456789 |
| 1275 |