Skip to main content

User Management

v3.0.0+

The tcb user command has been available since v3.0.0.

The tcb user command is used to manage end users (internal/external users) in the CloudBase environment, supporting creation, query, modification, and deletion.

Relationship with Roles

Users and roles (tcb role) are interrelated. Roles can be bound when creating/modifying users, or role members can be managed via tcb role update.

tcb user create

Create a user.

tcb user create <name> [options]

Parameters

ParameterDescriptionDefault Value
nameUsername (required)
-e, --env-id <envId>Environment ID
--uid <uid>Custom User ID (optional, auto-generated if not provided)
--password <pwd>Password (optional)
--type <type>User type: internalUser / externalUserinternalUser
--status <status>User status: ACTIVE / BLOCKEDACTIVE
--nickname <nickname>Nickname
--jsonOutput JSON

Example

# Create an Internal User
tcb user create alice -e my-env-id

# Create a User and Set Password and Nickname
tcb user create alice --password Secret123 --nickname "Alice" -e my-env-id

# Create External User (Banned by Default)
tcb user create external-bob --type externalUser --status BLOCKED -e my-env-id

tcb user list

Query user list, supports multi-dimensional filtering.

tcb user list [options]

Parameters

ParameterAbbreviationDescriptionDefault Value
-e, --env-id <envId>Environment ID
--offset <n>Number of items to skip0
--limit <n>Maximum number of items to return20
--username <name>Filter by username
--nickname <name>Filter by nickname
--phone <phone>Filter by phone number
--jsonOutput JSON

Example

# List All Users (Pagination)
tcb user list -e my-env-id

# Search by username
tcb user list --username alice -e my-env-id

# Pagination (Page 2, 20 items per page)
tcb user list --offset 20 --limit 20 -e my-env-id

tcb user update

Modify user information.

tcb user update <uid> [options]

Parameters

ParameterDescriptionDefault Value
uidUser ID (required)
-e, --env-id <envId>Environment ID
--username <name>New username
--type <type>User type: internalUser / externalUser
--password <pwd>New password
--status <status>User status: ACTIVE / BLOCKED
--nickname <nickname>Nickname
--jsonOutput JSON

Example

# Block user.
tcb user update user-uid-123 --status BLOCKED -e my-env-id

# Change password.
tcb user update user-uid-123 --password NewSecret456 -e my-env-id

# Change both username and nickname simultaneously.
tcb user update user-uid-123 --username bob --nickname "Bob" -e my-env-id

tcb user delete

Delete one or more users (irrecoverable).

tcb user delete <uid...> [options]

Parameters

ParameterDescription
uid...One or more user IDs, space-separated
-e, --env-id <envId>Environment ID
--jsonOutput JSON

Example

# Delete a single user
tcb user delete user-uid-123 -e my-env-id

# Batch Delete
tcb user delete user-uid-123 user-uid-456 -e my-env-id
Caution

The delete operation is irreversible. It is recommended to confirm the user IDs via tcb user list first before performing the operation.