@se-studio/contentful-cms 2.3.0 → 2.5.0

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 (139) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/HOSTED.md +2 -2
  3. package/INSTALL.md +14 -136
  4. package/README.md +27 -54
  5. package/dist/bin/contentful-cms.js +2 -12
  6. package/dist/bin/contentful-cms.js.map +1 -1
  7. package/dist/cli/program.d.ts.map +1 -1
  8. package/dist/cli/program.js +11 -11
  9. package/dist/cli/program.js.map +1 -1
  10. package/dist/commands/article-tags-from-json.d.ts +4 -0
  11. package/dist/commands/article-tags-from-json.d.ts.map +1 -0
  12. package/dist/commands/article-tags-from-json.js +54 -0
  13. package/dist/commands/article-tags-from-json.js.map +1 -0
  14. package/dist/commands/{screenshot.d.ts → bulk-rtf-replace.d.ts} +2 -2
  15. package/dist/commands/bulk-rtf-replace.d.ts.map +1 -0
  16. package/dist/commands/bulk-rtf-replace.js +103 -0
  17. package/dist/commands/bulk-rtf-replace.js.map +1 -0
  18. package/dist/commands/create-person-from-json.d.ts +4 -0
  19. package/dist/commands/create-person-from-json.d.ts.map +1 -0
  20. package/dist/commands/create-person-from-json.js +85 -0
  21. package/dist/commands/create-person-from-json.js.map +1 -0
  22. package/dist/commands/create-person.d.ts +4 -0
  23. package/dist/commands/create-person.d.ts.map +1 -0
  24. package/dist/commands/create-person.js +56 -0
  25. package/dist/commands/create-person.js.map +1 -0
  26. package/dist/commands/create-taxonomy-from-json.d.ts.map +1 -1
  27. package/dist/commands/create-taxonomy-from-json.js +47 -31
  28. package/dist/commands/create-taxonomy-from-json.js.map +1 -1
  29. package/dist/commands/create-taxonomy.d.ts +2 -0
  30. package/dist/commands/create-taxonomy.d.ts.map +1 -1
  31. package/dist/commands/create-taxonomy.js +7 -6
  32. package/dist/commands/create-taxonomy.js.map +1 -1
  33. package/dist/commands/ensure.d.ts.map +1 -1
  34. package/dist/commands/ensure.js +49 -0
  35. package/dist/commands/ensure.js.map +1 -1
  36. package/dist/commands/health.d.ts.map +1 -1
  37. package/dist/commands/health.js +2 -22
  38. package/dist/commands/health.js.map +1 -1
  39. package/dist/commands/help.js +1 -1
  40. package/dist/commands/help.js.map +1 -1
  41. package/dist/commands/preview.d.ts.map +1 -1
  42. package/dist/commands/preview.js +63 -16
  43. package/dist/commands/preview.js.map +1 -1
  44. package/dist/commands/project.d.ts.map +1 -1
  45. package/dist/commands/project.js +35 -0
  46. package/dist/commands/project.js.map +1 -1
  47. package/dist/config/types.d.ts +3 -3
  48. package/dist/config/types.d.ts.map +1 -1
  49. package/dist/contentful/article-tags-from-json.d.ts +25 -0
  50. package/dist/contentful/article-tags-from-json.d.ts.map +1 -0
  51. package/dist/contentful/article-tags-from-json.js +121 -0
  52. package/dist/contentful/article-tags-from-json.js.map +1 -0
  53. package/dist/contentful/bulk-rtf-replace.d.ts +29 -0
  54. package/dist/contentful/bulk-rtf-replace.d.ts.map +1 -0
  55. package/dist/contentful/bulk-rtf-replace.js +119 -0
  56. package/dist/contentful/bulk-rtf-replace.js.map +1 -0
  57. package/dist/contentful/entry-fields.d.ts +1 -1
  58. package/dist/contentful/entry-fields.d.ts.map +1 -1
  59. package/dist/contentful/entry-fields.js +13 -0
  60. package/dist/contentful/entry-fields.js.map +1 -1
  61. package/dist/contentful/person-create.d.ts +31 -0
  62. package/dist/contentful/person-create.d.ts.map +1 -0
  63. package/dist/contentful/person-create.js +111 -0
  64. package/dist/contentful/person-create.js.map +1 -0
  65. package/dist/editor-pack/capabilities.d.ts +82 -0
  66. package/dist/editor-pack/capabilities.d.ts.map +1 -0
  67. package/dist/editor-pack/capabilities.js +350 -0
  68. package/dist/editor-pack/capabilities.js.map +1 -0
  69. package/dist/editor-pack/generate.d.ts.map +1 -1
  70. package/dist/editor-pack/generate.js +57 -15
  71. package/dist/editor-pack/generate.js.map +1 -1
  72. package/dist/generated/hosted-guide.d.ts +1 -1
  73. package/dist/generated/hosted-guide.d.ts.map +1 -1
  74. package/dist/generated/hosted-guide.js +1 -1
  75. package/dist/generated/hosted-guide.js.map +1 -1
  76. package/dist/generated/version.d.ts +1 -1
  77. package/dist/generated/version.js +1 -1
  78. package/dist/hosted/customer-playbooks.d.ts.map +1 -1
  79. package/dist/hosted/customer-playbooks.js +3 -16
  80. package/dist/hosted/customer-playbooks.js.map +1 -1
  81. package/dist/hosted/next/pages/CmsEditPage.d.ts.map +1 -1
  82. package/dist/hosted/next/pages/CmsEditPage.js +1 -1
  83. package/dist/hosted/next/pages/CmsEditPage.js.map +1 -1
  84. package/dist/hosted/next/pages/CustomerPlaybooksPage.d.ts.map +1 -1
  85. package/dist/hosted/next/pages/CustomerPlaybooksPage.js +12 -3
  86. package/dist/hosted/next/pages/CustomerPlaybooksPage.js.map +1 -1
  87. package/dist/hosted/next/pages/HomePage.d.ts.map +1 -1
  88. package/dist/hosted/next/pages/HomePage.js +1 -1
  89. package/dist/hosted/next/pages/HomePage.js.map +1 -1
  90. package/dist/mcp/guide.d.ts +2 -2
  91. package/dist/mcp/guide.d.ts.map +1 -1
  92. package/dist/mcp/guide.js +10 -5
  93. package/dist/mcp/guide.js.map +1 -1
  94. package/dist/mcp/prompts/onboarding.d.ts.map +1 -1
  95. package/dist/mcp/prompts/onboarding.js +116 -2
  96. package/dist/mcp/prompts/onboarding.js.map +1 -1
  97. package/dist/mcp/server.d.ts +1 -1
  98. package/dist/mcp/server.d.ts.map +1 -1
  99. package/dist/mcp/tools/cms-edit.d.ts +1 -1
  100. package/dist/mcp/tools/cms-edit.d.ts.map +1 -1
  101. package/dist/mcp/tools/cms-edit.js +4 -0
  102. package/dist/mcp/tools/cms-edit.js.map +1 -1
  103. package/dist/preview/capture-urls.d.ts +12 -0
  104. package/dist/preview/capture-urls.d.ts.map +1 -0
  105. package/dist/preview/capture-urls.js +41 -0
  106. package/dist/preview/capture-urls.js.map +1 -0
  107. package/dist/project/doctor.d.ts +9 -0
  108. package/dist/project/doctor.d.ts.map +1 -0
  109. package/dist/project/doctor.js +136 -0
  110. package/dist/project/doctor.js.map +1 -0
  111. package/docs/FUNCTIONAL_SPEC.md +4 -4
  112. package/docs/MEDIA_INDEX_PLAN.md +1 -1
  113. package/docs/SKILLS.md +3 -3
  114. package/docs/help/article-tags-from-json.md +62 -0
  115. package/docs/help/bulk-rtf-replace.md +80 -0
  116. package/docs/help/index.md +18 -2
  117. package/docs/help/person-from-json.md +82 -0
  118. package/docs/mcp/hosted-guide.md +15 -4
  119. package/package.json +2 -5
  120. package/skills/README.md +1 -1
  121. package/skills/core/SKILL.md +20 -79
  122. package/skills/editor-tasks/SKILL.md +83 -0
  123. package/skills/manifest.json +2 -1
  124. package/skills/setup/SKILL.md +21 -87
  125. package/dist/bin/cms-edit-mcp.d.ts +0 -3
  126. package/dist/bin/cms-edit-mcp.d.ts.map +0 -1
  127. package/dist/bin/cms-edit-mcp.js +0 -15
  128. package/dist/bin/cms-edit-mcp.js.map +0 -1
  129. package/dist/bin/cms-edit-setup.d.ts +0 -3
  130. package/dist/bin/cms-edit-setup.d.ts.map +0 -1
  131. package/dist/bin/cms-edit-setup.js +0 -7
  132. package/dist/bin/cms-edit-setup.js.map +0 -1
  133. package/dist/commands/screenshot.d.ts.map +0 -1
  134. package/dist/commands/screenshot.js +0 -275
  135. package/dist/commands/screenshot.js.map +0 -1
  136. package/dist/setup/wizard.d.ts +0 -4
  137. package/dist/setup/wizard.d.ts.map +0 -1
  138. package/dist/setup/wizard.js +0 -260
  139. package/dist/setup/wizard.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import type { RunCmsEditFn } from '../types.js';
3
- export declare const TOOL_DESCRIPTION = "Run any cms-edit command. cms-edit edits Contentful draft content (no publishing).\n\nUse cms_edit_version (no args) to check the installed version.\nUse cms_edit_help to read the getting-started guide by topic.\nUse cms_edit_customer to read site-specific playbooks (articles, routing, blog-tag-matrix, etc.).\nIf Integrations only exposes cms_edit, use [\"customer\", \"index\"] or [\"customer\", \"resource=index\"] instead.\nRead the cms-edit://guide resource for the full guide.\n\nWorkflow: open \u2192 snapshot \u2192 read/set/rtf/add/remove \u2192 diff \u2192 save\nAll saves create drafts only \u2014 a human must publish in Contentful.\n\nCommon command sequences:\n [\"open\", \"--page-slug\", \"/\"] \u2014 homepage (CMS slug index; /index is equivalent)\n [\"open\", \"--page-slug\", \"/pricing\"] \u2014 load a page by slug\n [\"open\", \"--id\", \"<entry-id>\"] \u2014 load by Contentful entry ID\n [\"snapshot\"] \u2014 print content tree with @refs\n [\"read\", \"@c0\"] \u2014 read all fields of a component (requires open session)\n [\"read\", \"@c0\", \"heading\"] \u2014 read a specific field (requires open session)\n [\"read\", \"@root\"] \u2014 read root entry fields (requires open session)\n [\"read\", \"<entry-id>\", \"--id\"] \u2014 read entry by ID (no session)\n [\"read\", \"<entry-id>\", \"--id\", \"heading\"] \u2014 read one field by entry ID (no session)\n [\"peek\", \"--page-slug\", \"/pricing\"] \u2014 preview tree + root fields (no session)\n [\"peek\", \"--id\", \"<entry-id>\"] \u2014 preview by entry ID with rootFields in JSON\n [\"set\", \"@c0\", \"heading\", \"New heading\"] \u2014 set a scalar field\n [\"rtf\", \"@c0\", \"body\", \"--content\", \"# H1\\n\\nBody.\"] \u2014 set rich text (preferred for AI)\n [\"rtf\", \"@c0\", \"body\", \"--base64\", \"<encoded>\"] \u2014 set rich text via base64 (no filesystem)\n [\"diff\"] \u2014 show pending changes\n [\"save\"] \u2014 write drafts to Contentful\n [\"discard\"] \u2014 discard unsaved changes\n [\"links\", \"set\", \"@c0\", \"0\", \"variant\", \"link\"] \u2014 set scalar field on link at index 0\n [\"batch\", \"set\", \"<entry-id>:variant=link\"] \u2014 queue scalar edit by entry ID\n [\"batch\", \"diff\"] \u2014 show pending batch edits\n [\"batch\", \"save\"] \u2014 save all batch edits as drafts\n [\"health\"] \u2014 verify config and connectivity\n [\"diagnose\"] \u2014 session/MCP diagnostics (store, userId, active session)\n [\"version\"] \u2014 print installed cms-edit version\n [\"guide\"] \u2014 print getting-started guide\n [\"guide\", \"workflow\"] \u2014 print a guide section\n [\"customer\", \"index\"] \u2014 list site editor playbooks\n [\"customer\", \"articles\"] \u2014 read articles playbook\n [\"customer\", \"resource=index\"] \u2014 same as index (Integrations fallback)\n [\"list\", \"--type\", \"article\", \"--sort\", \"date\", \"-n\", \"10\"] \u2014 recent articles by publication date\n [\"sitemap\", \"--include\", \"article\", \"--status\", \"draft\"] \u2014 find draft articles\n [\"peek\", \"--article-slug\", \"<slug>\"] \u2014 preview draft or published article (CMA)\n\nDiscovery notes:\n peek/open/read --id load draft content via CMA \u2014 NOT published-only.\n Only list --published / resolve --published use the published-only Delivery API index.\n Articles: use --article-slug (not --page-slug). search --type article sorts by publication date.\n\nSessions persist between MCP calls (Redis on hosted, disk locally). MCP auto-uses session \"_mcp\" unless you pass --session.\nUse --session <name> before the subcommand to isolate concurrent workflows, e.g. [\"--session\", \"my-work\", \"open\", \"/\"].\nUse --space <name> to target a specific Contentful space (local MCP only \u2014 omit for hosted Integrations).\nStateless read (no open required): [\"read\", \"<entry-id>\", \"--id\"] or [\"read\", \"<entry-id>\", \"--id\", \"heading\"].\npeek is one-shot (no session): use [\"peek\", \"--page-slug\", \"<slug>\"] or [\"peek\", \"--id\", \"<entry-id>\"]. Includes rootFields in JSON \u2014 no follow-up read required.\nOutput is always JSON (CMS_EDIT_JSON=1 is forced by the MCP server).\n\nRich text tips:\n --content \"<markdown>\" preferred named flag for inline content (any length)\n --base64 \"<encoded>\" fully environment-agnostic, no filesystem needed\n --file \"<abs-path>\" platform-native absolute path required (C:\\\\Users\\\\... on Windows)\n stdin (\"-\") not supported via MCP";
3
+ export declare const TOOL_DESCRIPTION = "Run any cms-edit command. cms-edit edits Contentful draft content (no publishing).\n\nUse cms_edit_version (no args) to check the installed version.\nUse cms_edit_help to read the getting-started guide by topic.\nUse cms_edit_customer to read site-specific playbooks (articles, routing, blog-tag-matrix, etc.).\nIf Integrations only exposes cms_edit, use [\"customer\", \"index\"] or [\"customer\", \"resource=index\"] instead.\nRead the cms-edit://guide resource for the full guide.\n\nWorkflow: open \u2192 snapshot \u2192 read/set/rtf/add/remove \u2192 diff \u2192 save\nAll saves create drafts only \u2014 a human must publish in Contentful.\n\nCommon command sequences:\n [\"open\", \"--page-slug\", \"/\"] \u2014 homepage (CMS slug index; /index is equivalent)\n [\"open\", \"--page-slug\", \"/pricing\"] \u2014 load a page by slug\n [\"open\", \"--id\", \"<entry-id>\"] \u2014 load by Contentful entry ID\n [\"snapshot\"] \u2014 print content tree with @refs\n [\"read\", \"@c0\"] \u2014 read all fields of a component (requires open session)\n [\"read\", \"@c0\", \"heading\"] \u2014 read a specific field (requires open session)\n [\"read\", \"@root\"] \u2014 read root entry fields (requires open session)\n [\"read\", \"<entry-id>\", \"--id\"] \u2014 read entry by ID (no session)\n [\"read\", \"<entry-id>\", \"--id\", \"heading\"] \u2014 read one field by entry ID (no session)\n [\"peek\", \"--page-slug\", \"/pricing\"] \u2014 preview tree + root fields (no session)\n [\"peek\", \"--id\", \"<entry-id>\"] \u2014 preview by entry ID with rootFields in JSON\n [\"set\", \"@c0\", \"heading\", \"New heading\"] \u2014 set a scalar field\n [\"rtf\", \"@c0\", \"body\", \"--content\", \"# H1\\n\\nBody.\"] \u2014 set rich text (preferred for AI)\n [\"rtf\", \"@c0\", \"body\", \"--base64\", \"<encoded>\"] \u2014 set rich text via base64 (no filesystem)\n [\"diff\"] \u2014 show pending changes\n [\"save\"] \u2014 write drafts to Contentful\n [\"discard\"] \u2014 discard unsaved changes\n [\"links\", \"set\", \"@c0\", \"0\", \"variant\", \"link\"] \u2014 set scalar field on link at index 0\n [\"batch\", \"set\", \"<entry-id>:variant=link\"] \u2014 queue scalar edit by entry ID\n [\"batch\", \"diff\"] \u2014 show pending batch edits\n [\"batch\", \"save\"] \u2014 save all batch edits as drafts\n [\"health\"] \u2014 verify config and connectivity\n [\"diagnose\"] \u2014 session/MCP diagnostics (store, userId, active session)\n [\"version\"] \u2014 print installed cms-edit version\n [\"guide\"] \u2014 print getting-started guide\n [\"guide\", \"workflow\"] \u2014 print a guide section\n [\"customer\", \"index\"] \u2014 list site editor playbooks\n [\"customer\", \"articles\"] \u2014 read articles playbook\n [\"customer\", \"resource=index\"] \u2014 same as index (Integrations fallback)\n [\"list\", \"--type\", \"article\", \"--sort\", \"date\", \"-n\", \"10\"] \u2014 recent articles by publication date\n [\"sitemap\", \"--include\", \"article\", \"--status\", \"draft\"] \u2014 find draft articles\n [\"peek\", \"--article-slug\", \"<slug>\"] \u2014 preview draft or published article (CMA)\n [\"preview\", \"url\", \"/pricing\"] \u2014 page preview URL (open in browser MCP)\n [\"preview\", \"showcase\", \"--component\", \"HeroSimple\"] \u2014 component showcase URL (mock data)\n [\"preview\", \"showcase\", \"--collection\", \"CardGrid\", \"--param\", \"backgroundColour=Navy\"]\n\nDiscovery notes:\n Visual checks: use preview url / preview showcase, then open the returned URL with a browser MCP (cms-edit does not capture screenshots).\n peek/open/read --id load draft content via CMA \u2014 NOT published-only.\n Only list --published / resolve --published use the published-only Delivery API index.\n Articles: use --article-slug (not --page-slug). search --type article sorts by publication date.\n\nSessions persist between MCP calls (Redis on hosted, disk locally). MCP auto-uses session \"_mcp\" unless you pass --session.\nUse --session <name> before the subcommand to isolate concurrent workflows, e.g. [\"--session\", \"my-work\", \"open\", \"/\"].\nUse --space <name> to target a specific Contentful space (local MCP only \u2014 omit for hosted Integrations).\nStateless read (no open required): [\"read\", \"<entry-id>\", \"--id\"] or [\"read\", \"<entry-id>\", \"--id\", \"heading\"].\npeek is one-shot (no session): use [\"peek\", \"--page-slug\", \"<slug>\"] or [\"peek\", \"--id\", \"<entry-id>\"]. Includes rootFields in JSON \u2014 no follow-up read required.\nOutput is always JSON (CMS_EDIT_JSON=1 is forced by the MCP server).\n\nRich text tips:\n --content \"<markdown>\" preferred named flag for inline content (any length)\n --base64 \"<encoded>\" fully environment-agnostic, no filesystem needed\n --file \"<abs-path>\" platform-native absolute path required (C:\\\\Users\\\\... on Windows)\n stdin (\"-\") not supported via MCP";
4
4
  export declare function registerCmsEditTools(server: McpServer, runCmsEdit: RunCmsEditFn): void;
5
5
  export declare function getMcpServerInfo(): {
6
6
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"cms-edit.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/cms-edit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,gBAAgB,63KA6DoB,CAAC;AAElD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,GAAG,IAAI,CA8BtF;AAED,wBAAgB,gBAAgB,IAAI;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAEpE"}
1
+ {"version":3,"file":"cms-edit.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/cms-edit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,gBAAgB,m1LAiEoB,CAAC;AAElD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,GAAG,IAAI,CA8BtF;AAED,wBAAgB,gBAAgB,IAAI;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAEpE"}
@@ -46,8 +46,12 @@ Common command sequences:
46
46
  ["list", "--type", "article", "--sort", "date", "-n", "10"] — recent articles by publication date
47
47
  ["sitemap", "--include", "article", "--status", "draft"] — find draft articles
48
48
  ["peek", "--article-slug", "<slug>"] — preview draft or published article (CMA)
49
+ ["preview", "url", "/pricing"] — page preview URL (open in browser MCP)
50
+ ["preview", "showcase", "--component", "HeroSimple"] — component showcase URL (mock data)
51
+ ["preview", "showcase", "--collection", "CardGrid", "--param", "backgroundColour=Navy"]
49
52
 
50
53
  Discovery notes:
54
+ Visual checks: use preview url / preview showcase, then open the returned URL with a browser MCP (cms-edit does not capture screenshots).
51
55
  peek/open/read --id load draft content via CMA — NOT published-only.
52
56
  Only list --published / resolve --published use the published-only Delivery API index.
53
57
  Articles: use --article-slug (not --page-slug). search --type article sorts by publication date.
@@ -1 +1 @@
1
- {"version":3,"file":"cms-edit.js","sourceRoot":"","sources":["../../../src/mcp/tools/cms-edit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDA6DiB,CAAC;AAElD,MAAM,UAAU,oBAAoB,CAAC,MAAiB,EAAE,UAAwB;IAC9E,MAAM,CAAC,IAAI,CACT,kBAAkB,EAClB,+FAA+F,EAC/F,EAAE,EACF,KAAK,IAAI,EAAE;QACT,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;QAC9B,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,CAAC;SAClF,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,UAAU,EACV,gBAAgB,EAChB;QACE,IAAI,EAAE,CAAC;aACJ,KAAK,C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AAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,CAAC;SAClF,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,UAAU,EACV,gBAAgB,EAChB;QACE,IAAI,EAAE,CAAC;aACJ,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;aACjB,QAAQ,CACP,uJAAuJ,CACxJ;KACJ,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACjB,MAAM,cAAc,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;QAC5C,iBAAiB,CAAC,oBAAoB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;QAC3E,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,cAAc,CAAC,CAAC;QAC9C,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IACxD,CAAC,CACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;AACzD,CAAC"}
@@ -0,0 +1,12 @@
1
+ export type ShowcaseMode = 'component' | 'collection';
2
+ export interface BuildShowcaseUrlOptions {
3
+ embedded?: boolean;
4
+ clean?: boolean;
5
+ requestParams?: Record<string, string>;
6
+ }
7
+ /** Parse --param key=value strings into a record for the showcase URL. */
8
+ export declare function parseParamOverrides(params: string[]): Record<string, string>;
9
+ export declare function buildShowcaseUrl(baseUrl: string, type: string, mode: ShowcaseMode, fields: Record<string, string>, options?: BuildShowcaseUrlOptions): string;
10
+ /** Appends requestParams as query parameters to an arbitrary URL. */
11
+ export declare function appendRequestParams(url: string, requestParams: Record<string, string> | undefined): string;
12
+ //# sourceMappingURL=capture-urls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capture-urls.d.ts","sourceRoot":"","sources":["../../src/preview/capture-urls.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,YAAY,CAAC;AAEtD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC;AAED,0EAA0E;AAC1E,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAU5E;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,OAAO,GAAE,uBAA4B,GACpC,MAAM,CAiBR;AAED,qEAAqE;AACrE,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAChD,MAAM,CAKR"}
@@ -0,0 +1,41 @@
1
+ /** Parse --param key=value strings into a record for the showcase URL. */
2
+ export function parseParamOverrides(params) {
3
+ const out = {};
4
+ for (const p of params) {
5
+ const eq = p.indexOf('=');
6
+ if (eq === -1)
7
+ continue;
8
+ const key = p.slice(0, eq).trim();
9
+ const value = p.slice(eq + 1).trim();
10
+ if (key)
11
+ out[key] = value;
12
+ }
13
+ return out;
14
+ }
15
+ export function buildShowcaseUrl(baseUrl, type, mode, fields, options = {}) {
16
+ const params = new URLSearchParams({ type, mode });
17
+ for (const [key, value] of Object.entries(fields)) {
18
+ params.set(key, value);
19
+ }
20
+ if (options.embedded) {
21
+ params.set('embedded', 'true');
22
+ }
23
+ if (options.clean) {
24
+ params.set('clean', 'true');
25
+ }
26
+ if (options.requestParams) {
27
+ for (const [key, value] of Object.entries(options.requestParams)) {
28
+ params.set(key, value);
29
+ }
30
+ }
31
+ return `${baseUrl}/cms/showcase/render?${params.toString()}`;
32
+ }
33
+ /** Appends requestParams as query parameters to an arbitrary URL. */
34
+ export function appendRequestParams(url, requestParams) {
35
+ if (!requestParams || Object.keys(requestParams).length === 0)
36
+ return url;
37
+ const separator = url.includes('?') ? '&' : '?';
38
+ const extra = new URLSearchParams(requestParams).toString();
39
+ return `${url}${separator}${extra}`;
40
+ }
41
+ //# sourceMappingURL=capture-urls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capture-urls.js","sourceRoot":"","sources":["../../src/preview/capture-urls.ts"],"names":[],"mappings":"AAQA,0EAA0E;AAC1E,MAAM,UAAU,mBAAmB,CAAC,MAAgB;IAClD,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,EAAE,KAAK,CAAC,CAAC;YAAE,SAAS;QACxB,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QAClC,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACrC,IAAI,GAAG;YAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAC5B,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,OAAe,EACf,IAAY,EACZ,IAAkB,EAClB,MAA8B,EAC9B,UAAmC,EAAE;IAErC,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IACnD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ity = 'error' | 'warning' | 'info';
3
+ export interface DoctorFinding {
4
+ severity: DoctorSeverity;
5
+ code: string;
6
+ message: string;
7
+ }
8
+ export declare function runProjectDoctor(configPath: string, project: CmsEditProject): DoctorFinding[];
9
+ //# sourceMappingURL=doctor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/project/doctor.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAE1D,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,cAAc,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAiDD,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,aAAa,EAAE,CAkG7F"}
@@ -0,0 +1,136 @@
1
+ import * as fs from 'node:fs';
2
+ import * as path from 'node:path';
3
+ import { loadEditorPackManifest } from '../editor-pack/load.js';
4
+ import { parseConstants } from '../editor-pack/parse-constants.js';
5
+ import { resolveRepoRoot, resolveWebsiteAppDir } from './load.js';
6
+ function findArticlesPlaybook(repoRoot, projectKey) {
7
+ const candidates = [
8
+ path.join(repoRoot, 'docs', 'cms-editor', projectKey, 'ARTICLES.md'),
9
+ path.join(repoRoot, 'docs', 'cms-editor', 'ARTICLES.md'),
10
+ path.join(repoRoot, 'docs', 'cms-editor', projectKey, 'articles.md'),
11
+ path.join(repoRoot, 'docs', 'cms-editor', 'articles.md'),
12
+ ];
13
+ return candidates.some((candidate) => fs.existsSync(candidate));
14
+ }
15
+ function siteHasArticles(appDir) {
16
+ const constants = parseConstants(appDir);
17
+ return Boolean(constants.articlesSlug || constants.articlesBase || constants.enableArticleTypeIndex === true);
18
+ }
19
+ function newestMtime(paths) {
20
+ let newest = null;
21
+ for (const filePath of paths) {
22
+ if (!fs.existsSync(filePath))
23
+ continue;
24
+ const mtime = fs.statSync(filePath).mtimeMs;
25
+ if (newest === null || mtime > newest)
26
+ newest = mtime;
27
+ }
28
+ return newest;
29
+ }
30
+ function collectGuidelineMtimes(repoRoot, appDir) {
31
+ const dirs = [
32
+ path.join(appDir, 'docs', 'cms-guidelines'),
33
+ path.join(repoRoot, 'docs', 'cms-guidelines'),
34
+ ];
35
+ const files = [];
36
+ for (const dir of dirs) {
37
+ if (!fs.existsSync(dir))
38
+ continue;
39
+ const walk = (current) => {
40
+ for (const entry of fs.readdirSync(current, { withFileTypes: true })) {
41
+ const full = path.join(current, entry.name);
42
+ if (entry.isDirectory())
43
+ walk(full);
44
+ else if (entry.name.endsWith('.md'))
45
+ files.push(full);
46
+ }
47
+ };
48
+ walk(dir);
49
+ }
50
+ return newestMtime(files);
51
+ }
52
+ export function runProjectDoctor(configPath, project) {
53
+ const findings = [];
54
+ const resolvedConfig = path.resolve(configPath);
55
+ const packDir = path.join(path.dirname(resolvedConfig), 'editor-pack');
56
+ if (!fs.existsSync(packDir)) {
57
+ findings.push({
58
+ severity: 'error',
59
+ code: 'pack_missing',
60
+ message: `editor-pack/ not found — run: cms-edit editor-pack generate --project-config ${resolvedConfig}`,
61
+ });
62
+ return findings;
63
+ }
64
+ const repoRoot = resolveRepoRoot(resolvedConfig, project.website.appDir);
65
+ const appDir = resolveWebsiteAppDir(resolvedConfig, project.website.appDir);
66
+ const manifest = loadEditorPackManifest(packDir);
67
+ if (!manifest) {
68
+ findings.push({
69
+ severity: 'error',
70
+ code: 'manifest_missing',
71
+ message: 'editor-pack/manifest.json is missing or invalid',
72
+ });
73
+ return findings;
74
+ }
75
+ const requiredPackFiles = ['capabilities.json', 'tasks-index.md', 'checklist.md'];
76
+ for (const file of requiredPackFiles) {
77
+ if (!fs.existsSync(path.join(packDir, file))) {
78
+ findings.push({
79
+ severity: 'error',
80
+ code: 'pack_stale',
81
+ message: `editor-pack/${file} missing — regenerate editor pack`,
82
+ });
83
+ }
84
+ }
85
+ const articlesExpected = siteHasArticles(appDir) || findArticlesPlaybook(repoRoot, project.projectKey);
86
+ if (articlesExpected && !findArticlesPlaybook(repoRoot, project.projectKey)) {
87
+ findings.push({
88
+ severity: 'warning',
89
+ code: 'articles_playbook_missing',
90
+ message: `Site appears to have articles but docs/cms-editor/${project.projectKey}/articles.md is missing`,
91
+ });
92
+ }
93
+ if (articlesExpected && !manifest.resources.includes('articles')) {
94
+ findings.push({
95
+ severity: 'warning',
96
+ code: 'pack_articles_missing',
97
+ message: 'editor-pack has no articles.md — regenerate after adding articles playbook',
98
+ });
99
+ }
100
+ const routingPath = path.join(packDir, 'routing.md');
101
+ if (fs.existsSync(routingPath)) {
102
+ const routing = fs.readFileSync(routingPath, 'utf8');
103
+ if (!routing.includes('## Article paths') ||
104
+ routing.split('## Article paths')[1]?.trim().length === 0) {
105
+ findings.push({
106
+ severity: 'info',
107
+ code: 'routing_sparse',
108
+ message: 'editor-pack/routing.md has sparse article paths — regenerate from constants.ts',
109
+ });
110
+ }
111
+ }
112
+ const packGeneratedAt = manifest.generatedAt ? Date.parse(manifest.generatedAt) : Number.NaN;
113
+ const guidelineMtime = collectGuidelineMtimes(repoRoot, appDir);
114
+ if (Number.isFinite(packGeneratedAt) &&
115
+ guidelineMtime !== null &&
116
+ guidelineMtime > packGeneratedAt) {
117
+ findings.push({
118
+ severity: 'warning',
119
+ code: 'pack_stale_guidelines',
120
+ message: 'CMS guidelines changed after editor-pack was generated — regenerate editor pack',
121
+ });
122
+ }
123
+ const constantsPath = path.join(appDir, 'src', 'lib', 'constants.ts');
124
+ if (fs.existsSync(constantsPath)) {
125
+ const constantsMtime = fs.statSync(constantsPath).mtimeMs;
126
+ if (Number.isFinite(packGeneratedAt) && constantsMtime > packGeneratedAt) {
127
+ findings.push({
128
+ severity: 'warning',
129
+ code: 'pack_stale_constants',
130
+ message: 'constants.ts changed after editor-pack was generated — regenerate editor pack',
131
+ });
132
+ }
133
+ }
134
+ return findings;
135
+ }
136
+ //# sourceMappingURL=doctor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/project/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAWlE,SAAS,oBAAoB,CAAC,QAAgB,EAAE,UAAkB;IAChE,MAAM,UAAU,GAAG;QACjB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,CAAC;QACpE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,CAAC;QACxD,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,CAAC;QACpE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,CAAC;KACzD,CAAC;IACF,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;AAClE,CAAC;AAED,SAAS,eAAe,CAAC,MAAc;IACrC,MAAM,SAAS,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IACzC,OAAO,OAAO,CACZ,SAAS,CAAC,YAAY,IAAI,SAAS,CAAC,YAAY,IAAI,SAAS,CAAC,sBAAsB,KAAK,IAAI,CAC9F,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,KAAe;IAClC,IAAI,MAAM,GAAkB,IAAI,CAAC;IACjC,KAAK,M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gB;gBACtB,OAAO,EAAE,gFAAgF;aAC1F,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,MAAM,eAAe,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;IAC7F,MAAM,cAAc,GAAG,sBAAsB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAChE,IACE,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC;QAChC,cAAc,KAAK,IAAI;QACvB,cAAc,GAAG,eAAe,EAChC,CAAC;QACD,QAAQ,CAAC,IAAI,CAAC;YACZ,QAAQ,EAAE,SAAS;YACnB,IAAI,EAAE,uBAAuB;YAC7B,OAAO,EAAE,iFAAiF;SAC3F,CAAC,CAAC;IACL,CAAC;IAED,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;IACtE,IAAI,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QACjC,MAAM,cAAc,GAAG,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC;QAC1D,IAAI,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,cAAc,GAAG,eAAe,EAAE,CAAC;YACzE,QAAQ,CAAC,IAAI,CAAC;gBACZ,QAAQ,EAAE,SAAS;gBACnB,IAAI,EAAE,sBAAsB;gBAC5B,OAAO,EAAE,+EAA+E;aACzF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -10,7 +10,7 @@
10
10
 
11
11
  **CLI binary (`cms-edit`)** — invoked with subcommands and arguments from a terminal or shell script.
12
12
 
13
- **MCP server (`cms-edit-mcp`)** — exposes a single MCP tool `cms_edit` that accepts an array of CLI arguments and returns JSON output. Used by Claude (Desktop/Code) to call the tool as a native action.
13
+ **Hosted MCP server** — deployed per site at `/api/mcp` (OAuth). Exposes `cms_edit`, `cms_edit_help`, `cms_edit_customer`, guide/customer resources, and onboarding prompts. Local stdio MCP is not supported; IDE/terminal agents use the `cms-edit` CLI directly.
14
14
 
15
15
  ---
16
16
 
@@ -22,7 +22,7 @@ A project-level `.contentful-cms.json` file defines one or more Contentful space
22
22
  - `environment` — Contentful environment name (e.g., `master`)
23
23
  - `managementToken` — Contentful Management API token, expressed as an env var reference (e.g., `${CMS_EDIT_TOKEN_OM1}`)
24
24
  - `defaultLocale` — locale string (e.g., `en-US`)
25
- - `devBaseUrl` — local app URL used for screenshot capture
25
+ - `devBaseUrl` — local app URL for `preview url` and `preview showcase`
26
26
 
27
27
  A `defaultSpace` key selects the active space when none is specified. The `--space` flag overrides per invocation.
28
28
 
@@ -281,9 +281,9 @@ This boundary is enforced at two levels: the tool exposes no publish/unpublish/a
281
281
 
282
282
  ---
283
283
 
284
- ## 12. Screenshot Capture
284
+ ## 12. Preview URLs
285
285
 
286
- When `devBaseUrl` is configured, the tool can capture screenshots of components or pages by driving a headless browser against the local development server. Screenshots are written as PNG files to the local filesystem. This requires the app to be running at the configured URL.
286
+ When `devBaseUrl` is configured, `preview url` and `preview showcase` build URLs for pages and showcase renders. Visual verification is done via a browser MCP (e.g. Chrome DevTools), not built into cms-edit. CMS guidelines batch capture uses `cms-capture-screenshots` from `@se-studio/project-build` (separate tool, requires agent-browser).
287
287
 
288
288
  ---
289
289
 
@@ -142,7 +142,7 @@ const deliveryToken = key.accessToken; // CDA
142
142
 
143
143
  | Topic | Guidance |
144
144
  |-------|----------|
145
- | Permissions | PAT needs rights to read (and optionally create) space API keys; document in setup wizard |
145
+ | Permissions | PAT needs rights to read (and optionally create) space API keys; document in hosted/CLI setup guides |
146
146
  | Multiple keys | Never “first key in list” without environment/name filter |
147
147
  | Propagation | New keys may 401 for a few seconds after create — retry with backoff |
148
148
  | Secrets | Do not log `accessToken`; store only `cdaTokenHash` + `apiKeyId` in index `meta` |
package/docs/SKILLS.md CHANGED
@@ -5,7 +5,7 @@
5
5
  | Channel | Package | Install | Use case |
6
6
  |---------|---------|---------|----------|
7
7
  | **Full SE Studio skills** | `@se-studio/skills` | `npx skills add @se-studio/skills`, `pnpm skills:sync` in monorepo, or auto-sync via `prepare` in consumer sites (see `packages/project-build/README.md`) | Marketing sites, CMS guidelines, app tasks |
8
- | **Bundled cms-edit skills** | `@se-studio/contentful-cms` | `cms-edit skill install` | Minimal set shipped with the CLI (`core`, `templates`, `setup`) |
8
+ | **Bundled cms-edit skills** | `@se-studio/contentful-cms` | `cms-edit skill install` | Minimal set shipped with the CLI (`core`, `editor-tasks`, `templates`, `setup`) |
9
9
 
10
10
  ## Where to edit
11
11
 
@@ -24,6 +24,6 @@ Never edit:
24
24
  - **`.agents/skills/`** — Monorepo target for `pnpm skills:sync`; gitignored; symlinked to `.cursor/skills/`.
25
25
  - **`.claude/skills/`** — Optional per-machine path used by some Claude setups; **intentionally untracked**. Skills should come from this repo (`@se-studio/skills`, `cms-edit skill install`) or third-party skill packs — not from committed copies under `.claude/`.
26
26
 
27
- ## Setup wizard
27
+ ## Installing bundled skills
28
28
 
29
- `cms-edit-setup` can install bundled `core` and `templates` skills into `.agents/skills/` in the current project.
29
+ `cms-edit skill install` copies bundled `core`, `editor-tasks`, and `templates` skills into `.agents/skills/` in the current project. In the monorepo, prefer `pnpm skills:sync` from `@se-studio/skills`.
@@ -0,0 +1,62 @@
1
+ # cms-edit article-tags-from-json — Batch Article Tagging
2
+
3
+ `article-tags-from-json` sets the `tags` link array on one or more articles from a JSON file. Tag slugs are resolved via the local index — run `cms-edit index sync` first.
4
+
5
+ ```bash
6
+ cms-edit index sync
7
+ cms-edit article-tags-from-json --file tags.json --dry-run
8
+ cms-edit article-tags-from-json --file tags.json
9
+ ```
10
+
11
+ All writes create **drafts** only.
12
+
13
+ **Batch behaviour:** Processes every article in the file. Failures on one article do not stop the rest — the command exits non-zero if any item failed and prints which slugs succeeded vs failed.
14
+
15
+ ---
16
+
17
+ ## JSON schema
18
+
19
+ ```jsonc
20
+ {
21
+ "articles": [
22
+ {
23
+ "articleSlug": "resources/blog/my-post",
24
+ "tagSlugs": ["asco-2025", "oncology"],
25
+ "append": false
26
+ },
27
+ {
28
+ "articleSlug": "resources/blog/another-post",
29
+ "tagSlugs": ["press-release"],
30
+ "append": true
31
+ }
32
+ ]
33
+ }
34
+ ```
35
+
36
+ | Key | Required | Description |
37
+ |---|---|---|
38
+ | `articleSlug` | Yes | Article slug (with or without leading `/`) |
39
+ | `tagSlugs` | Yes | Tag slugs to apply |
40
+ | `append` | No | When `true`, append to existing tags (deduped). Default: replace |
41
+
42
+ ---
43
+
44
+ ## Session alternative (single article)
45
+
46
+ ```bash
47
+ cms-edit open --article-slug resources/blog/my-post
48
+ cms-edit set @p0 tags <id1>,<id2> --links
49
+ cms-edit diff && cms-edit save
50
+ ```
51
+
52
+ Resolve tag IDs: `cms-edit resolve --tag-slug <slug> --json`
53
+
54
+ ---
55
+
56
+ ## Related commands
57
+
58
+ | Command | Purpose |
59
+ |---|---|
60
+ | `cms-edit create tag` | Create a new tag |
61
+ | `cms-edit create taxonomy-from-json` | Bootstrap tagTypes and tags |
62
+ | `cms-edit help taxonomy-from-json` | Taxonomy batch import |
@@ -0,0 +1,80 @@
1
+ # cms-edit bulk-rtf-replace — Sitewide Rich Text Find-Replace
2
+
3
+ `bulk-rtf-replace` finds plain text in Rich Text fields across page and article entry trees (including linked components and collections) and replaces it in one pass.
4
+
5
+ ```bash
6
+ cms-edit bulk-rtf-replace --find "Old Company Name" --replace-plain "New Company Name" --dry-run
7
+ cms-edit bulk-rtf-replace --find "Old Company Name" --replace-plain "New Company Name"
8
+ ```
9
+
10
+ **Always dry-run first** and confirm the match count with the user before saving.
11
+
12
+ All saves create **drafts** only.
13
+
14
+ ---
15
+
16
+ ## How it works
17
+
18
+ 1. Fetches root entries (`page` and `article` by default) from Contentful
19
+ 2. For each root, loads the full linked entry tree
20
+ 3. Scans every Rich Text field on every entry in the tree
21
+ 4. Applies `replace-plain` (same engine as `cms-edit rtf replace`)
22
+ 5. Saves each modified entry as a draft
23
+
24
+ ---
25
+
26
+ ## Options
27
+
28
+ | Option | Description |
29
+ |---|---|
30
+ | `--find <text>` | Plain text to find (required) |
31
+ | `--replace-plain <text>` | Plain text replacement (required) |
32
+ | `--include <types>` | Root content types (default: `page,article`) |
33
+ | `--prefix <slug>` | Only roots whose slug starts with this prefix (e.g. `/blog`) |
34
+ | `--limit <n>` | Max root entries total across all `--include` types (default: 500) |
35
+ | `--dry-run` | Report matches without saving |
36
+
37
+ ---
38
+
39
+ ## Scoped replace
40
+
41
+ ```bash
42
+ # Blog articles only
43
+ cms-edit bulk-rtf-replace \
44
+ --find "2024" \
45
+ --replace-plain "2025" \
46
+ --include article \
47
+ --prefix resources/blog \
48
+ --dry-run
49
+ ```
50
+
51
+ ---
52
+
53
+ ## JSON output
54
+
55
+ ```bash
56
+ CMS_EDIT_JSON=1 cms-edit bulk-rtf-replace --find "foo" --replace-plain "bar" --dry-run
57
+ ```
58
+
59
+ Dry-run response includes `entriesWithMatches`, `matches`, and per-entry `changes`.
60
+
61
+ ---
62
+
63
+ ## When to use sessions instead
64
+
65
+ For a **small** number of entries, or when you need `diff` review per page:
66
+
67
+ ```bash
68
+ cms-edit open --page-slug /about
69
+ cms-edit rtf replace @c1 body --find "…" --replace-plain "…"
70
+ cms-edit diff && cms-edit save
71
+ ```
72
+
73
+ For **scalar** fields on many entries, prefer `cms-edit batch set`.
74
+
75
+ ---
76
+
77
+ ## Related resources
78
+
79
+ - Editor task: `task-bulk-find-replace` (confirmation gates)
80
+ - `cms-edit search <text>` — discover affected entries before bulk replace
@@ -19,6 +19,9 @@ Available topics for `cms-edit help <topic>`:
19
19
  | `workflow` | Standard editing workflow — open, snapshot, edit, save |
20
20
  | `create-from-json` | Create a new page or article from a JSON file (single-shot) |
21
21
  | `taxonomy-from-json` | Batch-create tagType, articleType, and tag entries from JSON |
22
+ | `person-from-json` | Batch-create person/author entries from JSON |
23
+ | `article-tags-from-json` | Set tags on multiple articles from JSON |
24
+ | `bulk-rtf-replace` | Find-replace plain text across Rich Text fields in entry trees |
22
25
  | `run` | Execute a batch of operations from a JSON file |
23
26
  | `batch` | Edit multiple entries by Contentful entry ID, then save once |
24
27
  | `fields` | Overview of all content types |
@@ -56,6 +59,15 @@ cms-edit create from-json --file my-page.json --dry-run
56
59
  # Bootstrap taxonomy for import scripts
57
60
  cms-edit create taxonomy-from-json --file taxonomy.json --if-not-exists
58
61
 
62
+ # Import authors from JSON
63
+ cms-edit create person-from-json --file authors.json --if-not-exists
64
+
65
+ # Bulk retag articles
66
+ cms-edit article-tags-from-json --file tags.json
67
+
68
+ # Sitewide rich-text find-replace (dry-run first)
69
+ cms-edit bulk-rtf-replace --find "Old" --replace-plain "New" --dry-run
70
+
59
71
  # Run a batch of edits
60
72
  cms-edit run --file patch.json
61
73
  ```
@@ -110,6 +122,10 @@ cms-edit run --file patch.json
110
122
  |---|---|
111
123
  | `create from-json` | Create a page/article from a JSON file |
112
124
  | `create taxonomy-from-json` | Batch-create tagType, articleType, and tag entries |
125
+ | `create person-from-json` | Batch-create person entries from JSON |
126
+ | `create person` | Create a person entry (draft) |
127
+ | `article-tags-from-json` | Set tags on articles from JSON |
128
+ | `bulk-rtf-replace` | Find-replace in Rich Text across entry trees |
113
129
  | `create tag-type` | Create a tagType entry (draft) |
114
130
  | `create article-type` | Create an articleType entry (draft) |
115
131
  | `create tag` | Create a tag entry (draft) |
@@ -126,10 +142,10 @@ cms-edit run --file patch.json
126
142
  |---|---|
127
143
  | `backup` | Snapshot Contentful state |
128
144
  | `audit` | Audit content issues (images, alt-text, orphaned) |
129
- | `screenshot` | Capture a page screenshot |
145
+ | `preview url` | Generate a page preview URL |
146
+ | `preview showcase` | Generate a component/collection showcase URL |
130
147
  | `preview` | Generate preview URLs |
131
148
  | `skill` | Manage installed skills |
132
- | `setup` | Configure Claude Desktop with your credentials |
133
149
 
134
150
  ---
135
151
 
@@ -0,0 +1,82 @@
1
+ # cms-edit create person-from-json — Batch Author Import
2
+
3
+ `create person-from-json` creates multiple `person` entries from a single JSON file. Use it for spreadsheet-to-CMS author imports and team directory bootstraps.
4
+
5
+ ```bash
6
+ cms-edit create person-from-json --file authors.json --dry-run
7
+ cms-edit create person-from-json --file authors.json --if-not-exists
8
+ ```
9
+
10
+ All entries are created as **drafts**. Nothing is published automatically.
11
+
12
+ **Not transactional:** If the command fails partway through, entries created earlier remain in the space. Re-run with `--if-not-exists` to continue idempotently.
13
+
14
+ ---
15
+
16
+ ## JSON schema
17
+
18
+ ```jsonc
19
+ {
20
+ "persons": [
21
+ {
22
+ "slug": "jane-smith",
23
+ "name": "Jane Smith",
24
+ "jobTitle": "Chief Medical Officer",
25
+ "description": "Short card blurb",
26
+ "emailAddress": "jane@example.com",
27
+ "phoneNumber": "+1 555 0100",
28
+ "bioMarkdown": "## Bio\n\nMarkdown converted to Rich Text.",
29
+ "fields": {
30
+ "location": "Boston"
31
+ }
32
+ }
33
+ ]
34
+ }
35
+ ```
36
+
37
+ | Key | Required | Description |
38
+ |---|---|---|
39
+ | `slug` | Yes | URL slug |
40
+ | `name` | Yes | Display name |
41
+ | `cmsLabel` | No | CMS label (defaults to `name`) |
42
+ | `jobTitle` | No | Job title (CLI flags override JSON `fields` on single-entry create) |
43
+ | `description` | No | Short description |
44
+ | `emailAddress` | No | Email |
45
+ | `phoneNumber` | No | Phone |
46
+ | `bioMarkdown` | No | Bio as Markdown (converted to Rich Text `bio` field) |
47
+ | `fields` | No | Additional Contentful field values |
48
+
49
+ You can also pass a full Rich Text document on `bio` inside `fields` instead of `bioMarkdown`.
50
+
51
+ ---
52
+
53
+ ## Single-entry alternative
54
+
55
+ ```bash
56
+ cms-edit create person --slug jane-smith --name "Jane Smith" --job-title "CMO" --bio-file bio.md
57
+ cms-edit ensure person --slug jane-smith --name "Jane Smith"
58
+ ```
59
+
60
+ ---
61
+
62
+ ## Link authors to articles
63
+
64
+ After import, link person IDs to articles in a session:
65
+
66
+ ```bash
67
+ cms-edit open --article-slug blog/my-post
68
+ cms-edit set @p0 authors <personId1>,<personId2> --links
69
+ cms-edit diff && cms-edit save
70
+ ```
71
+
72
+ Or batch-link in a `cms-edit run` ops file.
73
+
74
+ ---
75
+
76
+ ## Related commands
77
+
78
+ | Command | Purpose |
79
+ |---|---|
80
+ | `cms-edit create person` | Create one person |
81
+ | `cms-edit ensure person` | Idempotent single create |
82
+ | `cms-edit help fields` | Field overview |