@numericoach/gskills-admin-cli
v0.1.31
Published
Admin-only CLI for GSkills super-admin operations.
Readme
GSkills Admin CLI
Admin-only package for GSkills super-admin operations.
Super admin CLI for GSkills operations through authenticated app API routes.
The CLI opens GSkills in the browser, uses the normal GSkills login, then stores an opaque CLI token locally. Every API request re-checks User.adminState = SUPER_ADMIN in GSkills before touching data.
Local usage
bun run gskills-admin auth login --base-url https://g-skills.fr
bun run gskills-admin auth whoami
bun run gskills-admin schema --output json
bun run gskills-admin pages list
bun run gskills-admin sync run --target <instanceId> --only pages,quizzes --yesContent-like resources default to instanceId = "global" when --instance is omitted. On global, create defaults to disabled: true for resources that support it unless the payload explicitly says otherwise.
Delete commands are soft-only. They archive rows when the resource supports archived, fall back only when that field does not exist, and refuse resources that cannot be safely hidden.
CLI writes are logged in the GSkills admin logs with the authenticated user and CLI metadata.
Sync dry-runs use the shared GSkills diff preview system:
gskills-admin sync presets --output json
gskills-admin sync logs --target <instanceId> --take 10 --output json
gskills-admin sync diff --target <instanceId> --only pages,menus --pages <pageId,pageId> --languages fr,en --output json
gskills-admin sync diff --target <instanceId> --preset client-content --output json
gskills-admin sync repair-source-links --target <instanceId> --dry-run --output json
gskills-admin sync run --targets <instanceId,instanceId> --only pages,quizzes --dry-run --output jsonLanguage-limited menu sync writes are blocked from the CLI. Run the diff first, sync the language-limited content without menus, or sync menus without --languages after the backend non-destructive sync patch is deployed.
Deploy cache can be invalidated at the same scopes as the super-admin content settings screen:
gskills-admin cache scopes --output json
gskills-admin cache invalidate --instance <instanceId> --scope pages --languages fr,en --dry-run --output json
gskills-admin cache invalidate --instance <instanceId> --scope menu-bundle --yes --output jsonCRUD help includes cache hints for resources that can leave deploy views stale after a raw write:
gskills-admin pages help --output json
gskills-admin topics help --output jsonGeneric create and update require --dry-run or --yes. Use --data-file for large JSON payloads instead of shell-escaped blobs:
gskills-admin pages create --data-file ./page.json --dry-run --output json
gskills-admin pages update <pageId> --data-file ./page-fields.json --yes --output jsonUse the listed cache.scopes with gskills-admin cache invalidate after create, update, or delete when the end-user view must reflect the change immediately. Delete flows should archive content first; after a real delete, re-read the row and verify archived: true when the resource supports it.
Workflow authoring has a guided CLI surface. Use it before raw workflows and workflow-actions CRUD:
gskills-admin workflows schema --output json
gskills-admin workflows schema --trigger LEARNING_PATH_NOT_STARTED --output json
gskills-admin workflows example --trigger LEARNING_PATH_NOT_STARTED --output json
gskills-admin workflows preview-email --data-file ./workflow.json --fake --language fr --output json
gskills-admin workflows preview-email --data-file ./workflow.json --user [email protected] --language fr --output json
gskills-admin workflows create-configured --instance global --data-file ./workflow.json --inactive --dry-run --output json
gskills-admin workflows create-configured --instance global --data-file ./workflow.json --active --yes --output jsonworkflows schema lists every supported trigger and action, the trigger config schema, trigger payload schema, email variables, button placeholders and examples. create-configured creates the workflow and all actions in one operation. It requires an activation decision. Ask whether to enable the workflow now, then pass --active or --inactive. Prefer --inactive until the preview email, target ids, recipients and translations are approved.
Email actions use config.templates, a map of language code to { subject, body }. Keep variables such as {{userName}}, {{userEmail}}, {{instanceName}} and trigger-specific 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.
For page body edits, prefer the granular block helpers when a stable block id exists. Dry-run first, then write:
gskills-admin pages content-schema --output json
gskills-admin pages get <pageId> --fields id,name,language,currentVersion,updatedAt,content --output json
gskills-admin pages block list <pageId> --output json
gskills-admin pages block replace-text <pageId> --block-id <blockId> --text-file ./block.txt --dry-run --output json
gskills-admin pages block insert-before <pageId> --block-id <anchorBlockId> --block-file ./block.json --dry-run --output json
gskills-admin pages block replace-text <pageId> --block-id <blockId> --text-file ./block.txt --reason "Fix wording" --yes --output jsonUse raw RFC 6902 JSON Patch when the edit needs multiple JSON paths:
gskills-admin pages patch-content <pageId> --patch-file ./page.patch.json --dry-run --output json
gskills-admin pages patch-content <pageId> --patch-file ./page.patch.json --expect-version 7 --expect-content-sha1 <sha1> --reason "Fix wording" --yes --output jsonPatch files are JSON Patch arrays:
[
{ "op": "test", "path": "/blocks/0/type", "value": "paragraph" },
{ "op": "replace", "path": "/blocks/0/data/text", "value": "Updated paragraph text" }
]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.
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.
Content governance and page comments use the same data and write paths as the super-admin governance UI:
gskills-admin governance list --instance global --output json
gskills-admin governance get <entryId> --instance global --output json
gskills-admin governance comments-board --instance global --mine --output json
gskills-admin governance open-comment-count --instance global --output json
gskills-admin governance search --instance global --query Gmail --output json
gskills-admin governance create-task --entity-type page --entity-id <pageId> --status CHANGES_REQUESTED --task-title "Relire la page" --dry-run --output json
gskills-admin governance upsert --entity-type page --entity-id <pageId> --status TO_REVIEW --dry-run --output json
gskills-admin governance update-task <entryId> --task-description-file ./details.md --dry-run --output json
gskills-admin governance set-assignees <entryId> --user-ids <userId,userId> --dry-run --output json
gskills-admin governance set-instance <entryId> --target-instance <instanceId> --dry-run --output json
gskills-admin governance comments add <entryId> --content-file ./comment.md --dry-run --output json
gskills-admin page-comments list <pageId> --output json
gskills-admin page-comments add <pageId> --content-file ./comment.md --block-id <blockId> --create-task --dry-run --output json
gskills-admin page-comments reply <parentCommentId> --content-file ./reply.md --dry-run --output json
gskills-admin page-comments resolve <commentId> --dry-run --output jsonGovernance and page-comment writes require --dry-run or --yes. Task deletion also requires --force --confirm-delete governance:<entryId>.
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.
gskills-admin internal-knowledge create --instance dev-numericoach --upload-file ./capsule.mp4 --data '{"title":"Capsule test","language":"fr","isActive":true,"isAIAllowed":false}' --dry-run --output json
gskills-admin internal-knowledge create --instance dev-numericoach --upload-file ./capsule.mp4 --data '{"title":"Capsule test","language":"fr","isActive":true,"isAIAllowed":false}' --output json
gskills-admin resources create --instance dev-numericoach --upload-file ./webinar.mp4 --data '{"title":"Webinar test","type":"WEBINAR","language":"fr","isActive":true}' --dry-run --output json
gskills-admin resources update <resourceId> --upload-file ./webinar-v2.mp4 --data '{}' --output jsonUse --mime-type when the extension is ambiguous, and --upload-name when the stored file name needs a cleaner label.
Learning path icons can use the same three sources as the super-admin editor:
gskills-admin learning-paths icons --query Gmail --output json
gskills-admin learning-paths set-icon <learningPathId> --app Gmail --dry-run --output json
gskills-admin learning-paths set-icon <learningPathId> --upload-file ./icon.png --instance <instanceId> --dry-run --output json
gskills-admin learning-paths generate-icon <learningPathId> --prompt "flat central handshake, transparent background" --dry-run --output json
gskills-admin learning-paths generate-icon <learningPathId> --prompt-file ./icon-prompt.txt --yes --output jsonicons reads only French global category app icons. set-icon --upload-file streams the local image to storage with a signed URL and writes LearningPath.iconUrl. generate-icon calls the same server-side image generator used by the editor, then stores the generated URL on the learning path.
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.
AI translation is available for content that has native AI translation in the editor:
Warning: translate pages rewrites each translated page from the source page. It is not a diff update. Recreating translated pages this way can lose activity-specific fields, quiz ids, embedded ids, or future custom block data if the translator does not preserve them. Prefer the app diff update flow for pages with activities or custom blocks.
For pages with activities or custom blocks, prefer --mode patch. It uses the source page history to update changed text while preserving non-text target block data:
gskills-admin translate pages <pageId> --to en,es --dry-run --output json
gskills-admin translate pages <pageId> --from fr --to en,es --mode patch --dry-run --output json
gskills-admin translate pages --ids <pageId,pageId> --from fr --to en --dry-run --output json
gskills-admin translate pages --all --instance global --from fr --to en --take 100 --dry-run --output json
gskills-admin translate quizzes <quizId> --to en --yes --output json
gskills-admin translate knowledge-video <knowledgeId> --from en --to es --yes --output json
gskills-admin translate changelogs <changelogId> --to all --concurrency 8 --dry-run --output jsonSupported kinds are pages, quizzes, topics, badges, menus, menu-sections, internal-knowledge, knowledge-video, learning-paths, chromebook-exercises, and changelogs.
Use --to all to expand to every supported locale. Changelog translation supports --concurrency 1-20 for faster backfills.
Changelog CRUD is available through changelogs and changelog-groups:
gskills-admin changelog-groups create --data '{"name":"...","releaseDate":"2026-06-08T10:00:00.000Z"}' --dry-run --output json
gskills-admin changelogs create --data-file ./changelog-entry.json --dry-run --output json
gskills-admin changelogs update <changelogId> --data '{"status":"PUBLISHED"}' --yes --output jsonImported Google Sheets have their own command family:
gskills-admin imported-sheets list --instance <instanceId> --output json
gskills-admin imported-sheets resolve --instance <instanceId> --source <sheet-url> --output json
gskills-admin imported-sheets create --instance <instanceId> --source <sheet-url> --tab "Cas d'usage" --display-name "Cas d'usage Gemini" --locales fr,en,es --enable-vectorization --vector-headers "Titre,Description,Prompt" --dry-run --output json
gskills-admin imported-sheets sync <sheetId> --instance <instanceId> --dry-run --output json
gskills-admin imported-sheets translate <sheetId> --instance <instanceId> --to en,es --dry-run --output json
gskills-admin imported-sheets retranslate <sheetId> --instance <instanceId> --from en --to fr,de,es --dry-run --output json
gskills-admin imported-sheets replace-grid <sheetId> --instance <instanceId> --locale en --data-file ./grid.json --rebuild-columns --dry-run --output json
gskills-admin imported-sheets patch-cells <sheetId> --instance <instanceId> --data-file ./cell-patches.json --dry-run --output json
gskills-admin imported-sheets vectorize <sheetId> --instance <instanceId> --locales fr,en --dry-run --output json
gskills-admin imported-sheets repair-french <sheetId> --instance <instanceId> --locales es,it --revectorize --dry-run --output json
gskills-admin imported-sheets copy-to <sheetId> --instance global --target <instanceId> --display-name "Use cases" --dry-run --output json
gskills-admin imported-sheets attach-page <sheetId> --instance <instanceId> --page <pageId> --locale fr --dry-run --output json
gskills-admin imported-sheets set-source <sheetId> --instance <instanceId> --locale en --source <sheet-url> --tab EN --resync --dry-run --output jsonUse sync to resync the stored rows from Google Sheets and refresh AI-translated variants. Use translate to enable or refresh explicit AI locales. Use patch-cells for focused row-cell updates such as capture links without replacing the whole grid. Use vectorize after enabling vectorization or changing vector columns. Use copy-to --display-name "Use cases" for the Gemini use-case list flow, then attach-page when the list must be embedded in a normal page. Use set-source --resync to swap a locale to another spreadsheet tab and refresh it in one CLI call. All writes require --dry-run or --yes.
patch-cells accepts a JSON object with a patches array:
{
"patches": [
{
"locale": "fr",
"rowIndex": 12,
"columnHeader": "Capture_link",
"rawValue": "https://lh7-qw.googleusercontent.com/docsz/..."
}
]
}Each patch uses locale, rowId or rowIndex, columnId or columnHeader, and rawValue. Dry-runs resolve the real row and column and show before/after samples. Applied patches write through the authenticated app API, log an admin event, and invalidate deploy cache unless --no-cache is passed.
Operational helpers are available for the admin-only flows agents should not improvise:
gskills-admin feedback inspect <feedbackId> --output json
gskills-admin feedback translation-status <feedbackId> --output json
gskills-admin feedback import-email --data-file ./feedback-email.json --dry-run --output json
gskills-admin feedback send-reply <feedbackId> --subject "GSkills - ..." --body-file ./reply.txt --dry-run --output json
gskills-admin access diagnose --email [email protected] --instance <instanceId> --output json
gskills-admin access grant --user <userId> --type DEFAULT --dry-run --output json
gskills-admin internal-knowledge sync-media --source global --since today --languages fr --all-targets --dry-run --output json
gskills-admin pages backfill-field --field headerColor --all-targets --dry-run --output json
gskills-admin pages content-schema --output json
gskills-admin pages block replace-text <pageId> --block-id <blockId> --text-file ./block.txt --dry-run --output json
gskills-admin pages block insert-before <pageId> --block-id <anchorBlockId> --block-file ./block.json --dry-run --output json
gskills-admin pages patch-content <pageId> --patch-file ./page.patch.json --dry-run --output json
gskills-admin progress learning-path-quiz-mismatches --instance <instanceId> --output json
gskills-admin progress repair-learning-path-quiz-mismatches --instance <instanceId> --dry-run --output json
gskills-admin progress embedded-course --user <userId> --quiz <quizId> --page <pageId> --dry-run --output json
gskills-admin sessions invalidate --email [email protected] --dry-run --output json
gskills-admin content-assistant lookup --query "artifact title" --output json
gskills-admin admin-ingest repair-state --instance <instanceId> --output json
gskills-admin admin-ingest repair --instance <instanceId> --dry-run --output json
gskills-admin instances create-plan --output json
gskills-admin instances create --data '{"name":"Client","URL":"client","licenceType":"STARTER","tokensAllowed":50}' --dry-run --output json
gskills-admin entities list --instance <instanceId> --output json
gskills-admin entities sync-google-groups --instance <instanceId> --dry-run --output json
gskills-admin entities sync-google-groups --instance <instanceId> --yes --output json
gskills-admin entities set-page-visibility --instance <instanceId> --page <pageId> --entity-ids google-group:[email protected] --dry-run --output json
gskills-admin org-units-sync google --instance <instanceId> --yes --output json
gskills-admin ambassadors label --instance <instanceId> --language fr --output jsonFeedback reply bodies are file-based on purpose. Production replies are multi-line, and send-reply rejects inline body text to avoid shell parsing surprises.
internal-knowledge sync-media changes only selected media fields on existing target copies matched by sourceKnowledgeId. The default field is url, and it invalidates pages-knowledge cache for touched instances.
The direct-DB replacement commands cover the recurring historical gaps: email-to-feedback import, quiz/course progress repair, source-link repair, page metadata backfill, content-assistant artifact lookup, and JWT session invalidation. Reads stay read-only. Writes require --dry-run or --yes and log through the app API.
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.
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.
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.
Agent skill
Install the bundled skills so AI agents know the auth model, resource map, output modes, sync workflow, content-authoring standards, recurring DB-backed ops runbooks, GSkills vocabulary, and recurring customer playbooks.
gskills-admin skills install --target ~/.codex/skills
gskills-admin skills install --name gskills-vocabulary --target ~/.codex/skills
gskills-admin skills install --name gskills-customer-playbooks --target ~/.codex/skills
gskills-admin skills install --name gskills-feedback-db-ops --target ~/.codex/skills
gskills-admin skills install --name gskills-source-id-repair --target ~/.codex/skills
gskills-admin skills install --name gskills-user-session-invalidation --target ~/.codex/skills
gskills-admin skills install --name gskills-admin-cli-publishing --target ~/.codex/skills
gskills-admin skills install --name gskills-page-content-blocks --target ~/.codex/skillsOutput
Use --output json, --output jsonl, --output table, or --output markdown.
Piped output defaults to JSON so agents and scripts can consume it safely.
