%%
date:: [[2024-01-14]]
parent::
%%
# [[GitHub CLI]]
[docs](https://cli.github.com/manual/gh)
The [[GitHub]] [[CLI]] is an easy way to execute commands from your terminal.
### Install the CLI
```
brew install gh
```
Next, authenticate with your GitHub account:
```
gh auth login
```
Follow the prompts to select the protocol and method you want to use to authenticate:
```
nic@grafanulino obsidian-vault-changelog % gh auth login
? What account do you want to log into? GitHub.com
? What is your preferred protocol for Git operations on this host? SSH
? Upload your SSH public key to your GitHub account? /Users/nic/.ssh/id_rsa.pub
? Title for your SSH key: GitHub CLI
? How would you like to authenticate GitHub CLI? Login with a web browser
! First copy your one-time code: EED3-7C8E
Press Enter to open github.com in your browser...
✓ Authentication complete.
- gh config set -h github.com git_protocol ssh
✓ Configured git protocol
✓ SSH key already existed on your GitHub account: /Users/nic/.ssh/id_rsa.pub
✓ Logged in as nicolevanderhoeven
nic@grafanulino obsidian-vault-changelog %
```
### Check out a PR
```
gh pr checkout 2
```
where `2` is the PR number.