Using the GitHub CLI
The GitHub CLI, or gh, is a command-line interface to GitHub for use in your terminal or your scripts.
- View the GitHub CLI installation instructions
Configuration¶
Run gh auth login to authenticate with your GitHub account. Alternatively, gh will respect the GITHUB_TOKEN environment variable.
To set your preferred editor, use gh config set editor <editor>. Read more about gh config and environment variables.
Declare your aliases for often-used commands with gh alias set.
Sign in to GitHub¶
Follow these steps once you have followed the GitHub CLI installation instructions
- In your terminal, issue
gh auth loginand follow the prompts
Verify you are signed in to GitHub¶
Ensure you are signed in to GitHub with the CLI using gh auth status
-
Check the GH authentication status with
-
Ensure the output shows
-
If needed, login to GitHub with
gh auth loginand follow the prompts
Next steps¶
Read through the GitHub CLI manual to learn more. - Available commands - Usage examples - Community extensions