-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new auth flow UX #1548
new auth flow UX #1548
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran through the various scenarios, and all login methods were a success. All the new messaging was present as long as new cool graphic. ✅
-
I don't think we should fix anything, but just want to point out what a narrow terminal does to the graphic
-
Also, do we want to update GitHub Enterprise to GitHub Enterprise Server? More info "GitHub Enterprise" could be confusing in sign in process desktop/desktop#7728
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the banner!
My main concern is about having all our bases covered and the fact that with this approach, we have to annotate all leaf commands, meaning that if we add another gh auth
subcommand, we have to copy over the annotation. I've proposed a workaround.
Also, as noted in a comment, Cobra pseudo-commands such as help
and __complete
should never trigger authentication in my view, and also requesting help via -h
(where available) and --help
.
cmd/gh/main.go
Outdated
,KMM0;.;:;. dMMMMMMMMK, | ||
:OWMXOOOc dMMMMMWO: | ||
.:kXMMd dMMXk:. | ||
Have a good one~ ,l. .l, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“Have a good one” is a colloquialism, and furthermore one that is not always used in good faith. Keeping non-native English speaking people in mind, could we use something simpler, e.g. “happy hacking!”, or nothing at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have a good day?
pkg/cmd/root/root.go
Outdated
@@ -98,6 +98,9 @@ func NewCmdRoot(f *cmdutil.Factory, version, buildDate string) *cobra.Command { | |||
return &cmdutil.FlagError{Err: err} | |||
}) | |||
|
|||
// TODO does this make sense? I'd like people to be able to see usage without an auth message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm that's a great point. We likely don't want an auth check on commands such as gh
, gh pr
, gh pr create --help
, gh help ...
, and similar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with gh pr create --help
not working for now; there's always gh help
and that specific help page isn't going to help much without auth (unlike the root help)
cmd/gh/main.go
Outdated
'oONMMMMMMMMMMMMNOo' | ||
'dXMMMMMMMMMMMMMMMMMMMMXd' | ||
.kMMMMMMMMMMMMMMMMMMMMMMMMMMk. | ||
To authenticate, please lWMMMM:.'ckXKOkkkkOKXkc'.:MMMMWl | ||
run 'gh auth login'. oMMMMMM. .MMMMMMo | ||
;WMMMMMX. .XMMMMMW; | ||
0MMMMMK. .KMMMMM0 | ||
You can also set the MMMMMMl lMMMMMM | ||
GITHUB_TOKEN environment MMMMMMd dMMMMMM | ||
variable, if preferred. KMMMMMN' 'NMMMMMK | ||
cMMMMMMNc cNMMMMMMc | ||
xMMNdkXMNkl;,. .,;lkNMMMMMMMx | ||
xWMNx;kWMMMK. .KMMMMMMMMMWx | ||
,KMM0;.;:;. dMMMMMMMMK, | ||
:OWMXOOOc dMMMMMWO: | ||
.:kXMMd dMMXk:. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ASCII art 😻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put in a TerminalSize
check so as not to print this if the terminal width is too narrow (thanks @tierninho for pointing that out)
This comment has been minimized.
This comment has been minimized.
cc @ampinsk for ascii art sign off >_> |
I hate to be a bummer, but I don't think we should do the ascii art 😞 I'm concerned about how this will show up for users with voice over! I think it could be really confusing, especially on first run. I would love to include something welcoming like this though, but maybe that could take the form of emoji if we can exclude Windows (where it won't render correctly)? |
that's fair, @ampinsk ; for now I've just taken out the ascii art. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks and works great, thank you!
Should alias
commands be allowed in no-auth mode?
$ gh alias list
Welcome to GitHub CLI!
To authenticate, please run `gh auth login`.
good catch @mislav , I just missed aliases when I re-did the disable auth check thing |
This PR:
gh auth login
if there is no auth configgh auth login
closes #1511