package serviceaccount import ( "github.com/MakeNowJust/heredoc/v2" "github.com/spf13/cobra" "gitlab.com/gitlab-org/cli/internal/cmdutils" cmdCreate "gitlab.com/gitlab-org/cli/internal/commands/service-account/create" cmdDelete "gitlab.com/gitlab-org/cli/internal/commands/service-account/delete" cmdGet "gitlab.com/gitlab-org/cli/internal/commands/service-account/get" cmdList "gitlab.com/gitlab-org/cli/internal/commands/service-account/list" cmdToken "gitlab.com/gitlab-org/cli/internal/commands/service-account/token" cmdUpdate "gitlab.com/gitlab-org/cli/internal/commands/service-account/update" ) func NewCmd(f cmdutils.Factory) *cobra.Command { cmd := &cobra.Command{ Use: "service-account ", Short: "Manage service accounts.", Long: heredoc.Docf(` Manage the service accounts of a project or a group. Service accounts are user accounts that represent a non-human entity, such as a CI/CD job, a script, or an external system, rather than a person. These commands act on the current project. Use %[1]s--repo%[1]s to target a different project, or %[1]s--group%[1]s to act on a group instead. If %[1]sGITLAB_GROUP%[1]s is set and neither flag is given, these commands act on that group. Group service accounts require the Owner role for the group. On GitLab Self-Managed and GitLab Dedicated, they require an administrator, or the Owner role when an administrator has turned on the setting to allow top-level group Owners to create service accounts. Project service accounts require the Maintainer or Owner role for the project, or an administrator. They require GitLab 18.11 or later. `, "`"), } cmdutils.EnableRepoOverride(cmd, f) cmd.AddCommand(cmdCreate.NewCmd(f)) cmd.AddCommand(cmdDelete.NewCmd(f)) cmd.AddCommand(cmdGet.NewCmd(f)) cmd.AddCommand(cmdList.NewCmd(f)) cmd.AddCommand(cmdToken.NewCmd(f)) cmd.AddCommand(cmdUpdate.NewCmd(f)) return cmd }