@numericoach/gskills-admin-cli 0.1.21 → 0.1.23

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
@@ -68,6 +68,25 @@ gskills-admin translate knowledge-video <knowledgeId> --from en --to es --yes --
68
68
  Supported kinds are `pages`, `quizzes`, `topics`, `badges`, `menus`, `menu-sections`, `internal-knowledge`, `knowledge-video`, `learning-paths`, and `chromebook-exercises`.
69
69
  Target languages must be explicit. `--to all` is rejected.
70
70
 
71
+ Imported Google Sheets have their own command family:
72
+
73
+ ```bash
74
+ gskills-admin imported-sheets list --instance <instanceId> --output json
75
+ gskills-admin imported-sheets resolve --instance <instanceId> --source <sheet-url> --output json
76
+ 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
77
+ gskills-admin imported-sheets sync <sheetId> --instance <instanceId> --dry-run --output json
78
+ gskills-admin imported-sheets translate <sheetId> --instance <instanceId> --to en,es --dry-run --output json
79
+ gskills-admin imported-sheets retranslate <sheetId> --instance <instanceId> --from en --to fr,de,es --dry-run --output json
80
+ gskills-admin imported-sheets replace-grid <sheetId> --instance <instanceId> --locale en --data-file ./grid.json --rebuild-columns --dry-run --output json
81
+ gskills-admin imported-sheets vectorize <sheetId> --instance <instanceId> --locales fr,en --dry-run --output json
82
+ gskills-admin imported-sheets repair-french <sheetId> --instance <instanceId> --locales es,it --revectorize --dry-run --output json
83
+ gskills-admin imported-sheets copy-to <sheetId> --instance global --target <instanceId> --display-name "Use cases" --dry-run --output json
84
+ gskills-admin imported-sheets attach-page <sheetId> --instance <instanceId> --page <pageId> --locale fr --dry-run --output json
85
+ gskills-admin imported-sheets set-source <sheetId> --instance <instanceId> --locale en --source <sheet-url> --tab EN --resync --dry-run --output json
86
+ ```
87
+
88
+ Use `sync` to resync the stored rows from Google Sheets and refresh AI-translated variants. Use `translate` to enable or refresh explicit AI locales. 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`.
89
+
71
90
  Operational helpers are available for the admin-only flows agents should not improvise:
72
91
 
73
92
  ```bash
@@ -611,6 +611,57 @@ var resources = [
611
611
  dangerousDelete: true,
612
612
  cacheScopes: ["pages", "pages-knowledge"]
613
613
  },
614
+ {
615
+ name: "imported-sheets",
616
+ delegate: "importedSheet",
617
+ label: "Imported sheets",
618
+ aliases: ["imported-sheet", "sheets-imported", "google-sheets-imports"],
619
+ defaultFields: ["id", "displayName", "spreadsheetTitle", "selectedTabName", "instanceId", "status", "multilangMode", "defaultLocale", "enabledLocales", "enableVectorization", "lastSyncedAt", "updatedAt"],
620
+ dangerousDelete: true,
621
+ cacheScopes: ["pages-knowledge"]
622
+ },
623
+ {
624
+ name: "imported-sheet-columns",
625
+ delegate: "importedSheetColumn",
626
+ label: "Imported sheet columns",
627
+ aliases: ["imported-sheet-column", "sheet-columns"],
628
+ defaultFields: ["id", "importedSheetId", "position", "displayOrder", "headerName", "inferredType", "isVisible", "isFilterable", "includeInVectorization", "displayType", "showLabel", "updatedAt"],
629
+ instanceField: null,
630
+ cacheScopes: ["pages-knowledge"]
631
+ },
632
+ {
633
+ name: "imported-sheet-variants",
634
+ delegate: "importedSheetVariant",
635
+ label: "Imported sheet variants",
636
+ aliases: ["imported-sheet-variant", "sheet-variants"],
637
+ defaultFields: ["id", "importedSheetId", "locale", "isDefault", "status", "googleSpreadsheetId", "selectedTabName", "lastSyncedAt", "updatedAt"],
638
+ instanceField: null,
639
+ cacheScopes: ["pages-knowledge"]
640
+ },
641
+ {
642
+ name: "imported-sheet-rows",
643
+ delegate: "importedSheetRow",
644
+ label: "Imported sheet rows",
645
+ aliases: ["imported-sheet-row", "sheet-rows"],
646
+ defaultFields: ["id", "variantId", "rowIndex", "updatedAt"],
647
+ instanceField: null
648
+ },
649
+ {
650
+ name: "imported-sheet-cells",
651
+ delegate: "importedSheetCell",
652
+ label: "Imported sheet cells",
653
+ aliases: ["imported-sheet-cell", "sheet-cells"],
654
+ defaultFields: ["id", "rowId", "columnId", "rawValue", "normalizedValue", "updatedAt"],
655
+ instanceField: null
656
+ },
657
+ {
658
+ name: "imported-sheet-sync-runs",
659
+ delegate: "importedSheetSyncRun",
660
+ label: "Imported sheet sync runs",
661
+ aliases: ["imported-sheet-sync-run", "sheet-sync-runs"],
662
+ defaultFields: ["id", "importedSheetId", "variantId", "locale", "status", "rowsImported", "errorMessage", "startedAt", "finishedAt"],
663
+ instanceField: null
664
+ },
614
665
  {
615
666
  name: "feature-flags",
616
667
  delegate: "featureFlagAssignment",
@@ -778,6 +829,8 @@ var runCommand = async (ctx) => {
778
829
  return runCacheCommand(actionOrResource, ctx);
779
830
  if (group === "translate")
780
831
  return runTranslateCommand(actionOrResource, maybeAction, ctx);
832
+ if (group === "imported-sheets" || group === "imported-sheet")
833
+ return runImportedSheetsCommand(actionOrResource, maybeAction, ctx);
781
834
  if (group === "feedback")
782
835
  return runFeedbackCommand(actionOrResource, maybeAction, ctx);
783
836
  if (group === "progress")
@@ -1540,6 +1593,287 @@ var runTranslateCommand = async (kind, id, ctx) => {
1540
1593
  });
1541
1594
  return addTranslatePagesWarning(kind, mode, result);
1542
1595
  };
1596
+ var runImportedSheetsCommand = async (action, importedSheetId, ctx) => {
1597
+ if (!action || action === "help")
1598
+ return importedSheetsHelp();
1599
+ const instanceId = getStringFlag(ctx, "instance");
1600
+ const needsInstance = [
1601
+ "list",
1602
+ "get",
1603
+ "locales",
1604
+ "resolve",
1605
+ "create",
1606
+ "update",
1607
+ "sync",
1608
+ "enable-locales",
1609
+ "translate",
1610
+ "retranslate",
1611
+ "replace-grid",
1612
+ "vectorize",
1613
+ "repair-french",
1614
+ "copy-to",
1615
+ "attach-page",
1616
+ "set-source",
1617
+ "delete",
1618
+ "runs"
1619
+ ].includes(action);
1620
+ if (needsInstance && !instanceId)
1621
+ throw new CliError("Missing --instance", 2);
1622
+ if (action === "list") {
1623
+ return requestApi(`/api/cli/imported-sheets?instanceId=${encodeURIComponent(instanceId)}`);
1624
+ }
1625
+ if (action === "get") {
1626
+ if (!importedSheetId)
1627
+ throw new CliError("Missing imported sheet id", 2);
1628
+ const searchParams = importedSheetSearchParams(ctx);
1629
+ return requestApi(`/api/cli/imported-sheets/${importedSheetId}?${searchParams.toString()}`);
1630
+ }
1631
+ if (action === "locales") {
1632
+ if (!importedSheetId)
1633
+ throw new CliError("Missing imported sheet id", 2);
1634
+ return requestApi(`/api/cli/imported-sheets/${importedSheetId}/locales?instanceId=${encodeURIComponent(instanceId)}`);
1635
+ }
1636
+ if (action === "copy-to") {
1637
+ requireWriteConfirmation("Imported sheet operation writes production data. Add --yes or use --dry-run.", ctx);
1638
+ if (!importedSheetId)
1639
+ throw new CliError("Missing imported sheet id", 2);
1640
+ const targetInstanceIds = getTargetInstanceIds(ctx);
1641
+ if (targetInstanceIds.length === 0)
1642
+ throw new CliError("Missing --target or --targets", 2);
1643
+ const payload = {
1644
+ sourceInstanceId: instanceId,
1645
+ targetInstanceIds,
1646
+ displayName: getStringFlag(ctx, "display-name"),
1647
+ replace: hasFlag(ctx, "replace"),
1648
+ revectorize: hasFlag(ctx, "revectorize"),
1649
+ dryRun: hasFlag(ctx, "dry-run")
1650
+ };
1651
+ if (hasFlag(ctx, "dry-run"))
1652
+ return { operation: "imported-sheets.copy-to", importedSheetId, ...payload };
1653
+ return requestApi(`/api/cli/imported-sheets/${importedSheetId}/copy-to`, {
1654
+ method: "POST",
1655
+ body: JSON.stringify(payload)
1656
+ });
1657
+ }
1658
+ if (action === "attach-page") {
1659
+ requireWriteConfirmation("Imported sheet operation writes production data. Add --yes or use --dry-run.", ctx);
1660
+ if (!importedSheetId)
1661
+ throw new CliError("Missing imported sheet id", 2);
1662
+ const pageId = getStringFlag(ctx, "page");
1663
+ if (!pageId)
1664
+ throw new CliError("Missing --page", 2);
1665
+ const payload = {
1666
+ instanceId,
1667
+ pageId,
1668
+ locale: getStringFlag(ctx, "locale") ?? getStringFlag(ctx, "language") ?? "fr",
1669
+ position: getStringFlag(ctx, "position") ?? "end",
1670
+ replaceExisting: hasFlag(ctx, "replace-existing"),
1671
+ dryRun: hasFlag(ctx, "dry-run")
1672
+ };
1673
+ if (hasFlag(ctx, "dry-run"))
1674
+ return { operation: "imported-sheets.attach-page", importedSheetId, ...payload };
1675
+ return requestApi(`/api/cli/imported-sheets/${importedSheetId}/attach-page`, {
1676
+ method: "POST",
1677
+ body: JSON.stringify(payload)
1678
+ });
1679
+ }
1680
+ if (action === "set-source") {
1681
+ requireWriteConfirmation("Imported sheet operation writes production data. Add --yes or use --dry-run.", ctx);
1682
+ if (!importedSheetId)
1683
+ throw new CliError("Missing imported sheet id", 2);
1684
+ const locale = getStringFlag(ctx, "locale") ?? getStringFlag(ctx, "language");
1685
+ const sourceInput = getStringFlag(ctx, "source");
1686
+ const tabName = getStringFlag(ctx, "tab");
1687
+ if (!locale)
1688
+ throw new CliError("Missing --locale", 2);
1689
+ if (!sourceInput)
1690
+ throw new CliError("Missing --source", 2);
1691
+ if (!tabName)
1692
+ throw new CliError("Missing --tab", 2);
1693
+ const payload = {
1694
+ instanceId,
1695
+ locale,
1696
+ sourceInput,
1697
+ tabName,
1698
+ resync: hasFlag(ctx, "resync"),
1699
+ dryRun: hasFlag(ctx, "dry-run")
1700
+ };
1701
+ if (hasFlag(ctx, "dry-run"))
1702
+ return { operation: "imported-sheets.set-source", importedSheetId, ...payload };
1703
+ return requestApi(`/api/cli/imported-sheets/${importedSheetId}/source`, {
1704
+ method: "POST",
1705
+ body: JSON.stringify(payload)
1706
+ });
1707
+ }
1708
+ if (action === "runs") {
1709
+ const searchParams = importedSheetSearchParams(ctx);
1710
+ searchParams.set("take", String(getNumberFlag(ctx, "take") ?? 10));
1711
+ return requestApi(`/api/cli/imported-sheets/${importedSheetId ?? "all"}/runs?${searchParams.toString()}`);
1712
+ }
1713
+ if (action === "resolve") {
1714
+ const sourceInput = getStringFlag(ctx, "source");
1715
+ if (!sourceInput)
1716
+ throw new CliError("Missing --source", 2);
1717
+ return requestApi("/api/cli/imported-sheets/resolve", {
1718
+ method: "POST",
1719
+ body: JSON.stringify({ instanceId, sourceInput })
1720
+ });
1721
+ }
1722
+ if (["create", "update", "sync", "enable-locales", "translate", "retranslate", "replace-grid", "vectorize", "repair-french", "delete"].includes(action)) {
1723
+ requireWriteConfirmation("Imported sheet operation writes production data. Add --yes or use --dry-run.", ctx);
1724
+ }
1725
+ if (action === "create") {
1726
+ const payload = await importedSheetCreatePayload(ctx);
1727
+ if (hasFlag(ctx, "dry-run"))
1728
+ return { dryRun: true, operation: "imported-sheets.create", payload };
1729
+ return requestApi("/api/cli/imported-sheets", {
1730
+ method: "POST",
1731
+ body: JSON.stringify(payload)
1732
+ });
1733
+ }
1734
+ if (!importedSheetId)
1735
+ throw new CliError("Missing imported sheet id", 2);
1736
+ if (action === "update") {
1737
+ const payload = {
1738
+ instanceId,
1739
+ data: await parseJsonObjectFlag(ctx, "data", "data-file"),
1740
+ dryRun: hasFlag(ctx, "dry-run")
1741
+ };
1742
+ if (Object.keys(payload.data).length === 0)
1743
+ throw new CliError("Missing --data or --data-file JSON", 2);
1744
+ if (hasFlag(ctx, "dry-run"))
1745
+ return { operation: "imported-sheets.update", importedSheetId, ...payload };
1746
+ return requestApi(`/api/cli/imported-sheets/${importedSheetId}`, {
1747
+ method: "PATCH",
1748
+ body: JSON.stringify(payload)
1749
+ });
1750
+ }
1751
+ if (action === "sync") {
1752
+ const payload = {
1753
+ instanceId,
1754
+ locales: splitCsv(getStringFlag(ctx, "locales") ?? getStringFlag(ctx, "languages")),
1755
+ dryRun: hasFlag(ctx, "dry-run")
1756
+ };
1757
+ if (hasFlag(ctx, "dry-run"))
1758
+ return { operation: "imported-sheets.sync", importedSheetId, ...payload };
1759
+ return requestApi(`/api/cli/imported-sheets/${importedSheetId}/sync`, {
1760
+ method: "POST",
1761
+ body: JSON.stringify(payload)
1762
+ });
1763
+ }
1764
+ if (action === "enable-locales" || action === "translate") {
1765
+ const locales = splitCsv(getStringFlag(ctx, "locales") ?? getStringFlag(ctx, "languages") ?? getStringFlag(ctx, "to"));
1766
+ if (locales.length === 0)
1767
+ throw new CliError(`Missing ${action === "translate" ? "--to" : "--locales"}`, 2);
1768
+ if (locales.some((locale) => locale.toLowerCase() === "all")) {
1769
+ throw new CliError("Do not use all. Pass explicit locales like en,es,pt-BR.", 2);
1770
+ }
1771
+ const payload = {
1772
+ instanceId,
1773
+ locales,
1774
+ dryRun: hasFlag(ctx, "dry-run")
1775
+ };
1776
+ if (hasFlag(ctx, "dry-run"))
1777
+ return { operation: `imported-sheets.${action}`, importedSheetId, ...payload };
1778
+ return requestApi(`/api/cli/imported-sheets/${importedSheetId}/translate`, {
1779
+ method: "POST",
1780
+ body: JSON.stringify(payload)
1781
+ });
1782
+ }
1783
+ if (action === "retranslate") {
1784
+ const locales = splitCsv(getStringFlag(ctx, "locales") ?? getStringFlag(ctx, "languages") ?? getStringFlag(ctx, "to"));
1785
+ if (locales.length === 0)
1786
+ throw new CliError("Missing --to", 2);
1787
+ if (locales.some((locale) => locale.toLowerCase() === "all")) {
1788
+ throw new CliError("Do not use all. Pass explicit locales like en,es,pt-BR.", 2);
1789
+ }
1790
+ const payload = {
1791
+ instanceId,
1792
+ locales,
1793
+ sourceLocale: getStringFlag(ctx, "from"),
1794
+ revectorize: hasFlag(ctx, "revectorize"),
1795
+ dryRun: hasFlag(ctx, "dry-run")
1796
+ };
1797
+ if (hasFlag(ctx, "dry-run"))
1798
+ return { operation: "imported-sheets.retranslate", importedSheetId, ...payload };
1799
+ return requestApi(`/api/cli/imported-sheets/${importedSheetId}/retranslate`, {
1800
+ method: "POST",
1801
+ body: JSON.stringify(payload)
1802
+ });
1803
+ }
1804
+ if (action === "replace-grid") {
1805
+ const locale = getStringFlag(ctx, "locale") ?? getStringFlag(ctx, "language");
1806
+ if (!locale)
1807
+ throw new CliError("Missing --locale", 2);
1808
+ const grid = await parseJsonObjectFlag(ctx, "data", "data-file");
1809
+ if (Object.keys(grid).length === 0)
1810
+ throw new CliError("Missing --data or --data-file JSON", 2);
1811
+ const payload = {
1812
+ instanceId,
1813
+ locale,
1814
+ grid,
1815
+ rebuildSharedColumns: hasFlag(ctx, "rebuild-columns"),
1816
+ revectorize: hasFlag(ctx, "revectorize"),
1817
+ dryRun: hasFlag(ctx, "dry-run")
1818
+ };
1819
+ if (hasFlag(ctx, "dry-run"))
1820
+ return { operation: "imported-sheets.replace-grid", importedSheetId, ...payload };
1821
+ return requestApi(`/api/cli/imported-sheets/${importedSheetId}/replace-grid`, {
1822
+ method: "POST",
1823
+ body: JSON.stringify(payload)
1824
+ });
1825
+ }
1826
+ if (action === "vectorize") {
1827
+ const payload = {
1828
+ instanceId,
1829
+ locales: splitCsv(getStringFlag(ctx, "locales") ?? getStringFlag(ctx, "languages")),
1830
+ dryRun: hasFlag(ctx, "dry-run")
1831
+ };
1832
+ if (hasFlag(ctx, "dry-run"))
1833
+ return { operation: "imported-sheets.vectorize", importedSheetId, ...payload };
1834
+ return requestApi(`/api/cli/imported-sheets/${importedSheetId}/vectorize`, {
1835
+ method: "POST",
1836
+ body: JSON.stringify(payload)
1837
+ });
1838
+ }
1839
+ if (action === "repair-french") {
1840
+ const payload = {
1841
+ instanceId,
1842
+ locales: splitCsv(getStringFlag(ctx, "locales") ?? getStringFlag(ctx, "languages")),
1843
+ revectorize: hasFlag(ctx, "revectorize"),
1844
+ dryRun: hasFlag(ctx, "dry-run")
1845
+ };
1846
+ if (hasFlag(ctx, "dry-run"))
1847
+ return { operation: "imported-sheets.repair-french", importedSheetId, ...payload };
1848
+ return requestApi(`/api/cli/imported-sheets/${importedSheetId}/repair-french`, {
1849
+ method: "POST",
1850
+ body: JSON.stringify(payload)
1851
+ });
1852
+ }
1853
+ if (action === "delete") {
1854
+ const expectedConfirmation = `imported-sheets:${importedSheetId}`;
1855
+ if (!hasFlag(ctx, "force"))
1856
+ throw new CliError("Imported sheet delete requires --force", 2);
1857
+ if (getStringFlag(ctx, "confirm-delete") !== expectedConfirmation) {
1858
+ throw new CliError(`Imported sheet delete requires --confirm-delete ${expectedConfirmation}`, 2, {
1859
+ requiredConfirmation: expectedConfirmation,
1860
+ warning: "This permanently deletes the imported sheet, variants, rows and cells."
1861
+ });
1862
+ }
1863
+ const payload = {
1864
+ instanceId,
1865
+ confirmation: expectedConfirmation,
1866
+ dryRun: hasFlag(ctx, "dry-run")
1867
+ };
1868
+ if (hasFlag(ctx, "dry-run"))
1869
+ return { operation: "imported-sheets.delete", importedSheetId, ...payload };
1870
+ return requestApi(`/api/cli/imported-sheets/${importedSheetId}`, {
1871
+ method: "DELETE",
1872
+ body: JSON.stringify(payload)
1873
+ });
1874
+ }
1875
+ throw new CliError(`Unknown imported-sheets command "${action}"`, 2);
1876
+ };
1543
1877
  var syncLogs = (ctx) => {
1544
1878
  const searchParams = new URLSearchParams;
1545
1879
  const targetInstanceId = getStringFlag(ctx, "target") ?? getStringFlag(ctx, "instance");
@@ -1719,6 +2053,54 @@ var progressSearchParams = (ctx) => {
1719
2053
  searchParams.set("limit", limit);
1720
2054
  return searchParams;
1721
2055
  };
2056
+ var importedSheetSearchParams = (ctx) => {
2057
+ const searchParams = new URLSearchParams;
2058
+ const instanceId = getStringFlag(ctx, "instance");
2059
+ const locale = getStringFlag(ctx, "locale") ?? getStringFlag(ctx, "language");
2060
+ const page = getStringFlag(ctx, "page");
2061
+ const pageSize = getStringFlag(ctx, "page-size");
2062
+ if (instanceId)
2063
+ searchParams.set("instanceId", instanceId);
2064
+ if (locale)
2065
+ searchParams.set("locale", locale);
2066
+ if (page)
2067
+ searchParams.set("page", page);
2068
+ if (pageSize)
2069
+ searchParams.set("pageSize", pageSize);
2070
+ return searchParams;
2071
+ };
2072
+ var importedSheetCreatePayload = async (ctx) => {
2073
+ const data = await parseJsonObjectFlag(ctx, "data", "data-file");
2074
+ if (Object.keys(data).length > 0) {
2075
+ return {
2076
+ ...data,
2077
+ dryRun: hasFlag(ctx, "dry-run")
2078
+ };
2079
+ }
2080
+ const instanceId = getStringFlag(ctx, "instance");
2081
+ const sourceInput = getStringFlag(ctx, "source");
2082
+ const tabName = getStringFlag(ctx, "tab");
2083
+ if (!instanceId)
2084
+ throw new CliError("Missing --instance", 2);
2085
+ if (!sourceInput)
2086
+ throw new CliError("Missing --source", 2);
2087
+ if (!tabName)
2088
+ throw new CliError("Missing --tab", 2);
2089
+ return {
2090
+ instanceId,
2091
+ displayName: getStringFlag(ctx, "display-name"),
2092
+ enabledLocales: splitCsv(getStringFlag(ctx, "locales") ?? getStringFlag(ctx, "languages") ?? "fr"),
2093
+ multilangMode: getStringFlag(ctx, "mode") ?? "AI_TRANSLATION",
2094
+ defaultLocaleSource: {
2095
+ locale: getStringFlag(ctx, "default-locale") ?? "fr",
2096
+ sourceInput,
2097
+ tabName
2098
+ },
2099
+ enableVectorization: hasFlag(ctx, "enable-vectorization"),
2100
+ vectorHeaders: splitCsv(getStringFlag(ctx, "vector-headers") ?? getStringFlag(ctx, "vector-columns")),
2101
+ dryRun: hasFlag(ctx, "dry-run")
2102
+ };
2103
+ };
1722
2104
  var splitCsv = (value) => value ? value.split(",").map((item) => item.trim()).filter(Boolean) : [];
1723
2105
  var setWhereValue = (where, fieldPath, value) => {
1724
2106
  const parts = fieldPath.split(".").map((part) => part.trim()).filter(Boolean);
@@ -1807,6 +2189,11 @@ var getNumberFlag = (ctx, name) => {
1807
2189
  throw new CliError(`--${name} must be a number`, 2);
1808
2190
  return number;
1809
2191
  };
2192
+ var requireWriteConfirmation = (message, ctx) => {
2193
+ if (!hasFlag(ctx, "yes") && !hasFlag(ctx, "dry-run")) {
2194
+ throw new CliError(message, 2);
2195
+ }
2196
+ };
1810
2197
  var rootHelp = () => ({
1811
2198
  name: "gskills-admin",
1812
2199
  description: "Super admin CLI for GSkills operations through authenticated API routes",
@@ -1819,6 +2206,7 @@ var rootHelp = () => ({
1819
2206
  "gskills-admin sync run --target <instanceId> --only pages,quizzes --yes",
1820
2207
  "gskills-admin sync repair-source-links --target <instanceId> --dry-run",
1821
2208
  "gskills-admin translate pages <id> --to en,es --dry-run",
2209
+ "gskills-admin imported-sheets create --instance <id> --source <url> --tab <name> --locales fr,en --enable-vectorization --dry-run",
1822
2210
  "gskills-admin internal-knowledge sync-media --since today --languages fr --all-targets --dry-run",
1823
2211
  "gskills-admin progress learning-path-quiz-mismatches --instance <instanceId>",
1824
2212
  "gskills-admin sessions invalidate --email user@example.com --dry-run",
@@ -1856,6 +2244,24 @@ var schemaHelp = () => ({
1856
2244
  { name: "cache scopes", writes: false },
1857
2245
  { name: "cache invalidate", required: ["--instance"], flags: ["--scope", "--languages", "--yes", "--dry-run"], writes: true },
1858
2246
  { name: "translate", args: ["kind", "id?"], required: ["--to"], flags: ["--ids", "--all", "--instance", "--from", "--where", "--take", "--mode", "--source-history", "--yes", "--dry-run"], writes: true },
2247
+ { name: "imported-sheets list", required: ["--instance"], writes: false },
2248
+ { name: "imported-sheets get", args: ["id"], required: ["--instance"], flags: ["--locale", "--page", "--page-size"], writes: false },
2249
+ { name: "imported-sheets locales", args: ["id"], required: ["--instance"], writes: false },
2250
+ { name: "imported-sheets runs", args: ["id?"], required: ["--instance"], flags: ["--take"], writes: false },
2251
+ { name: "imported-sheets resolve", required: ["--instance", "--source"], writes: false },
2252
+ { name: "imported-sheets create", required: ["--instance", "--source", "--tab"], flags: ["--display-name", "--locales", "--mode", "--enable-vectorization", "--vector-headers", "--data", "--data-file", "--yes", "--dry-run"], writes: true },
2253
+ { name: "imported-sheets update", args: ["id"], required: ["--instance", "--data or --data-file"], flags: ["--yes", "--dry-run"], writes: true },
2254
+ { name: "imported-sheets sync", args: ["id"], required: ["--instance"], flags: ["--locales", "--yes", "--dry-run"], writes: true },
2255
+ { name: "imported-sheets enable-locales", args: ["id"], required: ["--instance", "--locales"], flags: ["--yes", "--dry-run"], writes: true },
2256
+ { name: "imported-sheets translate", args: ["id"], required: ["--instance", "--to"], flags: ["--yes", "--dry-run"], writes: true },
2257
+ { name: "imported-sheets retranslate", args: ["id"], required: ["--instance", "--to"], flags: ["--from", "--revectorize", "--yes", "--dry-run"], writes: true },
2258
+ { name: "imported-sheets replace-grid", args: ["id"], required: ["--instance", "--locale", "--data or --data-file"], flags: ["--rebuild-columns", "--revectorize", "--yes", "--dry-run"], writes: true },
2259
+ { name: "imported-sheets vectorize", args: ["id"], required: ["--instance"], flags: ["--locales", "--yes", "--dry-run"], writes: true },
2260
+ { name: "imported-sheets repair-french", args: ["id"], required: ["--instance"], flags: ["--locales", "--revectorize", "--yes", "--dry-run"], writes: true },
2261
+ { name: "imported-sheets copy-to", args: ["id"], required: ["--instance", "--target or --targets"], flags: ["--display-name", "--replace", "--revectorize", "--yes", "--dry-run"], writes: true },
2262
+ { name: "imported-sheets attach-page", args: ["id"], required: ["--instance", "--page"], flags: ["--locale", "--position", "--replace-existing", "--yes", "--dry-run"], writes: true },
2263
+ { name: "imported-sheets set-source", args: ["id"], required: ["--instance", "--locale", "--source", "--tab"], flags: ["--resync", "--yes", "--dry-run"], writes: true },
2264
+ { name: "imported-sheets delete", args: ["id"], required: ["--instance", "--force", "--confirm-delete"], flags: ["--yes", "--dry-run"], writes: true, destructive: true },
1859
2265
  { name: "internal-knowledge sync-media", flags: ["--source", "--target", "--targets", "--all-targets", "--languages", "--since", "--updated-after", "--fields", "--mime", "--source-type", "--include-disabled", "--include-archived", "--no-cache", "--yes", "--dry-run"], writes: true },
1860
2266
  { name: "pages backfill-field", required: ["--field", "--target or --targets or --all-targets"], flags: ["--source", "--languages", "--no-cache", "--yes", "--dry-run"], writes: true },
1861
2267
  { name: "feedback inspect", args: ["feedbackId or URL"], writes: false },
@@ -1983,6 +2389,50 @@ var translateHelp = () => ({
1983
2389
  patchMode: "For pages, --mode patch uses source page history to update changed translatable text while preserving target non-text block data such as activity ids, quiz ids, embedded ids, files, and future custom fields. It updates existing translations only and fails when no previous source history exists.",
1984
2390
  note: "Uses the same AI translation helpers as the editors. Dry-run plans the write without calling AI. Pass explicit target languages. --to all is intentionally rejected."
1985
2391
  });
2392
+ var importedSheetsHelp = () => ({
2393
+ usage: [
2394
+ "gskills-admin imported-sheets list --instance <instanceId>",
2395
+ "gskills-admin imported-sheets get <sheetId> --instance <instanceId> --locale en --page-size 100",
2396
+ "gskills-admin imported-sheets resolve --instance <instanceId> --source <sheet-url>",
2397
+ "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",
2398
+ "gskills-admin imported-sheets update <sheetId> --instance <instanceId> --data-file ./settings.json --dry-run",
2399
+ "gskills-admin imported-sheets sync <sheetId> --instance <instanceId> --dry-run",
2400
+ "gskills-admin imported-sheets translate <sheetId> --instance <instanceId> --to en,es --dry-run",
2401
+ "gskills-admin imported-sheets retranslate <sheetId> --instance <instanceId> --from en --to fr,de,es --dry-run",
2402
+ "gskills-admin imported-sheets replace-grid <sheetId> --instance <instanceId> --locale en --data-file ./grid.json --rebuild-columns --dry-run",
2403
+ "gskills-admin imported-sheets vectorize <sheetId> --instance <instanceId> --locales fr,en --dry-run",
2404
+ "gskills-admin imported-sheets repair-french <sheetId> --instance <instanceId> --locales es,it --revectorize --dry-run",
2405
+ "gskills-admin imported-sheets copy-to <sheetId> --instance global --target <instanceId> --display-name 'Use cases' --dry-run",
2406
+ "gskills-admin imported-sheets attach-page <sheetId> --instance <instanceId> --page <pageId> --locale fr --dry-run",
2407
+ "gskills-admin imported-sheets set-source <sheetId> --instance <instanceId> --locale en --source <sheet-url> --tab EN --resync --dry-run",
2408
+ "gskills-admin imported-sheets delete <sheetId> --instance <instanceId> --force --confirm-delete imported-sheets:<sheetId> --dry-run"
2409
+ ],
2410
+ writes: "create, update, sync, translate, retranslate, replace-grid, vectorize, repair-french, copy-to, attach-page, set-source and delete require --yes or --dry-run.",
2411
+ createDataShape: {
2412
+ instanceId: "global",
2413
+ displayName: "Cas d'usage Gemini",
2414
+ enabledLocales: ["fr", "en", "es"],
2415
+ multilangMode: "AI_TRANSLATION",
2416
+ defaultLocaleSource: { locale: "fr", sourceInput: "https://docs.google.com/spreadsheets/d/...", tabName: "FR" },
2417
+ localeSources: [{ locale: "en", sourceInput: "https://docs.google.com/spreadsheets/d/...", tabName: "EN" }],
2418
+ enableVectorization: true,
2419
+ vectorHeaders: ["Titre", "Description", "Prompt"]
2420
+ },
2421
+ updateDataShape: {
2422
+ displayName: "Cas d'usage Gemini",
2423
+ viewMode: "LINE",
2424
+ enableVectorization: true,
2425
+ columns: [{ id: "column_id", isVisible: true, includeInVectorization: true, displayType: "TITLE", showLabel: false, displayOrder: 0 }],
2426
+ vectorHeaders: ["Titre", "Description", "Prompt"]
2427
+ },
2428
+ useCaseListFlow: [
2429
+ "copy-to from global to a client instance with --display-name 'Use cases'",
2430
+ "attach-page inserts the importedSheet EditorJS block and invalidates page deploy cache",
2431
+ "set-source updates one locale source and can --resync immediately",
2432
+ "replace-grid writes a locale from an explicit JSON grid when the app OAuth Sheets scope is missing but the sheet was read by a trusted CLI such as gws",
2433
+ "retranslate rebuilds AI_TRANSLATION locales from the stored source rows without reading Google Sheets"
2434
+ ]
2435
+ });
1986
2436
  var PAGE_TRANSLATION_REWRITE_WARNING = "WARNING: translate pages is a full translated-page rewrite, not a diff update. Rebuilding target pages 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.";
1987
2437
  var addTranslatePagesWarning = (kind, mode, result) => {
1988
2438
  if (kind !== "pages" && kind !== "page")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@numericoach/gskills-admin-cli",
3
- "version": "0.1.21",
3
+ "version": "0.1.23",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Admin-only CLI for GSkills super-admin operations.",
@@ -246,6 +246,33 @@ For internal knowledge videos, use `knowledge-video`. It queues the same native
246
246
 
247
247
  After visible content translation, read the cache hint in the response and invalidate the narrow scope before checking the deploy UI.
248
248
 
249
+ ## Imported Sheets
250
+
251
+ Use `imported-sheets` for imported Google Sheets such as Gemini use-case catalogs.
252
+
253
+ Common flows:
254
+
255
+ ```bash
256
+ gskills-admin imported-sheets list --instance <instanceId> --output json
257
+ gskills-admin imported-sheets resolve --instance <instanceId> --source <sheet-url> --output json
258
+ 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
259
+ gskills-admin imported-sheets sync <sheetId> --instance <instanceId> --dry-run --output json
260
+ gskills-admin imported-sheets translate <sheetId> --instance <instanceId> --to en,es --dry-run --output json
261
+ gskills-admin imported-sheets retranslate <sheetId> --instance <instanceId> --from en --to fr,de,es --dry-run --output json
262
+ gskills-admin imported-sheets replace-grid <sheetId> --instance <instanceId> --locale en --data-file ./grid.json --rebuild-columns --dry-run --output json
263
+ gskills-admin imported-sheets vectorize <sheetId> --instance <instanceId> --locales fr,en --dry-run --output json
264
+ gskills-admin imported-sheets repair-french <sheetId> --instance <instanceId> --locales es,it --revectorize --dry-run --output json
265
+ gskills-admin imported-sheets copy-to <sheetId> --instance global --target <instanceId> --display-name "Use cases" --dry-run --output json
266
+ gskills-admin imported-sheets attach-page <sheetId> --instance <instanceId> --page <pageId> --locale fr --dry-run --output json
267
+ gskills-admin imported-sheets set-source <sheetId> --instance <instanceId> --locale en --source <sheet-url> --tab EN --resync --dry-run --output json
268
+ ```
269
+
270
+ Create supports either flags or `--data-file`. Use `--data-file` for `SHEET_PER_LANGUAGE` because locale sources are easier to audit as JSON.
271
+
272
+ For the Gemini use-case list plugin flow, copy the global sheet to the client instance with `--display-name "Use cases"`, attach it to a page if the customer needs a page embed, then use `set-source --resync` when a locale tab has to be replaced.
273
+
274
+ Dry-run first. Imported sheet writes can create rows, variants, cells, sync runs, translations, embeddings, page blocks, deploy cache bumps, or permanent deletes depending on the command.
275
+
249
276
  ## Sync
250
277
 
251
278
  Global is the source by default.