GH-AUTH(1)

✨ GH-AUTH(1) ✨

okay so this is the gh-auth page from the GitHub CLI manual β€” literally the whole vibe of "how do I prove to GitHub that I'm me" 🫢 bestie, you're gonna be so authenticated by the end of this.


🌸 NAME 🌸

gh-auth β€” Authenticate gh and git with GitHub πŸ’…

like, that's the whole job. get gh and git talking to GitHub as you. no cap.


πŸ¦‹ SYNOPSIS πŸ¦‹

gh auth <command> [flags]

it's giving "go pick a subcommand" energy. the <command> is the main character here, and [flags] is whatever extra little garnish you wanna sprinkle on top ✨


πŸŽ€ AVAILABLE COMMANDS πŸŽ€

okay here's the roster, the whole lineup, and yes i'm listing every single one because we don't skip πŸ“

  • gh-auth-login(1) β€” Log in to a GitHub account πŸ”‘ like, the classic. you, GitHub, a token, a whole moment.
  • gh-auth-logout(1) β€” Log out of a GitHub account πŸ‘‹ breaking up (respectfully).
  • gh-auth-refresh(1) β€” Refresh stored authentication credentials πŸ”„ your creds said "glow-up time".
  • gh-auth-setup-git(1) β€” Setup git with GitHub CLI πŸ› οΈ making git and GitHub actually cooperate, iconic behavior.
  • gh-auth-status(1) β€” Display active account and authentication state on each known GitHub host πŸ‘€ the vibe check. who are you right now, and where?
  • gh-auth-switch(1) β€” Switch active GitHub account πŸ” main character swap. multiple accounts is valid.
  • gh-auth-token(1) β€” Print the authentication token gh uses for a hostname and account 🎟️ yes it literally just prints the token, handle with care bestie.

πŸ’€ EXIT CODES πŸ’€

when the command finishes it tells you how it went, and here's the full legend:

  • 0: Successful execution βœ… slay, it worked.
  • 1: Error 😭 something went wrong.
  • 2: Command canceled πŸ™ˆ you (or something) hit stop.
  • 4: Authentication required πŸ”’ it needs you to log in first, bestie. it's giving locked door.
NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information. πŸ“Œ so like, don't @ me if a subcommand has its own extra codes β€” go read its help. iykyk.

🌈 SEE ALSO 🌈

  • gh(1) β€” the whole parent CLI, the mothership πŸ‘‘

and that's the page!! πŸ§šπŸ’œ

little sign-off moment: this is GitHub CLI v2.102.0, dated Oct 2026 β€” so if your version is older, go update, no cap πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from