cloud bootstrap¶
NAME¶
phyware cloud bootstrap — initialise a PhyCloud platform and its first admin user.
SYNOPSIS¶
phyware cloud bootstrap init --token <TOKEN> [--admin-email <EMAIL>] [OPTIONS]
phyware cloud bootstrap admin --token <TOKEN> --admin-email <EMAIL> [OPTIONS]
phyware cloud bootstrap status [OPTIONS]
DESCRIPTION¶
init¶
Creates the platform tenant and a super-admin API key. With --admin-email, it also creates the platform's first admin user: with --admin-password (or PHYWARE_ADMIN_PASSWORD) the account is ready to log in; without one, the output carries a single-use invite token for the admin to accept with users accept-invite. Runs once: a bootstrapped platform refuses it.
admin¶
Creates the platform's first admin user on a platform bootstrapped without one. Needs the bootstrap token, and only works while the platform tenant has no users; after that, add people with users invite.
status¶
Reports whether the platform has been bootstrapped and whether bootstrap is enabled on the server.
OPTIONS¶
| Flag | Type | Required | Default | Env |
|---|---|---|---|---|
--url | string | No | http://localhost:8000 | PHYCLOUD_URL |
--output | enum | No | table | — |
--token | string | Yes (init, admin) | — | PHYCLOUD_BOOTSTRAP_TOKEN |
--tenant-id | string | No (init) | platform | — |
--tenant-name | string | No (init) | Platform Admin | — |
--admin-email | string | Yes (admin) | — | — |
--admin-password | string | No | — | PHYWARE_ADMIN_PASSWORD |
--admin-name | string | No | — | — |
ARGUMENTS¶
None.
INPUT¶
None.
OUTPUT¶
init:
| Field | Type | Description |
|---|---|---|
tenant_id | string | The platform tenant |
admin_key | string | Super-admin API key — shown once |
scopes | array | The key's scopes |
admin_user | object | With --admin-email: see below |
admin, and admin_user of init:
| Field | Type | Description |
|---|---|---|
email | string | The admin's email |
scopes | array | Scopes the admin's sessions get, including admin:users |
user_id | string | Set when created with a password |
invite_token | string | Set when invited — shown once |
expires_at | string | When the invite expires |
status: bootstrapped, tenant_count, bootstrap_enabled.
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¶
# Check bootstrap status
phyware cloud bootstrap status
# Bootstrap and invite the first admin
phyware cloud bootstrap init --token "$PHYCLOUD_BOOTSTRAP_TOKEN" --admin-email admin@example.com
# Bootstrap with the admin's password set
PHYWARE_ADMIN_PASSWORD=… phyware cloud bootstrap init --admin-email admin@example.com
# A platform bootstrapped without a user: add its first admin
PHYWARE_ADMIN_PASSWORD=… phyware cloud bootstrap admin --admin-email admin@example.com
# Then log in as the admin
phyware auth password-login --email admin@example.com --tenant platform
AGENT NOTES¶
Run status before init: bootstrap runs once. No API key is needed. Save the admin key and any invite token: neither is shown again. Pass passwords through PHYWARE_ADMIN_PASSWORD rather than the command line, to keep them out of shell history.
SEE ALSO¶
ERRORS¶
| Code | Message | Remediation |
|---|---|---|
CONFLICT | Already bootstrapped | Add a first admin with bootstrap admin |
CONFLICT | The platform already has users (admin) | Invite more with users invite |
UNAUTHORIZED | Invalid or missing bootstrap token | Use the server's PHYCLOUD_BOOTSTRAP_TOKEN |
VALIDATION | Bad admin email, or a password that fails policy | Fix the email, or choose a stronger password |