1GH-AUTH-LOGIN(1)               GitHub CLI manual              GH-AUTH-LOGIN(1)
2
3
4

NAME

6       gh-auth-login - Authenticate with a GitHub host
7
8
9

SYNOPSIS

11       gh auth login [flags]
12
13
14

DESCRIPTION

16       Authenticate with a GitHub host.
17
18
19       The default authentication mode is a web-based browser flow. After com‐
20       pletion, an authentication token will be stored securely in the  system
21       credential  store.   If  a credential store is not found or there is an
22       issue using it gh will fallback to writing the token to  a  plain  text
23       file.  See gh auth status for its stored location.
24
25
26       Alternatively,  use  --with-token to pass in a token on standard input.
27       The minimum required scopes for the token are: "repo", "read:org".
28
29
30       Alternatively, gh will use the authentication token found  in  environ‐
31       ment  variables.  This method is most suitable for "headless" use of gh
32       such as in automation. See gh help environment for more info.
33
34
35       To use gh in GitHub Actions,  add  GH_TOKEN:  ${{  github.token  }}  to
36       "env".
37
38
39

OPTIONS

41       -p, --git-protocol <string>
42              The protocol to use for git operations: {ssh|https}
43
44
45       -h, --hostname <string>
46              The hostname of the GitHub instance to authenticate with
47
48
49       --insecure-storage
50              Save authentication credentials in plain text instead of creden‐
51              tial store
52
53
54       -s, --scopes <strings>
55              Additional authentication scopes to request
56
57
58       -w, --web
59              Open a browser to authenticate
60
61
62       --with-token
63              Read token from standard input
64
65
66

EXAMPLE

68       # start interactive setup
69       $ gh auth login
70
71       # authenticate against github.com by reading the token from a file
72       $ gh auth login --with-token < mytoken.txt
73
74       # authenticate with a specific GitHub instance
75       $ gh auth login --hostname enterprise.internal
76
77
78
79
80

SEE ALSO

82       gh-auth(1)
83
84
85
86                                   Nov 2023                   GH-AUTH-LOGIN(1)
Impressum