1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-06-08 02:06:15 +02:00
tldr/pages/common/gh-auth.md
Managor ad7b6f797c
common*: refresh old pages part 6 (#16288)
Co-authored-by: Machiavelli <145562237+MachiavelliII@users.noreply.github.com>
2025-05-03 05:57:05 +03:00

791 B

gh auth

Authenticate with a GitHub host. More information: https://cli.github.com/manual/gh_auth.

  • Log in with interactive prompt:

gh auth login

echo {{your_token}} | gh auth login --with-token

  • Check if you are logged in:

gh auth status

  • Log out:

gh auth logout

  • Log in with a specific GitHub Enterprise Server:

gh auth login {{[-h|--hostname]}} {{github.example.com}}

  • Refresh the session to ensure authentication credentials have the correct minimum scopes (removes additional scopes requested previously):

gh auth refresh

  • Expand the permission scopes:

gh auth refresh {{[-s|--scopes]}} {{repo,admin:repo_hook,admin:org,admin:public_key,admin:org_hook,...}}