Table of contents
The GitHub Command Line Interface (CLI) tool, often referred to as
gh, is a command-line tool provided by GitHub for interacting with GitHub repositories and performing various GitHub-related actions directly from the command line.
With the GitHub CLI, you can perform tasks such as creating repositories, managing issues and pull requests, viewing repository information, and more, all without having to use a web browser.
The GitHub CLI is designed to streamline workflows for developers who prefer working in a terminal environment.
Let's get down to business
Check your OS
This step is just to make sure you have Linux Mint or a Ubuntu-based Linux distribution.
cat /etc/os-release lsb_release -a uname -a hostnamectl
Open the terminal
You can open a terminal by pressing Ctrl + Alt + T or by searching for "Terminal" in the application menu.
Add a GPG key to the system's keyring
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
apt-key command is used for managing authentication keys used to authenticate packages.
adv: This stands for "advanced."
keyserver.ubuntu.com: This specifies the key server from which to receive the GPG key. In this case, it's the Ubuntu key server.
--recv-key C99B11DEB97541F0: This specifies the GPG key's identifier that should be retrieved from the key server. The GPG key is a cryptographic key used to sign packages, and this command fetches and adds that key to the system's keyring.
Add a new repository
sudo apt-add-repository https://cli.github.com/packages
sudo apt-get install gh
gh --version which gh
Initiate authentication process
gh, you need to authenticate with your GitHub account. Run the following command and follow the prompts:
gh auth login
Choose preferred protocol
I picked up
Upload the SSH public key
I picked up my current SSH public key.
I used the `authentication token `.
You can check if you are really logged in by trying to authenticate again.
gh auth login
Well-done. You did a great job!
Thank you for reading this article.
If you have any questions, thoughts, suggestions, or corrections, please share them with us.
We appreciate your feedback and look forward to hearing from you.
Feel free to suggest topics for future blog articles. Until next time!