Skip to content

Instantly share code, notes, and snippets.

@NiklasPeterson
Last active October 5, 2022 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NiklasPeterson/dac3790b67a3078d2ee4583269e01759 to your computer and use it in GitHub Desktop.
Save NiklasPeterson/dac3790b67a3078d2ee4583269e01759 to your computer and use it in GitHub Desktop.
How to install the GitHub CLI in terminal without Homebrew
#!/bin/bash
echo "This will install the GitHub CLI (gh) onto your system"
echo "When this is done, you'll have a new 'gh' command line tool..."
echo "in your /usr/local/bin directory. On most Mac and Linux systems..."
echo "That directory will be in your 'PATH' environment variable..."
echo "If it isn't, please add it. You can temporarily do so by running this:"
echo "\n export PATH=\"/usr/local/bin:\$PATH\""
RELEASE=$1
curl -o gh.tgz -L https://github.com/cli/cli/releases/download/v${RELEASE}/gh_${RELEASE}_macOS_amd64.tar.gz
tar -xzf gh.tgz
cp gh_${RELEASE}_macOS_amd64/bin/gh /usr/local/bin/gh
rm gh.tgz
rm -r ./gh_${RELEASE}_macOS_amd64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment