Scroll to navigation

glab(1) glab(1)

NAME

glab-service-account-create - Create a service account.

SYNOPSIS

glab service-account create [flags]

DESCRIPTION

Create a service account for a project or a group.

  • Every flag is optional. Without --name, the account is named "Service account user". Without --username or --email, GitLab generates them.
  • A custom email address must be confirmed before the account uses it, unless the top-level group has a matching verified domain or email confirmation is turned off on the instance. Until then, the address is shown as the unconfirmed email.
  • A service account created in a top-level group can be invited to any group or project on the instance. One created in a subgroup can be invited only to that subgroup and its descendants.

Creating a service account in a subgroup requires GitLab 18.11 or later. Setting --email for a group service account requires GitLab 17.11 or later.

OPTIONS

--email="" Email address of the service account.

-g, --group="" Create a service account for a group instead of a project. Accepts a group ID or full path.

--jq="" Filter JSON output with a jq expression.

--name="" Name of the service account.

-F, --output="text" Format output as: text, json.

-R, --repo="" Select another repository. You can use either OWNER/REPO or GROUP/NAMESPACE/REPO. The full URL or Git URL is also accepted.

--username="" The service account's username.

OPTIONS INHERITED FROM PARENT COMMANDS

-h, --help[=false] Show help for this command.

EXAMPLE

# Create a service account for the current project
glab service-account create --name "Release bot"
# Create it with a chosen username and email address
glab service-account create --name "Release bot" --username release-bot --email release-bot@example.com
# Create a service account for a specific project
glab service-account create --name "Release bot" --repo user/my-repo
# Create a group service account
glab service-account create --name "Release bot" --group my-group
# Create a service account and print its ID from a script
glab service-account create --name "Release bot" --output json --jq '.id'

SEE ALSO

glab-service-account(1)

Nov 2026 Auto generated by spf13/cobra