cli/pkg/cmd
Tyler McGoffin ccb830ca36 Shorten language on Authenticate with a GitHub host.
The default authentication mode is a web-based browser flow. After completion, an
authentication token will be stored securely in the system credential store.
If a credential store is not found or there is an issue using it gh will fallback
to writing the token to a plain text file. See `gh auth status` for its
stored location.

Alternatively, use `--with-token` to pass in a token on standard input.
The minimum required scopes for the token are: `repo`, `read:org`, and `gist`.

Alternatively, gh will use the authentication token found in environment variables.
This method is most suitable for "headless" use of gh such as in automation. See
`gh help environment` for more info.

To use gh in GitHub Actions, add `GH_TOKEN: ${{ github.token }}` to `env`.

The git protocol to use for git operations on this host can be set with `--git-protocol`,
or during the interactive prompting. Although login is for a single account on a host, setting
the git protocol will take effect for all users on the host.

Specifying `ssh` for the git protocol will detect existing SSH keys to upload,
prompting to create and upload a new key if one is not found. This can be skipped with
`--skip-ssh-key` flag.

USAGE
  gh auth login [flags]

FLAGS
  -p, --git-protocol string   The protocol to use for git operations on this host: {ssh|https}
  -h, --hostname string       The hostname of the GitHub instance to authenticate with
      --insecure-storage      Save authentication credentials in plain text instead of credential store
  -s, --scopes strings        Additional authentication scopes to request
      --skip-ssh-key          Skip generate/upload SSH key prompt
  -w, --web                   Open a browser to authenticate
      --with-token            Read token from standard input

INHERITED FLAGS
  --help   Show help for command

EXAMPLES
  # 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 specific host
  $ gh auth login --hostname enterprise.internal

LEARN MORE
  Use `gh <command> <subcommand> --help` for more information about a command.
  Read the manual at https://cli.github.com/manual
  Learn about exit codes using `gh help exit-codes` around Tylers-GitHub-MacBook.local
2024-09-20 15:51:07 -07:00
..
actions Additional formatting changes 2023-12-01 09:08:51 -05:00
alias Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
api Update documentation for gh api PATCH 2024-07-22 19:36:20 +01:00
attestation Use new HasActiveToken method in trustedroot.go 2024-09-18 10:35:11 -06:00
auth Shorten language on Authenticate with a GitHub host. 2024-09-20 15:51:07 -07:00
browse Update pkg/cmd/browse/browse.go 2024-01-05 10:53:15 -04:00
cache Fix typos 2024-05-09 20:15:27 +00:00
codespace Unify use of tab indent in non-test source files 2024-08-03 00:35:30 +08:00
completion Bump github.com/spf13/cobra from v1.4.0 to v1.5.0 (#6196) 2022-09-06 09:43:40 +04:00
config Add prefer_editor_prompt config 2024-07-09 21:01:50 +09:00
extension Fix test 2024-09-18 19:07:32 +01:00
factory Fix repo fork to use remote protocol if none configured 2024-05-10 10:48:36 +02:00
gist Fix tests 2024-08-16 10:11:52 -07:00
gpg-key Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
issue chore: fix some function names 2024-09-02 15:18:42 +08:00
label Fix tests 2024-08-16 10:11:52 -07:00
org Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
pr Merge pull request #9471 from heaths/issue9470 2024-08-21 14:46:52 -04:00
project Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
release Improve the help message for -F (#9525) 2024-08-28 11:00:46 -07:00
repo Enhance gh repo create docs, fix random cmd link 2024-09-16 13:42:51 -04:00
root Fix pr checks exit code (#9452) 2024-08-16 14:30:11 -07:00
ruleset Fix tests 2024-08-16 10:11:52 -07:00
run Merge pull request #9482 from benebsiny/cli-9153 2024-08-22 15:23:06 -04:00
search Merge pull request #9471 from heaths/issue9470 2024-08-21 14:46:52 -04:00
secret Fix host handling in variable and secret delete 2024-08-02 15:11:22 -04:00
ssh-key Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
status Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
variable Merge branch 'trunk' into tab-indents 2024-08-06 13:08:48 -04:00
version Fix --version flag printing to stdout 2022-05-24 16:21:13 +02:00
workflow Fix tests 2024-08-16 10:11:52 -07:00