github.com/ungtb10d/cli/v2@v2.0.0-20221110210412-98537dd9d6a1/pkg/cmd/auth/auth.go (about) 1 package auth 2 3 import ( 4 gitCredentialCmd "github.com/ungtb10d/cli/v2/pkg/cmd/auth/gitcredential" 5 authLoginCmd "github.com/ungtb10d/cli/v2/pkg/cmd/auth/login" 6 authLogoutCmd "github.com/ungtb10d/cli/v2/pkg/cmd/auth/logout" 7 authRefreshCmd "github.com/ungtb10d/cli/v2/pkg/cmd/auth/refresh" 8 authSetupGitCmd "github.com/ungtb10d/cli/v2/pkg/cmd/auth/setupgit" 9 authStatusCmd "github.com/ungtb10d/cli/v2/pkg/cmd/auth/status" 10 authTokenCmd "github.com/ungtb10d/cli/v2/pkg/cmd/auth/token" 11 "github.com/ungtb10d/cli/v2/pkg/cmdutil" 12 "github.com/spf13/cobra" 13 ) 14 15 func NewCmdAuth(f *cmdutil.Factory) *cobra.Command { 16 cmd := &cobra.Command{ 17 Use: "auth <command>", 18 Short: "Authenticate gh and git with GitHub", 19 Annotations: map[string]string{ 20 "IsCore": "true", 21 }, 22 } 23 24 cmdutil.DisableAuthCheck(cmd) 25 26 cmd.AddCommand(authLoginCmd.NewCmdLogin(f, nil)) 27 cmd.AddCommand(authLogoutCmd.NewCmdLogout(f, nil)) 28 cmd.AddCommand(authStatusCmd.NewCmdStatus(f, nil)) 29 cmd.AddCommand(authRefreshCmd.NewCmdRefresh(f, nil)) 30 cmd.AddCommand(gitCredentialCmd.NewCmdCredential(f, nil)) 31 cmd.AddCommand(authSetupGitCmd.NewCmdSetupGit(f, nil)) 32 cmd.AddCommand(authTokenCmd.NewCmdToken(f, nil)) 33 34 return cmd 35 }