@numericoach/gskills-admin-cli 0.1.25 → 0.1.27

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/README.md CHANGED
@@ -48,8 +48,46 @@ gskills-admin pages help --output json
48
48
  gskills-admin topics help --output json
49
49
  ```
50
50
 
51
+ Generic `create` and `update` require `--dry-run` or `--yes`. Use `--data-file` for large JSON payloads instead of shell-escaped blobs:
52
+
53
+ ```bash
54
+ gskills-admin pages create --data-file ./page.json --dry-run --output json
55
+ gskills-admin pages update <pageId> --data-file ./page-fields.json --yes --output json
56
+ ```
57
+
51
58
  Use the listed `cache.scopes` with `gskills-admin cache invalidate` after create, update, or soft-delete when the end-user view must reflect the change immediately.
52
59
 
60
+ For page body edits, prefer the granular block helpers when a stable block id exists. Dry-run first, then write:
61
+
62
+ ```bash
63
+ gskills-admin pages content-schema --output json
64
+ gskills-admin pages get <pageId> --fields id,name,language,currentVersion,updatedAt,content --output json
65
+ gskills-admin pages block list <pageId> --output json
66
+ gskills-admin pages block replace-text <pageId> --block-id <blockId> --text-file ./block.txt --dry-run --output json
67
+ gskills-admin pages block insert-before <pageId> --block-id <anchorBlockId> --block-file ./block.json --dry-run --output json
68
+ gskills-admin pages block replace-text <pageId> --block-id <blockId> --text-file ./block.txt --reason "Fix wording" --yes --output json
69
+ ```
70
+
71
+ Use raw RFC 6902 JSON Patch when the edit needs multiple JSON paths:
72
+
73
+ ```bash
74
+ gskills-admin pages patch-content <pageId> --patch-file ./page.patch.json --dry-run --output json
75
+ gskills-admin pages patch-content <pageId> --patch-file ./page.patch.json --expect-version 7 --expect-content-sha1 <sha1> --reason "Fix wording" --yes --output json
76
+ ```
77
+
78
+ Patch files are JSON Patch arrays:
79
+
80
+ ```json
81
+ [
82
+ { "op": "test", "path": "/blocks/0/type", "value": "paragraph" },
83
+ { "op": "replace", "path": "/blocks/0/data/text", "value": "Updated paragraph text" }
84
+ ]
85
+ ```
86
+
87
+ Block helpers read the full page content, find nested blocks by id, generate guarded JSON Patch, validate the predicted full content against `pages content-schema`, call `pages patch-content`, then reread and validate the page after real writes. The patch route previews block/text deltas, stores page history, refreshes the page vector, invalidates `pages` and `pages-knowledge`, logs the write, and rejects stale `updatedAt`, version, or content SHA guards. Keep full-content `pages update --data '{"content": ...}'` for expert migrations only.
88
+
89
+ `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.
90
+
53
91
  Large local videos can be uploaded directly to GSkills storage before creating or updating internal knowledge and resources. The CLI asks the app for a signed upload URL, streams the local file directly to GCS, then writes the normal row with the returned URL. Use `--instance` for client-specific content.
54
92
 
55
93
  ```bash
@@ -127,6 +165,10 @@ gskills-admin access diagnose --email user@example.com --instance <instanceId> -
127
165
  gskills-admin access grant --user <userId> --type DEFAULT --dry-run --output json
128
166
  gskills-admin internal-knowledge sync-media --source global --since today --languages fr --all-targets --dry-run --output json
129
167
  gskills-admin pages backfill-field --field headerColor --all-targets --dry-run --output json
168
+ gskills-admin pages content-schema --output json
169
+ gskills-admin pages block replace-text <pageId> --block-id <blockId> --text-file ./block.txt --dry-run --output json
170
+ gskills-admin pages block insert-before <pageId> --block-id <anchorBlockId> --block-file ./block.json --dry-run --output json
171
+ gskills-admin pages patch-content <pageId> --patch-file ./page.patch.json --dry-run --output json
130
172
  gskills-admin progress learning-path-quiz-mismatches --instance <instanceId> --output json
131
173
  gskills-admin progress repair-learning-path-quiz-mismatches --instance <instanceId> --dry-run --output json
132
174
  gskills-admin progress embedded-course --user <userId> --quiz <quizId> --page <pageId> --dry-run --output json
@@ -152,7 +194,9 @@ The direct-DB replacement commands cover the recurring historical gaps: email-to
152
194
 
153
195
  Agents can combine the CLI with local code. Use CLI JSON output inside shell loops, `jq`, Bun, Node, or TypeScript helpers for batching, joins, comparisons, retries, and reports. If a small local tool is missing, install or invoke it when useful. Keep production access through the authenticated CLI, not direct DB URLs.
154
196
 
155
- Raw project and analytics data can be read or adjusted through resources such as `project-data`, `ticket-sla-rules`, `learning-path-items`, `learning-path-groups`, `quiz-questions`, `quiz-options`, `analytics`, `quiz-attempts`, `user-paths`, `chromebook-progress`, `user-badges`, `user-learning-paths`, and `user-learning-path-item-completions`.
197
+ Raw project, skill, workflow, and analytics data can be read or adjusted through resources such as `project-data`, `ticket-sla-rules`, `learning-path-items`, `learning-path-groups`, `quiz-questions`, `quiz-options`, `workflow-actions`, `skill-applications`, `skill-capabilities`, `skill-clusters`, `skills`, `skill-content-links`, `skill-sets`, `analytics`, `quiz-attempts`, `user-paths`, `chromebook-progress`, `user-badges`, `user-learning-paths`, and `user-learning-path-item-completions`.
198
+
199
+ `gskills-admin skills install`, `skills path`, and `skills help` are for bundled Codex skills. `skills list`, `skills get`, `skills create`, `skills update`, and `skills delete` operate on the app skill catalog. Use `skill-content-links` when associating pages, quizzes, parcours items, knowledge, or resources to skills.
156
200
 
157
201
  ## Agent skill
158
202
 
@@ -165,6 +209,8 @@ gskills-admin skills install --name gskills-customer-playbooks --target ~/.codex
165
209
  gskills-admin skills install --name gskills-feedback-db-ops --target ~/.codex/skills
166
210
  gskills-admin skills install --name gskills-source-id-repair --target ~/.codex/skills
167
211
  gskills-admin skills install --name gskills-user-session-invalidation --target ~/.codex/skills
212
+ gskills-admin skills install --name gskills-admin-cli-publishing --target ~/.codex/skills
213
+ gskills-admin skills install --name gskills-page-content-blocks --target ~/.codex/skills
168
214
  ```
169
215
 
170
216
  ## Output