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