@smartkomm/plexus-cli 0.1.32 → 0.1.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +50 -24
  2. package/dist/cli.mjs +1382 -1023
  3. package/dist/skill/.managed-by-plexus-cli +1 -1
  4. package/dist/skill/SKILL.md +26 -16
  5. package/dist/skill/references/audit/answer-access-request.md +2 -2
  6. package/dist/skill/references/commands.md +1072 -742
  7. package/dist/skill/references/config/init-tenant.md +4 -4
  8. package/dist/skill/references/config/platform-setup-export.md +2 -2
  9. package/dist/skill/references/notifications/debug-mail-delivery.md +8 -8
  10. package/dist/skill/references/notifications/reword-a-letter.md +2 -2
  11. package/dist/skill/references/notifications/trace-a-login.md +2 -2
  12. package/dist/skill/references/offer/assignment-rule.md +5 -5
  13. package/dist/skill/references/offer/task-result-files.md +1 -1
  14. package/dist/skill/references/persons/purge-deleted-person.md +2 -2
  15. package/dist/skill/references/resolver/register-input-keys.md +7 -7
  16. package/dist/skill/references/retention/erase-due-parties.md +3 -3
  17. package/dist/skill/references/signing/connect-a-school.md +3 -3
  18. package/dist/skill/references/signing/rotate-the-key.md +3 -3
  19. package/dist/skill/references/users/add-platform-admin.md +8 -8
  20. package/dist/skill/references/users/add-platform-user.md +2 -2
  21. package/dist/skill/references/users/add-tenant-admin.md +6 -6
  22. package/dist/skill/references/users/change-login-email.md +6 -6
  23. package/dist/skill/references/users/cli-access-for-tenant-admin.md +2 -2
  24. package/dist/skill/references/users/delete-permission-group.md +3 -3
  25. package/dist/skill/references/users/grant-cross-tenant-access.md +6 -6
  26. package/dist/skill/references/users/grant-feedback-assignable.md +4 -4
  27. package/dist/skill/references/users/manage-school-users.md +19 -2
  28. package/dist/skill/references/users/set-password.md +10 -10
  29. package/dist/skill/references/users/set-staff-config-key.md +70 -0
  30. package/dist/skill/references/users/use-test-account.md +2 -2
  31. package/dist/skill/references/worker-ops/debug-worker-jobs.md +7 -7
  32. package/dist/spec.snapshot.json +1 -1
  33. package/package.json +1 -1
@@ -12,17 +12,17 @@ password; it grants nothing and creates nothing.
12
12
  - **Inputs:** the user's email. The identity **must already exist** (provision it
13
13
  first with [add-tenant-admin](./add-tenant-admin.md) /
14
14
  [add-platform-admin](./add-platform-admin.md)).
15
- - **Tooling:** an installed `plexus-cli` (`plexus-cli users set-password --help`).
15
+ - **Tooling:** an installed `plexus-cli` (`plexus-cli platform users set-password --help`).
16
16
 
17
17
  ## Steps
18
18
  ```bash
19
19
  # Set a known password (piped in, never as an argument):
20
- printf %s "$PW" | plexus-cli --env <env> users set-password <email> --password-stdin
20
+ printf %s "$PW" | plexus-cli --env <env> platform users set-password <email> --password-stdin
21
21
  # …or from a file:
22
- plexus-cli --env <env> users set-password <email> --password-file <path>
22
+ plexus-cli --env <env> platform users set-password <email> --password-file <path>
23
23
 
24
24
  # …or let the server generate a strong one (returned once; capture without echoing):
25
- plexus-cli --env <env> users set-password <email> --out creds.csv --quiet
25
+ plexus-cli --env <env> platform users set-password <email> --out creds.csv --quiet
26
26
  ```
27
27
 
28
28
  The server owns hashing + generation and returns the plaintext **once** (only the
@@ -31,7 +31,7 @@ keeps it off stdout.
31
31
 
32
32
  ## Verify
33
33
  ```bash
34
- plexus-cli --env <env> users show <email> # identity unchanged (sanity)
34
+ plexus-cli --env <env> platform users show <email> # identity unchanged (sanity)
35
35
  ```
36
36
  Then confirm the new password actually logs in at the env's `/login`.
37
37
 
@@ -43,17 +43,17 @@ bare, one block per account. See
43
43
 
44
44
  ## Idempotency / gotchas
45
45
  - **Pure credential write** — it creates no identity, tenant access, person, or
46
- permission, and changes no groups. Use `users provision` /
47
- `users provision --platform-admin` to *create* a ready-to-log-in user;
46
+ permission, and changes no groups. Use `platform users provision` /
47
+ `platform users provision --platform-admin` to *create* a ready-to-log-in user;
48
48
  `set-password` only rotates an **existing** one.
49
49
  - **Fails loud, never repairs by creating:** throws if no Plexus identity exists for
50
50
  the email, if the email has no live Better Auth account, or if that account
51
- doesn't match the identity (an orphan → run `users relink-auth` first, then retry).
51
+ doesn't match the identity (an orphan → run `platform users relink-auth` first, then retry).
52
52
  - The password is shown **once**; re-run to mint a fresh one if you lose it.
53
53
  - Email match is case-insensitive (the backend lowercases it).
54
54
 
55
55
  ## Related
56
56
  - [Add a tenant admin](./add-tenant-admin.md) · [Add a platform admin](./add-platform-admin.md)
57
57
  — both also accept `--password-stdin` / `--password-file` at creation time.
58
- - `users relink-auth <email>` — repair an orphaned identity before setting a password.
59
- - Command reference: `plexus-cli users set-password --help`.
58
+ - `platform users relink-auth <email>` — repair an orphaned identity before setting a password.
59
+ - Command reference: `plexus-cli platform users set-password --help`.
@@ -0,0 +1,70 @@
1
+ # Give a staff member a config key
2
+
3
+ **When to use:** a responsibility rule or the school's configuration must name a
4
+ member of staff — and that person has no key yet (they were invited in the app or
5
+ the CLI), or their key should read better than a drawn `staff_…` one. The key is
6
+ the stable handle rules and configuration name a person by: it survives a change
7
+ of the sign-in address, never their name.
8
+
9
+ A **school's token suffices**: `tenant-users set-key` asks for
10
+ `administration.users.manage` in the school, like every `tenant-users` command.
11
+
12
+ ## Prerequisites
13
+ - A `plx_…` token and `default_tenant` (or `--tenant <slug>`) — see
14
+ [CLI access for a tenant admin](./cli-access-for-tenant-admin.md).
15
+ - `--env` is required for every write; prod also needs `--allow-prod`.
16
+ - The person is a user of the school (`tenant-users list`), not archived.
17
+
18
+ ## Steps
19
+
20
+ **1 — see who holds which key** (the `key` column names who gave it: `config` —
21
+ declared in the configuration, `rule` — drawn when a rule picked the person,
22
+ `admin` — set in the user administration):
23
+
24
+ ```bash
25
+ plexus-cli --env <env> --tenant <slug> tenant-users list
26
+ plexus-cli --env <env> --tenant <slug> tenant-users show <email>
27
+ ```
28
+
29
+ **2 — set the key.** Without `--confirm` the command prints the old and the new
30
+ key; with it, the key is written and one Verlauf row records it:
31
+
32
+ ```bash
33
+ plexus-cli --env <env> --tenant <slug> tenant-users set-key <email> --key <key>
34
+ plexus-cli --env <env> --tenant <slug> tenant-users set-key <email> --key <key> --confirm
35
+ ```
36
+
37
+ A new member can get the key with the invitation:
38
+
39
+ ```bash
40
+ plexus-cli --env <env> --tenant <slug> tenant-users invite --first-name <first> --last-name <last> --email <email> --language de --key <key> --confirm
41
+ ```
42
+
43
+ In the app: *Administration → Nutzer* → the person → *Konto* → *Schlüssel* →
44
+ „Ändern".
45
+
46
+ ## Verify
47
+
48
+ ```bash
49
+ plexus-cli --env <env> --tenant <slug> tenant-users show <email> # key <key> (admin)
50
+ plexus-cli --env <env> --tenant <slug> tenant-users history <email> # key … → <key>
51
+ ```
52
+
53
+ ## Idempotency / gotchas
54
+ - A key is lower-case letters, digits, `-` and `_`, starts with a letter and has
55
+ at most 64 characters (`[tenantUsers/configKey]` otherwise).
56
+ - A key names one person per school: a key someone else holds is refused, naming
57
+ them (`[tenantUsers/configKeyTaken]`) — nothing is taken away from anyone.
58
+ - Renaming a key a responsibility rule names is refused
59
+ (`[assignment/ruleReferences]`, the same refusal as for a configuration that
60
+ re-keys the person): change the rule first (workflow editor, then publish).
61
+ - Setting the key the person already holds changes nothing and writes no Verlauf row.
62
+ - A key declared in the configuration stays the configuration's: the next
63
+ `config apply` writes the configured key back. Change it there instead
64
+ (`config export`, edit `foundation.users`, `config apply`).
65
+ - A key set here (or drawn by a rule) does not make the person a configuration
66
+ user: `config export` leaves them out of `foundation.users`.
67
+
68
+ ## Related
69
+ - [Manage a school's users](./manage-school-users.md) — invite, groups, deactivate.
70
+ - [Change, test and publish a responsibility rule](../offer/assignment-rule.md) — rules name people by this key.
@@ -18,7 +18,7 @@ applicant — on local, staging or prod — without registering a new address fi
18
18
  ### 1. Check the account in the target tenant
19
19
 
20
20
  ```bash
21
- plexus-cli --env <local|staging|prod> users show test@example.com
21
+ plexus-cli --env <local|staging|prod> platform users show test@example.com
22
22
  ```
23
23
 
24
24
  Expect one access row per tenant with an applicant portal, each in the
@@ -29,7 +29,7 @@ Expect one access row per tenant with an applicant portal, each in the
29
29
  A deploy provisions the account with a random password nobody holds. Set one:
30
30
 
31
31
  ```bash
32
- plexus-cli --env <staging|prod> --tenant <slug> users set-password test@example.com
32
+ plexus-cli --env <staging|prod> --tenant <slug> platform users set-password test@example.com
33
33
  ```
34
34
 
35
35
  The identity is global, so this one password opens the account in **every**
@@ -35,7 +35,7 @@ glitchtip-cli issues list
35
35
  # (the CLI `issues list` has no tag filter).
36
36
 
37
37
  # 5. Is the reaper (the only authority that frees stuck leases) actually firing?
38
- plexus-cli --env prod workers reaper-status --json # ranAt should be < ~1 min old
38
+ plexus-cli --env prod platform workers reaper-status --json # ranAt should be < ~1 min old
39
39
  ```
40
40
 
41
41
  ### The decision rule (why did the worker die?)
@@ -52,13 +52,13 @@ A job reaper-failed / vanished, **and**:
52
52
 
53
53
  ```bash
54
54
  # Force a reaper pass now instead of waiting for the 1-min cron.
55
- plexus-cli --env prod workers reap --allow-prod --json
55
+ plexus-cli --env prod platform workers reap --allow-prod --json
56
56
 
57
57
  # Clear import runs stuck 'running' with no active job (the orphan class).
58
58
  # DRY-RUN first (no --confirm), then confirm. Marks failed, never deletes.
59
- plexus-cli --env prod imports cleanup-orphaned --tenant <slug>
60
- plexus-cli --env prod imports cleanup-orphaned --allow-prod --tenant <slug> --confirm
61
- plexus-cli --env prod imports cleanup-orphaned --all-tenants # dry-run sweep
59
+ plexus-cli --env prod platform imports cleanup-orphaned --tenant <slug>
60
+ plexus-cli --env prod platform imports cleanup-orphaned --allow-prod --tenant <slug> --confirm
61
+ plexus-cli --env prod platform imports cleanup-orphaned --all-tenants # dry-run sweep
62
62
 
63
63
  # Cancel a job that should not be running (plan first; --confirm cancels).
64
64
  plexus-cli --env prod jobs cancel --allow-prod <jobId>
@@ -86,5 +86,5 @@ plexus-cli --env prod jobs list --status running # nothing unexpectedly in
86
86
  past the row you want.
87
87
 
88
88
  ## Related
89
- - Command reference: `plexus-cli jobs list --help`, `plexus-cli workers reap --help`,
90
- `plexus-cli imports cleanup-orphaned --help`.
89
+ - Command reference: `plexus-cli jobs list --help`, `plexus-cli platform workers reap --help`,
90
+ `plexus-cli platform imports cleanup-orphaned --help`.