LinuxCommandLibrary

gh-auth

Authenticate with a GitHub host from the command line.

TLDR

Log in with interactive prompt

$ gh auth login
copy


Log in with a token from stdin (created in )
$ echo [your_token] | gh auth login --with-token
copy


Check if you are logged in
$ gh auth status
copy


Log out
$ gh auth logout
copy


Log in with a specific GitHub Enterprise Server
$ gh auth login --hostname [github.example.com]
copy


Refresh the session to ensure authentication credentials have the correct minimum scopes (removes additional scopes requested previously)
$ gh auth refresh
copy


Expand the permission scopes
$ gh auth refresh --scopes [repo,admin:repo_hook,admin:org,admin:public_key,admin:org_hook,...]
copy

SYNOPSIS

gh auth <command> [flags]

DESCRIPTION

Manage gh's authentication state.

COMMANDS

gh-auth-login(1)

Authenticate with a GitHub host

gh-auth-logout(1)

Log out of a GitHub host

gh-auth-refresh(1)

Refresh stored authentication credentials

gh-auth-setup-git(1)

Configure git to use GitHub CLI as a credential helper

gh-auth-status(1)

View authentication status

SEE ALSO

gh(1)

Copied to clipboard