Skip to content

Instantly share code, notes, and snippets.

@nine1one
Created March 9, 2026 03:21
Show Gist options
  • Select an option

  • Save nine1one/0de644ac05a23ce4548e77fc62e5a8f3 to your computer and use it in GitHub Desktop.

Select an option

Save nine1one/0de644ac05a23ce4548e77fc62e5a8f3 to your computer and use it in GitHub Desktop.
A script to install gh in linux.
#!/usr/bin/env bash
# Gist: Install GitHub CLI (gh) on Kali Linux
set -e
# Update package lists
sudo apt update
# Install dependencies
sudo apt install -y curl gnupg2
# Add GitHub CLI GPG key
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg
# Add GitHub CLI repository
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
# Update package lists again
sudo apt update
# Install GitHub CLI
sudo apt install -y gh
# Verify installation
gh --version
# Authenticate GitHub CLI
gh auth login
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment