@numericoach/gskills-admin-cli 0.1.29 → 0.1.31

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@numericoach/gskills-admin-cli",
3
- "version": "0.1.29",
3
+ "version": "0.1.31",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Admin-only CLI for GSkills super-admin operations.",
@@ -55,7 +55,7 @@ gskills-admin pages list --take 100 --output jsonl
55
55
  4. Dry-run writes first.
56
56
 
57
57
  ```bash
58
- gskills-admin pages create --data '{"name":"Draft","slug":"draft","language":"fr"}' --dry-run --output json
58
+ gskills-admin pages create --data '{"name":"Draft","slug":"draft","language":"fr","disabled":true,"archived":false}' --dry-run --output json
59
59
  gskills-admin pages update <id> --data '{"disabled":false}' --dry-run --output json
60
60
  gskills-admin pages create --data-file ./page.json --dry-run --output json
61
61
  ```
@@ -70,7 +70,7 @@ gskills-admin cache invalidate --instance <instanceId> --scope pages --dry-run -
70
70
  gskills-admin cache invalidate --instance <instanceId> --scope pages --yes --output json
71
71
  ```
72
72
 
73
- CRUD help exposes `cache.scopes` for resources that are known to feed deploy caches. After create, update, or soft-delete, the database can be correct while the end-user view is still stale. Use the narrowest listed scope first. Use `all` only when the changed setting affects many deploy surfaces or when the narrow scope did not clear the visible stale state.
73
+ CRUD help exposes `cache.scopes` for resources that are known to feed deploy caches. After create, update, or delete, the database can be correct while the end-user view is still stale. Use the narrowest listed scope first. Use `all` only when the changed setting affects many deploy surfaces or when the narrow scope did not clear the visible stale state.
74
74
 
75
75
  Generic `create` and `update` require `--dry-run` or `--yes`. Use `--data-file` for large JSON payloads. Do not ask agents to inline full EditorJS content in shell strings.
76
76
 
@@ -105,6 +105,28 @@ The block helpers read the full page content, find nested blocks by id, generate
105
105
 
106
106
  `pages content-schema` is the machine-readable source of truth for supported EditorJS/GSkills blocks, nested child-block paths, immutable reference fields and examples. Agents should call it before generating or patching page content.
107
107
 
108
+ Content governance and page comments use the same data and write paths as the super-admin governance UI:
109
+
110
+ ```bash
111
+ gskills-admin governance list --instance global --output json
112
+ gskills-admin governance get <entryId> --instance global --output json
113
+ gskills-admin governance comments-board --instance global --mine --output json
114
+ gskills-admin governance open-comment-count --instance global --output json
115
+ gskills-admin governance search --instance global --query Gmail --output json
116
+ gskills-admin governance create-task --entity-type page --entity-id <pageId> --status CHANGES_REQUESTED --task-title "Relire la page" --dry-run --output json
117
+ gskills-admin governance upsert --entity-type page --entity-id <pageId> --status TO_REVIEW --dry-run --output json
118
+ gskills-admin governance update-task <entryId> --task-description-file ./details.md --dry-run --output json
119
+ gskills-admin governance set-assignees <entryId> --user-ids <userId,userId> --dry-run --output json
120
+ gskills-admin governance set-instance <entryId> --target-instance <instanceId> --dry-run --output json
121
+ gskills-admin governance comments add <entryId> --content-file ./comment.md --dry-run --output json
122
+ gskills-admin page-comments list <pageId> --output json
123
+ gskills-admin page-comments add <pageId> --content-file ./comment.md --block-id <blockId> --create-task --dry-run --output json
124
+ gskills-admin page-comments reply <parentCommentId> --content-file ./reply.md --dry-run --output json
125
+ gskills-admin page-comments resolve <commentId> --dry-run --output json
126
+ ```
127
+
128
+ Governance and page-comment writes require `--dry-run` or `--yes`. Task deletion also requires `--force --confirm-delete governance:<entryId>`.
129
+
108
130
  Internal knowledge and resources support direct local file uploads through signed GCS URLs. The CLI gets a signed URL from the authenticated app API, streams the local file directly to storage, then writes the normal row with the returned URL. This avoids routing large videos through a Next.js API body.
109
131
 
110
132
  ```bash
@@ -130,7 +152,7 @@ gskills-admin learning-paths generate-icon <learningPathId> --prompt-file ./icon
130
152
 
131
153
  Do not pass `--use-app-icon` unless the user explicitly asks for the app logo to appear. It is off by default because most parcours icons should be symbolic. Repeating app logos across every learning path gets visually heavy and often produces cluttered, low-quality icons.
132
154
 
133
- Delete commands are soft-only. They require both `--force` and an exact confirmation token, then write the safest inactive field available, such as `disabled: true`, `archived: true`, `isActive: false`, or `active: false`. If a resource cannot be safely disabled, the CLI refuses the delete command.
155
+ Delete commands are soft-only. They require both `--force` and an exact confirmation token, then write the safest inactive field available, preferring `archived: true` when the resource supports it and otherwise falling back to fields such as `disabled: true`, `isActive: false`, or `active: false`. If a resource cannot be safely disabled, the CLI refuses the delete command. After a real delete, re-read the row and verify the inactive field was written.
134
156
 
135
157
  ```bash
136
158
  gskills-admin pages delete <id> --force --confirm-delete pages:<id> --dry-run --output json
@@ -237,6 +259,8 @@ Rules:
237
259
 
238
260
  If `--instance` is omitted, content-like resources default to `instanceId = "global"`.
239
261
 
262
+ On `global`, `disabled: true` means draft for newly created content. The CLI create path defaults to `disabled: true` on global resources that support it unless the payload explicitly says otherwise. On client instances, `disabled: true` means hidden or disabled.
263
+
240
264
  This applies to:
241
265
 
242
266
  - `pages`
@@ -258,6 +282,26 @@ Never guess a client instance from a name if the CLI can list it:
258
282
  gskills-admin instances list --where '{"name":{"contains":"Air Liquide","mode":"insensitive"}}' --output json
259
283
  ```
260
284
 
285
+ ## Workflow Authoring
286
+
287
+ Use the guided workflow commands before raw `workflows` and `workflow-actions` CRUD.
288
+
289
+ ```bash
290
+ gskills-admin workflows schema --output json
291
+ gskills-admin workflows schema --trigger LEARNING_PATH_NOT_STARTED --output json
292
+ gskills-admin workflows example --trigger LEARNING_PATH_NOT_STARTED --output json
293
+ gskills-admin workflows preview-email --data-file ./workflow.json --fake --language fr --output json
294
+ gskills-admin workflows preview-email --data-file ./workflow.json --user user@example.com --language fr --output json
295
+ gskills-admin workflows create-configured --instance global --data-file ./workflow.json --inactive --dry-run --output json
296
+ gskills-admin workflows create-configured --instance global --data-file ./workflow.json --active --yes --output json
297
+ ```
298
+
299
+ `workflows schema` is the machine-readable source of truth for supported workflow triggers, actions, trigger config, trigger payloads, email variables, button placeholders and examples.
300
+
301
+ `create-configured` creates the workflow and all actions in one operation. It requires an activation decision. Ask the human whether to enable the workflow now, then pass `--active` or `--inactive`. Prefer `--inactive` until trigger ids, recipients, translations and preview email are approved.
302
+
303
+ Email actions use `config.templates`, a map of language code to `{ subject, body }`. Keep variables unchanged across translations. `preview-email` renders the exact subject and body without sending anything. Use `--fake` for sample trigger data, or `--user` / `--email` to preview with a real user.
304
+
261
305
  ## Auth Model
262
306
 
263
307
  - Login happens in the browser on `https://g-skills.fr`
@@ -769,8 +813,8 @@ Prefer the narrowest scope:
769
813
  ## Safety
770
814
 
771
815
  - Prefer `list` and `get` before writes
772
- - Use `--dry-run` before create, update, soft-delete, and sync
773
- - Use `--force --confirm-delete <resource>:<id>` only for soft-deletes the user explicitly requested
816
+ - Use `--dry-run` before create, update, delete, and sync
817
+ - Use `--force --confirm-delete <resource>:<id>` only for archive/delete flows the user explicitly requested
774
818
  - Use `sync diff` before `sync run --yes`
775
819
  - Use cache `--dry-run` before cache `--yes`
776
820
  - Re-read changed rows after writes