gh(1)

NAME

gh-auth-login - Authenticate with a GitHub host

SYNOPSIS

gh auth login [flags]

DESCRIPTION

Authenticate with a GitHub host.

The default authentication mode is a web-based browser flow.

Alternatively, pass in a token on standard input by using --with-token. The minimum required scopes for the token are: "repo", "read:org".

The --scopes flag accepts a comma separated list of scopes you want your gh credentials to have. If absent, this command ensures that gh has access to a minimum set of scopes.

OPTIONS

-h, --hostname=""
    The hostname of the GitHub instance to authenticate with

-s, --scopes=[]
    Additional authentication scopes for gh to have

-w, --web[=false]
    Open a browser to authenticate

--with-token[=false]
    Read token from standard input

OPTIONS INHERITED FROM PARENT COMMANDS

--help[=false]
    Show help for command

EXAMPLE

    # start interactive setup
    $ gh auth login
    # authenticate against github.com by reading the token from a file
    $ gh auth login --with-token < mytoken.txt
    # authenticate with a specific GitHub Enterprise Server instance
    $ gh auth login --hostname enterprise.internal

SEE ALSO

gh-auth(1)