MCPcopy Create free account
hub / github.com/cli/cli / NewCmdAuth

Function NewCmdAuth

pkg/cmd/auth/auth.go:17–41  ·  view source on GitHub ↗
(f *cmdutil.Factory, telemetry ghtelemetry.InvocationRecorder)

Source from the content-addressed store, hash-verified

15)
16
17func NewCmdAuth(f *cmdutil.Factory, telemetry ghtelemetry.InvocationRecorder) *cobra.Command {
18 cmd := &cobra.Command{
19 Use: "auth <command>",
20 Short: "Authenticate gh and git with GitHub",
21 GroupID: "core",
22 }
23
24 cmdutil.DisableAuthCheck(cmd)
25
26 loginCmd := authLoginCmd.NewCmdLogin(f, telemetry, nil)
27 refreshCmd := authRefreshCmd.NewCmdRefresh(f, telemetry, nil)
28
29 cmd.AddCommand(loginCmd)
30 cmd.AddCommand(authLogoutCmd.NewCmdLogout(f, nil))
31 cmd.AddCommand(authStatusCmd.NewCmdStatus(f, nil))
32 cmd.AddCommand(refreshCmd)
33 cmd.AddCommand(gitCredentialCmd.NewCmdCredential(f, nil))
34 cmd.AddCommand(authSetupGitCmd.NewCmdSetupGit(f, nil))
35 cmd.AddCommand(authTokenCmd.NewCmdToken(f, nil))
36 cmd.AddCommand(authSwitchCmd.NewCmdSwitch(f, nil))
37
38 cmdutil.DisableTelemetryForSubcommands(cmd)
39
40 return cmd
41}

Callers

nothing calls this directly

Calls 2

DisableAuthCheckFunction · 0.92

Tested by

no test coverage detected