>_ ghcli.com
ghcli / Auth & Config / gh auth status

gh auth status

Confirm who you're signed in as

gh auth status reports which GitHub accounts gh is signed into, the active account, the authentication protocol, and the token's scopes. It's the first command to run when a gh command unexpectedly fails with a permissions error.

Quick answer
gh auth status

Syntax

gh auth status [flags]

Examples

Show authentication status for all hosts

gh auth status

Check a specific GitHub Enterprise host

gh auth status --hostname github.example.com

Reveal the token value

gh auth status --show-token

Only show the active account

gh auth status --active

Options & flags

FlagWhat it does
-h, --hostnameCheck a specific host (e.g. a GitHub Enterprise server).
-t, --show-tokenDisplay the authentication token.
-a, --activeShow only the active account for each host.

How to use gh auth status, step by step

  1. Run gh auth status.
  2. Confirm the account, protocol (HTTPS or SSH), and token scopes.
  3. If scopes are missing, refresh them with gh auth refresh -s scope.
  4. If you're not logged in, run gh auth login.

Common errors and fixes

You are not logged into any GitHub hosts. Run gh auth login to authenticate.

Exactly what it says — run gh auth login and follow the prompts to sign in.

X github.com: the token in ... is invalid

Your stored token expired or was revoked. Re-authenticate with gh auth login to replace it.

Related commands

Frequently asked questions

How do I check if I'm logged into GitHub CLI?

Run gh auth status. It lists each host you're authenticated to, the active account, the protocol, and the token scopes. If nothing is logged in, it tells you to run gh auth login.

How do I see my token scopes?

gh auth status prints the granted scopes for each account. If a command fails on permissions, this is where you confirm the scope is present, then add it with gh auth refresh.

How do I check authentication for a GitHub Enterprise host?

Pass --hostname: gh auth status --hostname github.example.com shows the status for that specific server.