Skip to main content

Command referencegh auth status

gh auth status command (Linux & Windows / GitHub CLI)

Linux & WindowsGitHub CLIgitbeginner

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 / optionMeaning
-h, --hostnameCheck only a specific GitHub host.
--show-tokenInclude 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.

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.