users¶
NAME¶
phyware users — invite users, accept invites, and list, retrieve and deactivate users.
SYNOPSIS¶
phyware users invite [OPTIONS] --email <EMAIL>
phyware users accept-invite [OPTIONS] --token <TOKEN>
phyware users list [OPTIONS]
phyware users get [OPTIONS] <USER_ID>
phyware users deactivate [OPTIONS] <USER_ID>
DESCRIPTION¶
invite¶
Creates a single-use invite token (valid 72 hours) granting --scopes. Share it with the user over a secure channel; it is shown once. You can only grant scopes you hold yourself.
accept-invite¶
Sets your password with an invite token and creates your account, with the scopes the invite grants. Needs no credential. Then log in with phyware auth password-login.
list¶
Returns all users for the active tenant.
get¶
Returns full details for a single user.
deactivate¶
Soft-deletes a user, revoking all sessions and API keys.
OPTIONS¶
| Flag | Type | Required | Default | Env |
|---|---|---|---|---|
--url | string | No | http://localhost:8000 | PHYCLOUD_URL |
--api-key | string | No | — | PHYCLOUD_API_KEY |
--output | enum | No | table | — |
| --email | string | Yes (invite) | — | — | | --scopes | string | No (invite) | events:read,events:write | — | | --display-name | string | No | — | — | | --token | string | Yes (accept-invite) | — | — | | --password | string | No (accept-invite; prompted if omitted) | — | PHYWARE_PASSWORD |
Without --api-key, commands use the session from phyware auth login or auth password-login.
ARGUMENTS¶
| Name | Required | Description |
|---|---|---|
USER_ID | Yes (get/deactivate) | Unique user identifier |
INPUT¶
None.
OUTPUT¶
| Field | Type | Description |
|---|---|---|
id | string | User identifier |
email | string | User email address |
status | string | active / pending / inactive |
role | string | User role |
EXIT CODES¶
| Code | Meaning |
|---|---|
0 | Success |
1 | Generic / connection error |
2 | Authentication / authorisation error |
3 | Resource not found |
4 | Validation error |
5 | Server-side error |
EXAMPLES¶
# Invite a user
phyware users invite --email alice@example.com
# Invite with a specific role
phyware users invite --email bob@example.com --role admin
# List all users
phyware users list
# List users as JSON
phyware users list --output json
# Get a specific user
phyware users get usr_abc123
# Deactivate a user
phyware users deactivate usr_abc123
AGENT NOTES¶
invite creates the user in pending status until the invitation is accepted. deactivate is irreversible via the CLI. Requires admin:users scope for all operations.
SEE ALSO¶
ERRORS¶
| Code | Message | Remediation |
|---|---|---|
CONFLICT | Email already exists | User already invited |
FORBIDDEN | Insufficient scope | Ensure admin:users |
NOT_FOUND | User not found | Check USER_ID |