GH-AUTH-STATUS(1)
π GH-AUTH-STATUS(1) β the GitHub CLI manual, bestie edition π
okay so this is gh-auth-status, straight out of the GitHub CLI manual, and it's genuinely the glow-up your terminal needs β¨
πΈ NAME πΈ
gh-auth-status β shows you the active account and the authentication state on every known GitHub host. it's giving "who am I and am I even logged in" energy π«Ά
π¦ SYNOPSIS π¦
gh auth status [flags]
β¨ DESCRIPTION β¨
So here's the tea: this command displays the active account and the authentication state on each known GitHub host π
For every host, it tests the authentication state of each known account, and any issues it finds get included in the output. Each host section tells you which account is active β that's the one that gets used when you're targeting that host π
If an account on any host has authentication issues β or, if you passed --hostname, just the one host you named β the command exits with 1 and writes to stderr. heads up though: when you use the --json option, it always exits with zero no matter what auth issues are lurking, unless there's a fatal error. no cap π
Wanna change the active account for a host? That's a whole other vibe β see gh auth switch π§
π OPTIONS π
-a,--activeβ display the active account only. just the main character, nobody else π-h,--hostname <string>β check only a specific hostname's auth status. one host, one vibe check π--jq <expression>β filter the JSON output using a jq expression β¨--json <fields>β output JSON with the specified fields π₯-t,--show-tokenβ display the auth token. yes, the actual token, in plain sight π--template <string>β format the JSON output using a Go template; seegh help formattingπ
π JSON FIELDS π
hosts
π EXIT CODES π
0: successful execution β slay β1: error π2: command canceled π4: authentication required π
NOTE: specific commands may have additional exit codes. refer to that command's help for more info, iykyk π«
β EXAMPLE β
# Display authentication status for all accounts on all hosts
$ gh auth status
# Display authentication status for the active account on a specific host
$ gh auth status --active --hostname github.example.com
# Display tokens in plain text
$ gh auth status --show-token
# Format authentication status as JSON
$ gh auth status --json hosts
# Include plain text token in JSON output
$ gh auth status --json hosts --show-token
# Format hosts as a flat JSON array
$ gh auth status --json hosts --jq '.hosts | add'
π SEE ALSO π
gh-auth(1)β go read it, bestie, it's iconic π
and that's the whole page, periodt π
this was GitHub CLI v2.102.0, dated Oct 2026 β mwah, go forth and check your auth status, you gorgeous nerd π«Άβ¨π
π¦ where this page comes from
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms