Skip to main content

mr user update

Update an existing user account. Only the flags you pass are sent and changed; omitted fields are preserved by the server. Use --disabled to lock an account and --enable to unlock it; disabling an account or setting a new password revokes its sessions and API tokens. --disabled and --enable cannot be combined. Passwords must be at least 8 characters and at most 72 bytes. Demoting or disabling the last enabled administrator is refused with HTTP 409 Conflict, so an instance can never be left without an admin.

Usage

mr user update <id>

Positional arguments:

  • <id>

Examples

Promote user 4 to editor

mr user update 4 --role editor

Disable an account and reset its password

mr user update 4 --disabled --password password2

Flags

FlagTypeDefaultDescription
--usernamestring``New username
--passwordstring``New password (omit to keep the current one; setting one revokes the account's sessions and tokens)
--rolestring``New role: admin, editor, user, or guest
--display-namestring``New display name
--scope-groupuint0New scope group id (use 0 to clear)
--disabledboolfalseDisable the account (revokes its sessions and tokens)
--enableboolfalseRe-enable a disabled account

Inherited global flags

FlagTypeDefaultDescription
--jsonboolfalseOutput raw JSON
--no-headerboolfalseOmit table headers
--pageint1Page number for list commands (default page size: 50)
--quietboolfalseOnly output IDs
--serverstringhttp://localhost:8181mahresources server URL (env: MAHRESOURCES_URL)

Exit Codes

0 success; 1 error (not authenticated, insufficient role, validation error, or user not found)