GH-AUTH-TOKEN(1)
π gh-auth-token β the manual page, but make it make sense
okay so bestie, welcome to GH-AUTH-TOKEN(1) from the GitHub CLI manual β this is the page that tells you how to make gh spit out the auth token it's been holding onto for a hostname and an account. yes, that token. the secret one. π
β¨ NAME β¨
gh-auth-token β print the authentication token that gh uses for a hostname and account. literally just hands you the token. no cap. π
πΈ SYNOPSIS πΈ
gh auth token [flags]
that's it. that's the whole vibe. flags are optional, token is mandatory (jk, the token comes out the other end). π
π¦ DESCRIPTION π¦
So this command outputs the authentication token for an account on a given GitHub host. one job. it does one job. π
Without the --hostname flag, the default host is chosen. (you don't pick, it picks. main character energy honestly.)
Without the --user flag, the active account for the host is chosen. (again β it's got this. don't stress.) β¨
π OPTIONS π
-h,--hostname <string>β the hostname of the GitHub instance that's authenticated. like, which GitHub are we talking about here. π-u,--user <string>β the account you want the token output for. specify the bestie, get the token. π«Ά
β οΈ careful with these bad boys β a token is basically a password with a cute outfit on. don't paste it in the group chat fr fr. π
π EXIT CODES π
0β successful execution. slay. we ate. β1β error. something's wrong, bestie. π2β command canceled. you hit the brakes. β4β authentication required. you gotta log in first, no skipping. π
π NOTE: specific commands may have additional exit codes. refer to the command's help for more information. iykyk. π
π₯ SEE ALSO π₯
gh-auth(1)β the bigger auth picture, go read it π§
β¨ and that's the whole page, bestie β¨
this gem is from GitHub CLI v2.102.0, dated Oct 2026 β go forth and authenticate responsibly πππ¦β
π¦ 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