User Creation via CLI
The user:create command allows you to manually create user accounts via the command line interface. This is useful for administrative purposes or automated setup scenarios.
Basic Usage
Section titled “Basic Usage”Simple User Creation
Section titled “Simple User Creation”To create a new user with interactive password prompt:
docker exec -it slink slink user:create --email=<email> --username=<username>The command will prompt you to enter a password interactively.
Example:
User Creation with Display Name
Section titled “User Creation with Display Name”You can optionally provide a custom display name:
docker exec -it slink slink user:create --email=<email> --username=<username> --display-name="<display-name>"Example:
docker exec -it slink slink user:create [email protected] --username=johnsmith --display-name="John Smith"If no display name is provided, the username will be used as the display name.
Command Options
Section titled “Command Options”Email Option (required)
Section titled “Email Option (required)”Specify the user’s email address:
docker exec -it slink slink user:create --email=<email> --username=<username>Username Option (required)
Section titled “Username Option (required)”Specify the username:
docker exec -it slink slink user:create --email=<email> --username=<username>Display Name Option
Section titled “Display Name Option”Provide a custom display name (optional):
docker exec -it slink slink user:create --email=<email> --username=<username> --display-name="<display-name>"Password Option
Section titled “Password Option”Provide the password directly without interactive prompt (short form: -p):
docker exec -it slink slink user:create --email=<email> --username=<username> --password="<password>"Example:
docker exec -it slink slink user:create [email protected] --username=johnsmith --password="SecurePass123!"Activate Option
Section titled “Activate Option”Immediately activate the user account upon creation (short form: -a):
docker exec -it slink slink user:create --email=<email> --username=<username> --activateExample:
Combining Options
Section titled “Combining Options”You can combine multiple options together:
docker exec -it slink slink user:create --email=<email> --username=<username> --display-name="<display-name>" --password="<password>" --activateExample:
docker exec -it slink slink user:create [email protected] --username=johnsmith --display-name="John Smith" --password="SecurePass123!" --activatePractical Examples
Section titled “Practical Examples”Create an inactive user for later activation
Section titled “Create an inactive user for later activation”# When prompted, enter a secure passwordUser will be created in inactive status and can be activated later using the user:activate command.
Create an active admin user
Section titled “Create an active admin user”docker exec -it slink slink user:create [email protected] --username=admin --display-name="System Administrator" --password="AdminPass123!" --activateThen grant admin role:
Related Commands
Section titled “Related Commands”user:activate- Activate a pending user accountuser:grant:role- Grant roles to usersuser:revoke:role- Revoke roles from users
Error Handling
Section titled “Error Handling”Email already exists
Section titled “Email already exists”If you try to create a user with an email that already exists:
Error: User with this email already exists.Username already exists
Section titled “Username already exists”If the username is already taken:
Error: User with this username already exists.Invalid password
Section titled “Invalid password”If the password doesn’t meet complexity requirements:
Error: Password must contain uppercase, lowercase, numbers, and special characters.Invalid email format
Section titled “Invalid email format”If the email format is invalid:
Error: This value is not a valid email address.