users

package
v0.14.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CmdUserCreate = cli.Command{
	Name:        "create",
	Aliases:     []string{"add", "new"},
	Usage:       "Create a new user",
	Description: "Create a new user account",
	ArgsUsage:   " ",
	Action:      RunUserCreate,
	Flags: append([]cli.Flag{
		&cli.StringFlag{
			Name:     "username",
			Aliases:  []string{"u"},
			Usage:    "Username for the new user (required)",
			Required: true,
		},
		&cli.StringFlag{
			Name:    "password",
			Aliases: []string{"p"},
			Usage:   "Password for the new user (will prompt if not provided)",
		},
		&cli.StringFlag{
			Name:  "password-file",
			Usage: "Read password from file",
		},
		&cli.BoolFlag{
			Name:  "password-stdin",
			Usage: "Read password from stdin",
		},
		&cli.StringFlag{
			Name:     "email",
			Aliases:  []string{"e"},
			Usage:    "Email address for the new user (required)",
			Required: true,
		},
		&cli.StringFlag{
			Name:  "full-name",
			Usage: "Full name for the new user",
		},
		&cli.BoolFlag{
			Name:  "admin",
			Usage: "Make the user an administrator",
		},
		&cli.BoolFlag{
			Name:  "restricted",
			Usage: "Make the user restricted",
		},
		&cli.BoolFlag{
			Name:  "prohibit-login",
			Usage: "Prohibit the user from logging in",
		},
		&cli.BoolFlag{
			Name:  "no-must-change-password",
			Usage: "Don't require the user to change password on first login (default: password change required)",
		},
		&cli.StringFlag{
			Name:  "visibility",
			Usage: "Visibility of the user profile (public, limited, private)",
			Value: "public",
		},
	}, flags.AllDefaultFlags...),
}

CmdUserCreate represents a sub command of users to create a user

View Source
var CmdUserDelete = cli.Command{
	Name:        "delete",
	Aliases:     []string{"rm", "remove"},
	Usage:       "Delete a user",
	Description: "Delete a user account",
	ArgsUsage:   "<username>",
	Action:      RunUserDelete,
	Flags: append([]cli.Flag{
		&cli.BoolFlag{
			Name:    "confirm",
			Aliases: []string{"y"},
			Usage:   "confirm deletion without prompting",
		},
	}, flags.AllDefaultFlags...),
}

CmdUserDelete represents a sub command of users to delete a user

View Source
var CmdUserEdit = cli.Command{
	Name:        "edit",
	Aliases:     []string{"update", "e", "u"},
	Usage:       "Edit a user",
	Description: "Edit user account properties",
	ArgsUsage:   "<username>",
	Action:      RunUserEdit,
	Flags: append([]cli.Flag{
		&cli.StringFlag{
			Name:  "password",
			Usage: "New password (use empty value --password=\"\" to trigger interactive prompt)",
			Value: "",
		},
		&cli.StringFlag{
			Name:  "password-file",
			Usage: "Read password from file",
		},
		&cli.BoolFlag{
			Name:  "password-stdin",
			Usage: "Read password from stdin",
		},
		&cli.StringFlag{
			Name:    "email",
			Aliases: []string{"e"},
			Usage:   "Email address",
		},
		&cli.StringFlag{
			Name:  "full-name",
			Usage: "Full name",
		},
		&cli.StringFlag{
			Name:  "description",
			Usage: "User description",
		},
		&cli.StringFlag{
			Name:  "website",
			Usage: "Website URL",
		},
		&cli.StringFlag{
			Name:  "location",
			Usage: "Location",
		},
		&cli.BoolFlag{
			Name:  "admin",
			Usage: "Make the user an administrator",
		},
		&cli.BoolFlag{
			Name:  "no-admin",
			Usage: "Remove administrator status",
		},
		&cli.BoolFlag{
			Name:  "restricted",
			Usage: "Make the user restricted",
		},
		&cli.BoolFlag{
			Name:  "no-restricted",
			Usage: "Remove restricted status",
		},
		&cli.BoolFlag{
			Name:  "prohibit-login",
			Usage: "Prohibit the user from logging in",
		},
		&cli.BoolFlag{
			Name:  "allow-login",
			Usage: "Allow the user to log in",
		},
		&cli.BoolFlag{
			Name:  "active",
			Usage: "Activate the user",
		},
		&cli.BoolFlag{
			Name:  "inactive",
			Usage: "Deactivate the user",
		},
		&cli.BoolFlag{
			Name:  "no-must-change-password",
			Usage: "Don't require the user to change password on next login (default: password change required)",
		},
		&cli.StringFlag{
			Name:  "visibility",
			Usage: "Visibility of the user profile (public, limited, private)",
		},
		&cli.IntFlag{
			Name:  "max-repo-creation",
			Usage: "Maximum number of repositories the user can create (-1 for unlimited)",
		},
		&cli.BoolFlag{
			Name:  "allow-git-hook",
			Usage: "Allow the user to use git hooks",
		},
		&cli.BoolFlag{
			Name:  "no-allow-git-hook",
			Usage: "Disallow the user from using git hooks",
		},
		&cli.BoolFlag{
			Name:  "allow-import-local",
			Usage: "Allow the user to import local repositories",
		},
		&cli.BoolFlag{
			Name:  "no-allow-import-local",
			Usage: "Disallow the user from importing local repositories",
		},
		&cli.BoolFlag{
			Name:  "allow-create-organization",
			Usage: "Allow the user to create organizations",
		},
		&cli.BoolFlag{
			Name:  "no-allow-create-organization",
			Usage: "Disallow the user from creating organizations",
		},
	}, flags.AllDefaultFlags...),
}

CmdUserEdit represents a sub command of users to edit a user

View Source
var CmdUserList = cli.Command{
	Name:        "list",
	Aliases:     []string{"ls"},
	Usage:       "List Users",
	Description: "List users",
	Action:      RunUserList,
	Flags: append([]cli.Flag{
		userFieldsFlag,
		&flags.PaginationPageFlag,
		&flags.PaginationLimitFlag,
	}, flags.AllDefaultFlags...),
}

CmdUserList represents a sub command of users to list users

Functions

func RunUserCreate added in v0.14.1

func RunUserCreate(_ stdctx.Context, cmd *cli.Command) error

RunUserCreate creates a new user

func RunUserDelete added in v0.14.1

func RunUserDelete(_ stdctx.Context, cmd *cli.Command) error

RunUserDelete deletes a user

func RunUserEdit added in v0.14.1

func RunUserEdit(_ stdctx.Context, cmd *cli.Command) error

RunUserEdit edits an existing user

func RunUserList

func RunUserList(_ stdctx.Context, cmd *cli.Command) error

RunUserList list users

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL