I'd like to do gh auth login on a headless server and still use the browser based flow (instead of the token). How do I do this?
By default nothing happens after pressing "Enter" here:
$ gh auth login
? What account do you want to log into? GitHub.com
? What is your preferred protocol for Git operations on this host? HTTPS
? Authenticate Git with your GitHub credentials? Yes
? How would you like to authenticate GitHub CLI? Login with a web browser
! First copy your one-time code: A123-A123
Press Enter to open github.com in your browser...
The solution is simple:
BROWSER=false gh auth loginI got this trick from https://github.com/cli/cli/issues/5500#issuecomment-1106545327