@se-studio/contentful-cms 2.2.3 → 2.4.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 (50) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/INSTALL.md +1 -1
  3. package/README.md +12 -14
  4. package/dist/audit/media-review-rules.d.ts +33 -0
  5. package/dist/audit/media-review-rules.d.ts.map +1 -0
  6. package/dist/audit/media-review-rules.js +117 -0
  7. package/dist/audit/media-review-rules.js.map +1 -0
  8. package/dist/audit/media-review.d.ts +39 -0
  9. package/dist/audit/media-review.d.ts.map +1 -0
  10. package/dist/audit/media-review.js +69 -0
  11. package/dist/audit/media-review.js.map +1 -0
  12. package/dist/cli/program.d.ts.map +1 -1
  13. package/dist/cli/program.js +1 -3
  14. package/dist/cli/program.js.map +1 -1
  15. package/dist/commands/asset.d.ts.map +1 -1
  16. package/dist/commands/asset.js +79 -0
  17. package/dist/commands/asset.js.map +1 -1
  18. package/dist/commands/health.d.ts.map +1 -1
  19. package/dist/commands/health.js +2 -22
  20. package/dist/commands/health.js.map +1 -1
  21. package/dist/commands/help.js +1 -1
  22. package/dist/commands/help.js.map +1 -1
  23. package/dist/commands/preview.d.ts.map +1 -1
  24. package/dist/commands/preview.js +63 -16
  25. package/dist/commands/preview.js.map +1 -1
  26. package/dist/config/types.d.ts +3 -3
  27. package/dist/config/types.d.ts.map +1 -1
  28. package/dist/generated/version.d.ts +1 -1
  29. package/dist/generated/version.js +1 -1
  30. package/dist/index/query.d.ts +18 -0
  31. package/dist/index/query.d.ts.map +1 -1
  32. package/dist/index/query.js +37 -0
  33. package/dist/index/query.js.map +1 -1
  34. package/dist/mcp/tools/cms-edit.d.ts +1 -1
  35. package/dist/mcp/tools/cms-edit.d.ts.map +1 -1
  36. package/dist/mcp/tools/cms-edit.js +4 -0
  37. package/dist/mcp/tools/cms-edit.js.map +1 -1
  38. package/dist/preview/capture-urls.d.ts +12 -0
  39. package/dist/preview/capture-urls.d.ts.map +1 -0
  40. package/dist/preview/capture-urls.js +41 -0
  41. package/dist/preview/capture-urls.js.map +1 -0
  42. package/docs/FUNCTIONAL_SPEC.md +3 -3
  43. package/docs/help/asset-review.md +50 -0
  44. package/docs/help/index.md +3 -3
  45. package/package.json +1 -1
  46. package/skills/core/SKILL.md +13 -78
  47. package/dist/commands/screenshot.d.ts +0 -4
  48. package/dist/commands/screenshot.d.ts.map +0 -1
  49. package/dist/commands/screenshot.js +0 -275
  50. package/dist/commands/screenshot.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,o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,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,E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QACzB,CAAC;IACH,CAAC;IACD,OAAO,GAAG,OAAO,wBAAwB,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;AAC/D,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,mBAAmB,CACjC,GAAW,EACX,aAAiD;IAEjD,IAAI,CAAC,aAAa,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC;IAC1E,MAAM,SAAS,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IAChD,MAAM,KAAK,GAAG,IAAI,eAAe,CAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC5D,OAAO,GAAG,GAAG,GAAG,SAAS,GAAG,KAAK,EAAE,CAAC;AACtC,CAAC"}
@@ -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
 
@@ -0,0 +1,50 @@
1
+ # Asset review
2
+
3
+ `cms-edit asset review` audits visual assets (images, videos, Lottie JSON) from the local index.
4
+
5
+ ## Sync first
6
+
7
+ ```bash
8
+ cms-edit index sync
9
+ ```
10
+
11
+ Default: **Preview API** (includes drafts). Use `--published` on sync/review for delivery-only content.
12
+
13
+ ## Run
14
+
15
+ ```bash
16
+ cms-edit asset review
17
+ cms-edit --json asset review --space brightline > media-review.json
18
+ ```
19
+
20
+ ## Checks
21
+
22
+ - Filename quality (stock IDs, camera defaults, generic names)
23
+ - Alt text (`description` on asset)
24
+ - Dimensions (max width, default 2000px; SVG/Lottie skipped)
25
+ - File size (defaults: 800 KB images, 8 MB video, 400 KB Lottie)
26
+ - Animated GIF (`image/gif`)
27
+ - No media wrapper (warning — may still be used in rich text)
28
+
29
+ ## Options
30
+
31
+ | Flag | Default |
32
+ |------|---------|
33
+ | `--max-width` | 2000 |
34
+ | `--max-image-kb` | 800 |
35
+ | `--max-video-mb` | 8 |
36
+ | `--max-lottie-kb` | 400 |
37
+ | `--include-passing` | off (failures only) |
38
+ | `--published` | off (Preview index) |
39
+
40
+ Exit code **1** when any asset has failing issues.
41
+
42
+ ## Spreadsheet
43
+
44
+ Use the **contentful-cms-media-review** skill with `--json` output to build an Excel workbook.
45
+
46
+ ## Fix alt text
47
+
48
+ ```bash
49
+ cms-edit asset set-description <asset-id> "Descriptive alt text"
50
+ ```
@@ -28,6 +28,7 @@ Available topics for `cms-edit help <topic>`:
28
28
  | `fields-collection` | All fields on a `collection` entry |
29
29
  | `fields-taxonomy` | All fields on `tagType`, `articleType`, and `tag` entries |
30
30
  | `index-sync` | Build and use the local content index (CDA sync) |
31
+ | `asset-review` | Visual asset quality review (filename, alt, size, dimensions) |
31
32
  | `lookup` | Flat flags for `open`, `resolve`, and `nav open` |
32
33
 
33
34
  ---
@@ -55,8 +56,6 @@ cms-edit create from-json --file my-page.json --dry-run
55
56
  # Bootstrap taxonomy for import scripts
56
57
  cms-edit create taxonomy-from-json --file taxonomy.json --if-not-exists
57
58
 
58
- Asset/media search: run `cms-edit index sync` first — see [index-sync.md](./index-sync.md).
59
-
60
59
  # Run a batch of edits
61
60
  cms-edit run --file patch.json
62
61
  ```
@@ -127,7 +126,8 @@ cms-edit run --file patch.json
127
126
  |---|---|
128
127
  | `backup` | Snapshot Contentful state |
129
128
  | `audit` | Audit content issues (images, alt-text, orphaned) |
130
- | `screenshot` | Capture a page screenshot |
129
+ | `preview url` | Generate a page preview URL |
130
+ | `preview showcase` | Generate a component/collection showcase URL |
131
131
  | `preview` | Generate preview URLs |
132
132
  | `skill` | Manage installed skills |
133
133
  | `setup` | Configure Claude Desktop with your credentials |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@se-studio/contentful-cms",
3
- "version": "2.2.3",
3
+ "version": "2.4.0",
4
4
  "description": "CLI tool for AI agents to read and edit Contentful draft content without publish permissions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -576,13 +576,12 @@ cms-edit move @c3 --after @c1 # move section 3 to position 2
576
576
  cms-edit save
577
577
  ```
578
578
 
579
- ## Screenshots
579
+ ## Visual checks
580
580
 
581
- The `screenshot` command captures a PNG of a component, collection, external component, person, or page using [agent-browser](https://github.com/vercel-labs/agent-browser).
581
+ cms-edit does not capture screenshots. Use preview URL commands, then open the URL with a browser MCP (e.g. Chrome DevTools) to verify layout after edits.
582
582
 
583
- **Prerequisites:** `npm install -g agent-browser && agent-browser install`. For `@ref` and `--json-file`, the app must be running at `devBaseUrl`.
583
+ **Config:** Add `devBaseUrl` to the space in `.contentful-cms.json`:
584
584
 
585
- **Config:** Add `devBaseUrl` to the space in `.contentful-cms.json` so the CLI knows where your dev server runs:
586
585
  ```json
587
586
  {
588
587
  "spaces": {
@@ -592,83 +591,19 @@ The `screenshot` command captures a PNG of a component, collection, external com
592
591
  }
593
592
  }
594
593
  ```
595
- If omitted, defaults to `http://localhost:3000` with a warning.
596
-
597
- ### From session ref (full-fidelity)
598
-
599
- `cms-edit screenshot @c0` uses the app's convert API and `/cms/preview/render-json` so **all** entry types render with real converted data: component, collection, externalComponent, person. No separate "mock vs live" for refs.
600
594
 
601
595
  ```bash
602
- # Any entry type (component, collection, externalComponent, person)
603
- cms-edit screenshot @c0
604
-
605
- # Full-page capture (auto-applied for component/collection)
606
- cms-edit screenshot @c0 --full
607
-
608
- # Just print URL
609
- cms-edit screenshot @c0 --url-only
610
- ```
611
-
612
- ### From JSON file (no Contentful)
613
-
614
- Screenshot an IBase* JSON file (e.g. exported from `cms-edit read @c0 --json` or a fixture). App must be running.
615
-
616
- ```bash
617
- cms-edit screenshot --json-file path/to/component.json
618
- ```
619
-
620
- ### By type (showcase mock, no session)
621
-
622
- Uses `/cms/showcase/render` with mock data. Fast, no preview token.
623
-
624
- ```bash
625
- cms-edit screenshot --component HeroSimple
626
- cms-edit screenshot --collection CardGrid
627
- cms-edit screenshot @c0 --embedded --full # when using ref with showcase-style capture
628
- ```
629
-
630
- ### Page screenshots
631
-
632
- ```bash
633
- # Current open page (uses session root slug)
634
- cms-edit screenshot
596
+ # Page (explicit slug or open session root)
597
+ cms-edit preview url /pricing
598
+ cms-edit open --page-slug /pricing
599
+ cms-edit preview url
635
600
 
636
- # Explicit page slug
637
- cms-edit screenshot /pricing
638
- cms-edit screenshot /about-us --full
601
+ # Component or collection showcase (mock data)
602
+ cms-edit preview showcase --component HeroSimple
603
+ cms-edit preview showcase --collection CardGrid --param backgroundColour=Navy
639
604
  ```
640
605
 
641
- ### Options
642
-
643
- | Flag | Description |
644
- |------|-------------|
645
- | `--json-file <path>` | Read IBase* JSON from file and screenshot via render-json (no Contentful) |
646
- | `--live` | Legacy: use `/cms/preview/render?id=...` for ref (optional; @ref is already full-fidelity) |
647
- | `--out <path>` | Output file path (default: `./screenshot-<type>-<timestamp>.png`) |
648
- | `--full` | Full-page capture (passed to `agent-browser screenshot --full`) |
649
- | `--embedded` | Append `&embedded=true` to showcase URL (suppresses IframeHeightReporter) |
650
- | `--wait <ms>` | Wait milliseconds after page load before capturing (default: 500) |
651
- | `--url-only` | Print URL only, do not invoke agent-browser |
652
- | `--json` | Output `{ ok, url, file }` as JSON |
653
-
654
- ### Visual diffing
655
-
656
- Use `agent-browser diff screenshot` to compare before/after a content change:
657
-
658
- ```bash
659
- # 1. Capture baseline before editing
660
- cms-edit screenshot @c0 --out before.png
661
-
662
- # 2. Edit content
663
- cms-edit set @c0 heading "New heading"
664
- cms-edit save
665
-
666
- # 3. Capture after
667
- cms-edit screenshot @c0 --out after.png
668
-
669
- # 4. Diff
670
- agent-browser diff screenshot --baseline before.png after.png
671
- ```
606
+ For CMS guidelines batch PNG capture, use `cms-capture-screenshots` from `@se-studio/project-build` (separate from cms-edit; requires agent-browser).
672
607
 
673
608
  ## Revert
674
609
 
@@ -687,7 +622,7 @@ Note: Entries created via `add` cannot be reverted — use `remove` instead.
687
622
  Validate config and connectivity before running a workflow.
688
623
 
689
624
  ```bash
690
- cms-edit health # Check config file, space config, Contentful connectivity, agent-browser
625
+ cms-edit health # Check config file, space config, Contentful connectivity
691
626
  ```
692
627
 
693
628
  ## Schema Inspection
@@ -906,4 +841,4 @@ cms-edit --session agent-2 open --article-slug /blog
906
841
 
907
842
  ## Related skills
908
843
 
909
- For templates see the **templates** skill; for navigation see the **navigation** skill; for rich text and embeds see the **rich-text** skill; for screenshots see the **screenshots** skill.
844
+ For templates see the **templates** skill; for navigation see the **navigation** skill; for rich text and embeds see the **rich-text** skill.
@@ -1,4 +0,0 @@
1
- /** biome-ignore-all lint/suspicious/noConsole: Console output is intentional in CLI */
2
- import type { Command } from 'commander';
3
- export declare function registerScreenshotCommand(program: Command): void;
4
- //# sourceMappingURL=screenshot.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../src/commands/screenshot.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAKvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0DzC,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyShE"}