GH-AUTH(1) GitHub CLI manual GH-AUTH(1)

# [NAME](#NAME)

gh-auth - Authenticate gh and git with GitHub

# [SYNOPSIS](#SYNOPSIS)

**gh auth &lt;command&gt; \[flags]**

# [AVAILABLE COMMANDS](#AVAILABLE_COMMANDS)

[**gh-auth-login(1)**](#gh_auth_login%281%29)

Log in to a GitHub account

[**gh-auth-logout(1)**](#gh_auth_logout%281%29)

Log out of a GitHub account

[**gh-auth-refresh(1)**](#gh_auth_refresh%281%29)

Refresh stored authentication credentials

[**gh-auth-setup-git(1)**](#gh_auth_setup_git%281%29)

Setup git with GitHub CLI

[**gh-auth-status(1)**](#gh_auth_status%281%29)

Display active account and authentication state on each known GitHub host

[**gh-auth-switch(1)**](#gh_auth_switch%281%29)

Switch active GitHub account

[**gh-auth-token(1)**](#gh_auth_token%281%29)

Print the authentication token gh uses for a hostname and account

# [EXIT CODES](#EXIT_CODES)

0: Successful execution

1: Error

2: Command canceled

4: Authentication required

NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information.

# [SEE ALSO](#SEE_ALSO)

[**gh(1)**](/man/os/gh/gh.1)

Sep 2026

---

Document: gh-auth(1) from gh 2.102.0-r0 (Chainguard OS)
Source: https://github.com/cli/cli
