Getting Started with GitHub CLI

Search for a command to run...

FYI: This is experimental and may not work on your system.

Hey all! I made this guide after getting Starship successfully working on Bash, but zsh would refuse to accept the init script. Step 0 - Set a custom password This step is not required if you've already set a custom password for your Crostini contain...

If you've ever coded for an Arduino, you're probably familiar with the Arduino IDE. Is your IDE just not uploading your sketch? Are you getting an error such as this? If so, the fix is quite simple. First, locate the Tools section on the top bar of ...

Hey all! This is a quick one, but I use command aliases all the time and they make my life so much easier when I'm in the terminal. Let's get started! 1. Opening the .bashrc file The .bashrc file is short for "bash run commands". It can be located in...

GitHub CLI is a wonderful new tool released by GitHub in an effort to bring GitHub to the terminal. In this tutorial, I will be showing you how to setup, install and use some basic features of GitHub CLI.
Because of the amount of install methods, I've taken the liberty of creating a separate article dedicated to installation methods.
When you first try to run gh, it will ask you to authenticate with your GitHub account.
gh auth login
Select if you are authenticating with a GitHub Enterprise Server, or GitHub.com. In this tutorial, I will be authenticating with GitHub.com.
? What account do you want to log into? [Use arrows to move, type to filter]
> GitHub.com
GitHub Enterprise Server
Next, select if you wish to authenticate with a web browser, or with an authentication token. To keep it simple, I'll authenticate with a web browser.
? How would you like to authenticate? [Use arrows to move, type to filter]
> Login with a web browser
Paste an authentication token
Make sure to copy your one-time code before pressing "Enter" to open the authentication window.
! First copy your one-time code: <your code will be here>
- Press Enter to open github.com in your browser...

After entering your activation code, you will be brought to the OAuth page.

After authorizing, and confirming your password, you will be brought to this page.

Congratulations! You are now authenticated! Returning to the terminal, you will be greeted with this message.
✓ Authentication complete. Press Enter to continue...
One last thing!
? Choose default git protocol [Use arrows to move, type to filter]
> HTTPS
SSH
I'd recommend using HTTPS, since it's the most widely used protocol, so I'll be choosing it.
✓ Configured git protocol
✓ Logged in as onyxcode
Congrats! You're done setting up GitHub CLI!
Full documentation at cli.github.com/manual.
gh gist create --public hello.py
gh repo clone onyxcode/hazy
gh issue list -R Rapptz/discord.py
gh release download -R microsoft/winget-cli
I hope you found this article helpful! If you did, share and like!