Add `glab login` command
Is your feature request related to a problem? Please describe. Instead of directing the user to create an access token and use it to authenticate glab, there should be a command to directly login to GitLab and create access token with API scope for glab.
Describe the solution you'd like
Add the glab login
command to log in to GitLab and create an access token for user. Since glab
support both GitLab.com and Self Hosted instances, the user should first be asked which instance to use and enter the hostname if self-hosted.
$ glab login
? Which instance do you want to log in? [Use arrows to move, type to filter]
GitLab.com
> GitLab Self Hosted
# if self-hosted is selected, ask for hostname
? Hostname: gitlab.example.com
? Username: myuser
? Password: xxxxxxxx
- Logging in ...
- Creating an access token
✓ Authenticated successfully
Describe alternatives you've considered
glab auth login
Additional context https://github.com/xanzy/go-gitlab/blob/master/examples/basic_auth.go