cli/pkg/cmd/auth/auth.go
Kynan Ware 65fcba95d9 Add godoc comments to exported symbols in pkg/cmd/auth
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-04 16:08:04 -07:00

36 lines
1.3 KiB
Go

package auth
import (
gitCredentialCmd "github.com/cli/cli/v2/pkg/cmd/auth/gitcredential"
authLoginCmd "github.com/cli/cli/v2/pkg/cmd/auth/login"
authLogoutCmd "github.com/cli/cli/v2/pkg/cmd/auth/logout"
authRefreshCmd "github.com/cli/cli/v2/pkg/cmd/auth/refresh"
authSetupGitCmd "github.com/cli/cli/v2/pkg/cmd/auth/setupgit"
authStatusCmd "github.com/cli/cli/v2/pkg/cmd/auth/status"
authSwitchCmd "github.com/cli/cli/v2/pkg/cmd/auth/switch"
authTokenCmd "github.com/cli/cli/v2/pkg/cmd/auth/token"
"github.com/cli/cli/v2/pkg/cmdutil"
"github.com/spf13/cobra"
)
// NewCmdAuth creates the 'auth' command and its subcommands for managing GitHub authentication.
func NewCmdAuth(f *cmdutil.Factory) *cobra.Command {
cmd := &cobra.Command{
Use: "auth <command>",
Short: "Authenticate gh and git with GitHub",
GroupID: "core",
}
cmdutil.DisableAuthCheck(cmd)
cmd.AddCommand(authLoginCmd.NewCmdLogin(f, nil))
cmd.AddCommand(authLogoutCmd.NewCmdLogout(f, nil))
cmd.AddCommand(authStatusCmd.NewCmdStatus(f, nil))
cmd.AddCommand(authRefreshCmd.NewCmdRefresh(f, nil))
cmd.AddCommand(gitCredentialCmd.NewCmdCredential(f, nil))
cmd.AddCommand(authSetupGitCmd.NewCmdSetupGit(f, nil))
cmd.AddCommand(authTokenCmd.NewCmdToken(f, nil))
cmd.AddCommand(authSwitchCmd.NewCmdSwitch(f, nil))
return cmd
}