Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Login with a web browser on headless machine #5500

@pdostal

Description

@pdostal

Describe the feature or problem you’d like to solve

If I have no browser installed I should still be able to run gh auth login and select Login with a web browser as I can open the URL on another machine.

Proposed solution

$ gh auth login
? What account do you want to log into? GitHub.com
- Logging into github.com
? How would you like to authenticate? Login with a web browser

! First copy your one-time code: XXXX-XXXX
No browser detected, please visit following URL:
  https://github.com/cli-auth

How will it benefit CLI and its users?

A lot of people use headless machines to do their work. This would make the login process simplier for those.

Additional context

The current status looks like this:

$ gh auth login
? What account do you want to log into? GitHub.com
- Logging into github.com
? How would you like to authenticate? Login with a web browser

! First copy your one-time code: 36A4-6DE3
- Press Enter to open github.com in your browser... 
/usr/bin/xdg-open: line 871: www-browser: command not found
/usr/bin/xdg-open: line 871: links2: command not found
/usr/bin/xdg-open: line 871: elinks: command not found
/usr/bin/xdg-open: line 871: links: command not found
/usr/bin/xdg-open: line 871: lynx: command not found

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreThis issue is not accepting PRs from outside contributorsdiscussFeature changes that require discussion primarily among the GitHub CLI teamenhancementa request to improve CLIgh-authrelating to the gh auth command

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions