gh auth

Sign in to GitHub from the terminal and check who you are signed in as

What it does

Before you work with GitHub through gh, sign in: gh auth login asks a couple of questions (GitHub.com or a company server, HTTPS or SSH) and opens the browser, where you confirm with a code. The token goes into the system password store, and after that gh asks nothing.

gh auth status shows which account you are signed in to and what scopes the token has. If a command lacks permissions, gh auth refresh -s <scope> adds them, and gh auth logout signs you out.

Syntax

gh auth login
gh auth status
gh auth logout

Examples

Related commands

Practise · All commands