authenticationgithubgithub-cli

How to get more authenticated to github-cli?


I am authenticated to github cli via token

gh auth status -h lalala.com
#=>
lalala.com
  ✓ Logged in to lalala.com as lolofon (~/.config/gh/hosts.yml)
  ✓ Git operations for lalala.com configured to use https protocol.

but, immediately executed afterwards:

gh pr list --repo lala/portal
#=>
HTTP 401: This endpoint requires you to be authenticated. (https://api.github.com/graphql)

What I am doing wrong? Thanks!


Solution

  • Apparently its a bug :-(
    You can workaround it very easily by setting an env var like this:

    set GH_HOST=lalala.com

    See this GitHub issue for details