~/CloudSetup.In

GitHub CLI

Version Control config.yml ● stable

Drive pull requests, issues, and workflows from the terminal.

01 Overview

The `gh` CLI brings GitHub — PRs, issues, releases, and Actions runs — into the terminal so you can review a diff, kick off a workflow, or cut a release without leaving a shell session.

→ official documentation

02 Installation

Pick a platform. Each step is copy-pasteable on its own.

01  Add the GitHub CLI GPG key and repo
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
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
02  Install
sudo apt update
sudo apt install -y gh
03  Verify
gh --version
01  Add the GitHub CLI repo
sudo dnf install -y 'dnf-command(config-manager)'
sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
02  Install
sudo dnf install -y gh
03  Verify
gh --version
01  Install via Homebrew
brew install gh
02  Verify
gh --version
Note — commands assume sudo privileges and an up-to-date package index. Pin a specific version in production rather than tracking latest.

03 Install script

The steps above bundled into a single idempotent shell script for provisioning boxes unattended.

install-github-cli.sh
Ubuntu/Debian target · safe to re-run · exits non-zero on failure
↓ download script

04 Cheatsheet

The commands reached for most often once GitHub CLI is installed.

CommandWhat it does
gh auth loginAuthenticate the CLI with a GitHub account
gh repo clone owner/repoClone a repository
gh pr create --fillOpen a pull request from the current branch
gh pr listList open pull requests
gh pr checkout 123Check out a PR by number
gh issue listList open issues
gh workflow run name.ymlTrigger a GitHub Actions workflow
gh release create v1.0.0Cut a new release