From c5a7bf8f45440488cc596b21ef396c6d02fa6692 Mon Sep 17 00:00:00 2001 From: Raj Hawaldar Date: Thu, 21 Sep 2023 12:13:27 +0530 Subject: [PATCH] Hint adding codespace scope to auth login (#7961) --- pkg/cmd/root/root.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/root/root.go b/pkg/cmd/root/root.go index 12884198e..353b9836a 100644 --- a/pkg/cmd/root/root.go +++ b/pkg/cmd/root/root.go @@ -72,7 +72,11 @@ func NewCmdRoot(f *cmdutil.Factory, version, buildDate string) (*cobra.Command, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { // require that the user is authenticated before running most commands if cmdutil.IsAuthCheckEnabled(cmd) && !cmdutil.CheckAuth(cfg) { - fmt.Fprint(io.ErrOut, authHelp()) + if cmd.Parent().Use == "codespace" { + fmt.Fprintln(io.ErrOut, "To get started with GitHub CLI, please run: gh auth login -s codespace") + } else { + fmt.Fprint(io.ErrOut, authHelp()) + } return &AuthError{} } return nil