Command referencegh auth status
gh auth status command (Linux & Windows / GitHub CLI)
What it does
Show which GitHub accounts are logged in and whether credentials are valid for each host. When people search for gh auth status, they usually want practical GitHub CLI flags, safe examples, and how this subcommand fits everyday PR and repo workflows on Linux, Windows, and macOS. Syntax, options, and copyable examples are below.
Show which GitHub accounts are logged in and whether credentials are valid for each host.
Syntax
gh auth status [flags]
Common options
| Flag / option | Meaning |
|---|---|
| -h, --hostname | Check only a specific GitHub host. |
| --show-token | Include the token in output (avoid in shared terminals). |
Practical examples
Check login
gh auth status
Lists active accounts, protocol, and token scopes.
One host
gh auth status -h github.com
Limits the status report to github.com.
Common mistakes
- Running `--show-token` on a shared screen or recorded terminal session.
- Assuming status success means every org SSO authorization is complete.
Related commands
- gh auth loginAuthenticate the GitHub CLI with GitHub.com or GitHub Enterprise so other gh commands can run.
- gh auth logoutRemove GitHub CLI authentication for a host or account from the local machine.
- gh configGet or set GitHub CLI configuration values such as git protocol and prompt behavior.
- gh pr createCreate a pull request from the current branch with title, body, reviewers, and base branch options.
- gh pr mergeMerge a pull request using merge commit, squash, or rebase strategies.
- gitTrack source history and collaborate through distributed repositories.
- gh repo cloneClone a GitHub repository to your machine using your authenticated gh settings.
- gh pr checkoutCheck out a pull request locally as a branch so you can build, test, or review the changes.
FAQ
What does gh auth status do in GitHub CLI?
Show which GitHub accounts are logged in and whether credentials are valid for each host.
Does gh auth status work on Windows and Linux?
Yes. The GitHub CLI (`gh`) runs on Linux, Windows, and macOS with the same subcommand syntax after you authenticate with `gh auth login`.
What is a practical gh auth status example?
Try `gh auth status` — Lists active accounts, protocol, and token scopes.
Do I need a token in the command line for gh auth status?
Prefer `gh auth login` so credentials stay in the system keyring or secure storage. Avoid pasting personal access tokens into shell history.
Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.