@se-studio/contentful-cms 2.8.1 → 3.0.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.
- package/CHANGELOG.md +14 -0
- package/dist/cli/read-json-input.d.ts +27 -0
- package/dist/cli/read-json-input.d.ts.map +1 -0
- package/dist/cli/read-json-input.js +65 -0
- package/dist/cli/read-json-input.js.map +1 -0
- package/dist/commands/article-tags-from-json.d.ts.map +1 -1
- package/dist/commands/article-tags-from-json.js +12 -11
- package/dist/commands/article-tags-from-json.js.map +1 -1
- package/dist/commands/asset.d.ts.map +1 -1
- package/dist/commands/asset.js +9 -27
- package/dist/commands/asset.js.map +1 -1
- package/dist/commands/create-from-json.d.ts.map +1 -1
- package/dist/commands/create-from-json.js +12 -22
- package/dist/commands/create-from-json.js.map +1 -1
- package/dist/commands/create-person-from-json.d.ts.map +1 -1
- package/dist/commands/create-person-from-json.js +12 -11
- package/dist/commands/create-person-from-json.js.map +1 -1
- package/dist/commands/create-person.d.ts.map +1 -1
- package/dist/commands/create-person.js +28 -8
- package/dist/commands/create-person.js.map +1 -1
- package/dist/commands/create-taxonomy-from-json.d.ts.map +1 -1
- package/dist/commands/create-taxonomy-from-json.js +13 -12
- package/dist/commands/create-taxonomy-from-json.js.map +1 -1
- package/dist/commands/create-taxonomy.d.ts +2 -1
- package/dist/commands/create-taxonomy.d.ts.map +1 -1
- package/dist/commands/create-taxonomy.js +17 -15
- package/dist/commands/create-taxonomy.js.map +1 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +16 -3
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/preview.d.ts.map +1 -1
- package/dist/commands/preview.js +35 -0
- package/dist/commands/preview.js.map +1 -1
- package/dist/commands/rtf.d.ts.map +1 -1
- package/dist/commands/rtf.js +23 -30
- package/dist/commands/rtf.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +13 -20
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/save.d.ts.map +1 -1
- package/dist/commands/save.js +2 -4
- package/dist/commands/save.js.map +1 -1
- package/dist/commands/set.d.ts +1 -0
- package/dist/commands/set.d.ts.map +1 -1
- package/dist/commands/set.js +68 -44
- package/dist/commands/set.js.map +1 -1
- package/dist/config/hosted.d.ts.map +1 -1
- package/dist/config/hosted.js +1 -0
- package/dist/config/hosted.js.map +1 -1
- package/dist/contentful/entry-fields.d.ts.map +1 -1
- package/dist/contentful/entry-fields.js +0 -3
- package/dist/contentful/entry-fields.js.map +1 -1
- package/dist/contentful/person-create.d.ts +2 -1
- package/dist/contentful/person-create.d.ts.map +1 -1
- package/dist/contentful/person-create.js +1 -10
- package/dist/contentful/person-create.js.map +1 -1
- package/dist/contentful/set-field-schema.d.ts +1 -1
- package/dist/contentful/set-field-schema.js +2 -2
- package/dist/contentful/set-field-schema.js.map +1 -1
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/mcp/prompts/onboarding.d.ts.map +1 -1
- package/dist/mcp/prompts/onboarding.js +10 -10
- package/dist/mcp/prompts/onboarding.js.map +1 -1
- package/dist/mcp/tools/cms-edit.d.ts +1 -1
- package/dist/mcp/tools/cms-edit.d.ts.map +1 -1
- package/dist/mcp/tools/cms-edit.js +6 -2
- package/dist/mcp/tools/cms-edit.js.map +1 -1
- package/dist/rtf/resolveRtfInput.d.ts +3 -3
- package/dist/rtf/resolveRtfInput.d.ts.map +1 -1
- package/dist/rtf/resolveRtfInput.js +5 -16
- package/dist/rtf/resolveRtfInput.js.map +1 -1
- package/docs/editor-tasks/article-tags.md +2 -2
- package/docs/editor-tasks/authors-import.md +2 -2
- package/docs/editor-tasks/create-article.md +1 -1
- package/docs/editor-tasks/create-from-document.md +1 -1
- package/docs/editor-tasks/create-page.md +5 -1
- package/docs/editor-tasks/featured-images.md +1 -1
- package/docs/editor-tasks/media-reuse-and-upload.md +1 -1
- package/docs/editor-tasks/preview-verify.md +1 -1
- package/docs/editor-tasks/taxonomy.md +1 -1
- package/docs/help/article-tags-from-json.md +2 -2
- package/docs/help/batch-run.md +6 -6
- package/docs/help/create-from-json.md +11 -11
- package/docs/help/fields-component.md +1 -1
- package/docs/help/index.md +8 -8
- package/docs/help/person-from-json.md +2 -2
- package/docs/help/taxonomy-from-json.md +4 -4
- package/docs/help/workflow.md +1 -1
- package/package.json +1 -1
- package/skills/core/SKILL.md +10 -10
|
@@ -175,7 +175,7 @@ export function registerOnboardingPrompts(server, hosted) {
|
|
|
175
175
|
'3. cms_edit ["list", "--type", "articleType"] — confirm article type slug/name\n' +
|
|
176
176
|
'4. Ask if the user has a custom featured image; if not, apply defaults.md rules (articleType → site default)\n' +
|
|
177
177
|
'5. Build create-from-json payload (type article, articleTypeSlug or articleTypeId, components from articles playbook)\n' +
|
|
178
|
-
'6. cms_edit ["create", "from-json", "--
|
|
178
|
+
'6. cms_edit ["create", "from-json", "--json", "<compact-json>", "--dry-run", "--strict"] (or --json-base64 for large payloads)\n' +
|
|
179
179
|
'7. On approval, create and save draft\n' +
|
|
180
180
|
`8. ${PREVIEW_AFTER_SAVE}` +
|
|
181
181
|
'9. Remind user: publish in Contentful UI when ready (cms-edit never publishes)',
|
|
@@ -185,14 +185,14 @@ export function registerOnboardingPrompts(server, hosted) {
|
|
|
185
185
|
};
|
|
186
186
|
});
|
|
187
187
|
server.prompt('cms_edit_taxonomy', desc('Set up taxonomy: import tag types, article types, and tags idempotently.'), {
|
|
188
|
-
|
|
188
|
+
taxonomyJson: z
|
|
189
189
|
.string()
|
|
190
190
|
.optional()
|
|
191
|
-
.describe('
|
|
192
|
-
}, async ({
|
|
193
|
-
const importStep =
|
|
194
|
-
? `2. cms_edit ["create", "taxonomy-from-json", "--
|
|
195
|
-
: '2. Use cms_edit ["create", "tag-type", ..., "--if-not-exists"] — or taxonomy-from-json\n';
|
|
191
|
+
.describe('Inline taxonomy batch JSON (if omitted, ask user or use create --if-not-exists)'),
|
|
192
|
+
}, async ({ taxonomyJson }) => {
|
|
193
|
+
const importStep = taxonomyJson
|
|
194
|
+
? `2. cms_edit ["create", "taxonomy-from-json", "--json", ${JSON.stringify(taxonomyJson)}, "--if-not-exists"]\n`
|
|
195
|
+
: '2. Use cms_edit ["create", "tag-type", ..., "--if-not-exists"] — or taxonomy-from-json with --json\n';
|
|
196
196
|
return {
|
|
197
197
|
messages: [
|
|
198
198
|
{
|
|
@@ -235,7 +235,7 @@ export function registerOnboardingPrompts(server, hosted) {
|
|
|
235
235
|
'1. cms_edit ["customer", "task-create-from-document"]; overview, routing, pages (if present), components-index\n' +
|
|
236
236
|
'2. Infer page structure: map sections to component types using components-index\n' +
|
|
237
237
|
'3. Propose a plain-English page plan (slug, title, template, components) — ask user to confirm\n' +
|
|
238
|
-
'4. Build create-from-json payload; run cms_edit ["create", "from-json", "--
|
|
238
|
+
'4. Build create-from-json payload; run cms_edit ["create", "from-json", "--json", "<compact-json>", "--dry-run", "--strict"]\n' +
|
|
239
239
|
'5. On approval, create and save draft\n' +
|
|
240
240
|
`6. ${PREVIEW_AFTER_SAVE}` +
|
|
241
241
|
'7. Remind user to publish in Contentful UI when satisfied',
|
|
@@ -344,7 +344,7 @@ export function registerOnboardingPrompts(server, hosted) {
|
|
|
344
344
|
'Update article tags:\n' +
|
|
345
345
|
'1. cms_edit ["customer", "task-article-tags"]\n' +
|
|
346
346
|
'2. cms_edit ["index", "sync"] — refresh tag catalog\n' +
|
|
347
|
-
'3. Batch: article-tags-from-json --
|
|
347
|
+
'3. Batch: cms_edit ["article-tags-from-json", "--json", "<tags-json>", "--dry-run"] → user confirms → apply\n' +
|
|
348
348
|
'4. Or per article: open --article-slug → set @p0 tags id1,id2 --links (or --append) → diff → save\n' +
|
|
349
349
|
'5. Confirm tag list with user before saving',
|
|
350
350
|
},
|
|
@@ -365,7 +365,7 @@ export function registerOnboardingPrompts(server, hosted) {
|
|
|
365
365
|
'Create authors (person entries):\n' +
|
|
366
366
|
'1. cms_edit ["customer", "task-authors-import"]\n' +
|
|
367
367
|
'2. cms_edit ["customer", "routing"] — people URL base if configured\n' +
|
|
368
|
-
'3. Batch: create person-from-json --
|
|
368
|
+
'3. Batch: cms_edit ["create", "person-from-json", "--json", "<authors-json>", "--dry-run"] → user confirms → --if-not-exists\n' +
|
|
369
369
|
'4. Or single: create person --slug … --name … --job-title … --bio-markdown …\n' +
|
|
370
370
|
'5. Link to articles with set @p0 authors <ids> --links if requested',
|
|
371
371
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onboarding.js","sourceRoot":"","sources":["../../../src/mcp/prompts/onboarding.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEpE,MAAM,cAAc,GAClB,6EAA6E;IAC7E,gFAAgF,CAAC;AAEnF,MAAM,kBAAkB,GACtB,gFAAgF;IAChF,kFAAkF;IAClF,uEAAuE;IACvE,4BAA4B,CAAC;AAE/B,SAAS,UAAU,CAAC,MAAsB;IACxC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,6DAA6D,CAAC;IACvE,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,UAAU,CAAC;IACzD,OAAO,CACL,yBAAyB,QAAQ,2CAA2C;QAC5E,0DAA0D,CAC3D,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,MAAiB,EAAE,MAAsB;IACjF,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IAChC,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAEzE,MAAM,CAAC,MAAM,CACX,iBAAiB,EACjB,IAAI,CAAC,oEAAoE,CAAC,EAC1E,KAAK,IAAI,EAAE,CAAC,CAAC;QACX,QAAQ,EAAE;YACR;gBACE,IAAI,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ACF;KACF,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,MAAM,CACX,gBAAgB,EAChB,IAAI,CAAC,iEAAiE,CAAC,EACvE;QACE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wDAAwD,CAAC;KAC3F,EACD,KAAK,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;QAC1B,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAe;gBACrB,OAAO,EAAE;oBACP,IAAI,EAAE,MAAe;oBACrB,IAAI,EACF,GAAG,IAAI,OAAO,cAAc,eAAe,WAAW,IAAI;wBAC1D,6BAA6B;wBAC7B,2DAA2D;wBAC3D,iCAAiC;wBACjC,gEAAgE;wBAChE,6DAA6D;wBAC7D,oDAAoD;iBACvD;aACF;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import type { HostedMcpInfo } from '../guide.js';
|
|
3
3
|
import type { RunCmsEditFn } from '../types.js';
|
|
4
|
-
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 [\"list\", \"--type\", \"article\", \"--sort\", \"date\"] \u2014 list articles (preview index includes drafts)\n [\"peek\", \"--article-slug\", \"<slug>\"] \u2014 preview draft or published article (CMA)\n [\"preview\", \"url\", \"/pricing\"] \u2014 staging page URL (open in browser MCP)\n [\"preview\", \"urls\", \"/pricing\"] \u2014 all preview targets (staging, production, site live preview, Contentful)\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 --
|
|
4
|
+
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 [\"list\", \"--type\", \"article\", \"--sort\", \"date\"] \u2014 list articles (preview index includes drafts)\n [\"peek\", \"--article-slug\", \"<slug>\"] \u2014 preview draft or published article (CMA)\n [\"preview\", \"url\", \"/pricing\"] \u2014 staging page URL (open in browser MCP)\n [\"preview\", \"urls\", \"/pricing\"] \u2014 all preview targets (staging, production, site live preview, Contentful)\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\nJSON bulk input (create from-json, batch run, taxonomy/person/article-tags imports, set object fields, rtf patch):\n --json \"<string>\" inline JSON (small payloads)\n --json-base64 \"<b64>\" base64-encoded JSON (large payloads)\n\nAsset upload (hosted MCP): --url <https> or --base64 with --mime and --file-name";
|
|
5
5
|
export declare function registerCmsEditTools(server: McpServer, runCmsEdit: RunCmsEditFn, hosted?: HostedMcpInfo): void;
|
|
6
6
|
export declare function getMcpServerInfo(hosted?: HostedMcpInfo): {
|
|
7
7
|
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;AAIzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAOjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,gBAAgB,
|
|
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;AAIzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAOjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,gBAAgB,krMAsEoD,CAAC;AAElF,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,SAAS,EACjB,UAAU,EAAE,YAAY,EACxB,MAAM,CAAC,EAAE,aAAa,GACrB,IAAI,CAsCN;AAED,wBAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAE1F"}
|
|
@@ -68,8 +68,12 @@ Output is always JSON (CMS_EDIT_JSON=1 is forced by the MCP server).
|
|
|
68
68
|
Rich text tips:
|
|
69
69
|
--content "<markdown>" preferred named flag for inline content (any length)
|
|
70
70
|
--base64 "<encoded>" fully environment-agnostic, no filesystem needed
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
|
|
72
|
+
JSON bulk input (create from-json, batch run, taxonomy/person/article-tags imports, set object fields, rtf patch):
|
|
73
|
+
--json "<string>" inline JSON (small payloads)
|
|
74
|
+
--json-base64 "<b64>" base64-encoded JSON (large payloads)
|
|
75
|
+
|
|
76
|
+
Asset upload (hosted MCP): --url <https> or --base64 with --mime and --file-name`;
|
|
73
77
|
export function registerCmsEditTools(server, runCmsEdit, hosted) {
|
|
74
78
|
server.tool('cms_edit_version', prefixHostedToolDescription('Return the installed cms-edit package version and site identity (projectKey, displayName, spaceId on hosted). No session or Contentful credentials required.', hosted), {}, async () => {
|
|
75
79
|
const info = getVersionInfo();
|
|
@@ -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;AAEpE,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,MAAM,CAAC,MAAM,gBAAgB,GAAG
|
|
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;AAEpE,OA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;IACxD,CAAC,CACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAsB;IACrD,OAAO,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC7E,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { RtfInputFormat } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Resolves raw string input for `cms-edit rtf` from CLI arguments (any format).
|
|
4
|
-
* Precedence: `--base64` → `--content` →
|
|
4
|
+
* Precedence: `--base64` → `--content` → positional arg.
|
|
5
5
|
*/
|
|
6
|
-
export declare function resolveRtfInput(_format: RtfInputFormat, inputArg: string | undefined,
|
|
6
|
+
export declare function resolveRtfInput(_format: RtfInputFormat, inputArg: string | undefined, content?: string, base64?: string): Promise<string>;
|
|
7
7
|
/**
|
|
8
8
|
* @deprecated Use {@link resolveRtfInput} with format `'markdown'`.
|
|
9
9
|
*/
|
|
10
|
-
export declare function resolveMarkdownInput(markdownArg: string | undefined,
|
|
10
|
+
export declare function resolveMarkdownInput(markdownArg: string | undefined, content?: string, base64?: string): Promise<string>;
|
|
11
11
|
//# sourceMappingURL=resolveRtfInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveRtfInput.d.ts","sourceRoot":"","sources":["../../src/rtf/resolveRtfInput.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolveRtfInput.d.ts","sourceRoot":"","sources":["../../src/rtf/resolveRtfInput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;;GAGG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,cAAc,EACvB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,OAAO,CAAC,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CAWjB;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,OAAO,CAAC,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CAEjB"}
|
|
@@ -1,34 +1,23 @@
|
|
|
1
|
-
import * as fs from 'node:fs';
|
|
2
1
|
/**
|
|
3
2
|
* Resolves raw string input for `cms-edit rtf` from CLI arguments (any format).
|
|
4
|
-
* Precedence: `--base64` → `--content` →
|
|
3
|
+
* Precedence: `--base64` → `--content` → positional arg.
|
|
5
4
|
*/
|
|
6
|
-
export async function resolveRtfInput(_format, inputArg,
|
|
5
|
+
export async function resolveRtfInput(_format, inputArg, content, base64) {
|
|
7
6
|
if (base64) {
|
|
8
7
|
return Buffer.from(base64, 'base64').toString('utf-8');
|
|
9
8
|
}
|
|
10
9
|
if (content !== undefined && content !== '') {
|
|
11
10
|
return content;
|
|
12
11
|
}
|
|
13
|
-
if (filePath) {
|
|
14
|
-
return fs.readFileSync(filePath, 'utf-8');
|
|
15
|
-
}
|
|
16
|
-
if (inputArg === '-') {
|
|
17
|
-
const chunks = [];
|
|
18
|
-
for await (const chunk of process.stdin) {
|
|
19
|
-
chunks.push(typeof chunk === 'string' ? Buffer.from(chunk, 'utf-8') : chunk);
|
|
20
|
-
}
|
|
21
|
-
return Buffer.concat(chunks).toString('utf-8');
|
|
22
|
-
}
|
|
23
12
|
if (inputArg !== undefined && inputArg !== '') {
|
|
24
13
|
return inputArg;
|
|
25
14
|
}
|
|
26
|
-
throw new Error('Provide content as: positional arg, --content <string>, --base64 <encoded
|
|
15
|
+
throw new Error('Provide content as: positional arg, --content <string>, or --base64 <encoded>.');
|
|
27
16
|
}
|
|
28
17
|
/**
|
|
29
18
|
* @deprecated Use {@link resolveRtfInput} with format `'markdown'`.
|
|
30
19
|
*/
|
|
31
|
-
export async function resolveMarkdownInput(markdownArg,
|
|
32
|
-
return resolveRtfInput('markdown', markdownArg,
|
|
20
|
+
export async function resolveMarkdownInput(markdownArg, content, base64) {
|
|
21
|
+
return resolveRtfInput('markdown', markdownArg, content, base64);
|
|
33
22
|
}
|
|
34
23
|
//# sourceMappingURL=resolveRtfInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveRtfInput.js","sourceRoot":"","sources":["../../src/rtf/resolveRtfInput.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolveRtfInput.js","sourceRoot":"","sources":["../../src/rtf/resolveRtfInput.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,OAAuB,EACvB,QAA4B,EAC5B,OAAgB,EAChB,MAAe;IAEf,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC;IACD,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC;QAC5C,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,EAAE,EAAE,CAAC;QAC9C,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,gFAAgF,CAAC,CAAC;AACpG,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,WAA+B,EAC/B,OAAgB,EAChB,MAAe;IAEf,OAAO,eAAe,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
**Batch (many articles):**
|
|
21
21
|
|
|
22
22
|
1. Build `tags.json` with an `articles` array (see `cms-edit help article-tags-from-json`)
|
|
23
|
-
2. `cms_edit ["article-tags-from-json", "--
|
|
23
|
+
2. `cms_edit ["article-tags-from-json", "--json", "<tags-json>", "--dry-run"]`
|
|
24
24
|
3. User confirms tag slugs per article
|
|
25
|
-
4. `cms_edit ["article-tags-from-json", "--
|
|
25
|
+
4. `cms_edit ["article-tags-from-json", "--json", "<tags-json>"]`
|
|
26
26
|
|
|
27
27
|
**Single article (session):**
|
|
28
28
|
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
**Batch import (recommended):**
|
|
21
21
|
|
|
22
22
|
1. Build `authors.json` with a `persons` array (see `cms-edit help person-from-json`)
|
|
23
|
-
2. `cms_edit ["create", "person-from-json", "--
|
|
23
|
+
2. `cms_edit ["create", "person-from-json", "--json", "<authors-json>", "--dry-run"]`
|
|
24
24
|
3. User confirms the list
|
|
25
|
-
4. `cms_edit ["create", "person-from-json", "--
|
|
25
|
+
4. `cms_edit ["create", "person-from-json", "--json", "<authors-json>", "--if-not-exists"]`
|
|
26
26
|
|
|
27
27
|
**Single person:**
|
|
28
28
|
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
3. **Check template hierarchy** — inspect `articleType.articleTemplate` (`peek --id <template-id>`). Do not add hero/layout components to `content` when the template's `preContent` / `postContent` already provides them
|
|
25
25
|
4. Ask about custom images; apply `defaults` and playbook rules for `featuredImage` and `visuals` (set explicitly when the playbook requires both)
|
|
26
26
|
5. Build `create from-json` payload (article fields + body components per playbook)
|
|
27
|
-
6. `cms_edit ["create", "from-json", "--
|
|
27
|
+
6. `cms_edit ["create", "from-json", "--json", "<compact-json>", "--dry-run", "--strict"]`
|
|
28
28
|
7. On approval, create and `save`
|
|
29
29
|
|
|
30
30
|
Or minimal shell:
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
3. **Propose plan** in plain English: slug, title, template/article type, component list — **ask user to confirm**
|
|
23
23
|
4. For pages: `list --type template` — pick template
|
|
24
24
|
5. Build `create from-json` payload
|
|
25
|
-
6. `cms_edit ["create", "from-json", "--
|
|
25
|
+
6. `cms_edit ["create", "from-json", "--json", "<compact-json>", "--dry-run", "--strict"]` (or `--json-base64` for large payloads)
|
|
26
26
|
7. On approval, create and `save`
|
|
27
27
|
8. `cms_edit ["preview", "urls", "<slug>"]` — open **site live preview** or staging URL in browser MCP; offer production and Contentful entry URLs
|
|
28
28
|
9. Remind user to publish in Contentful UI
|
|
@@ -23,7 +23,11 @@
|
|
|
23
23
|
4. Add components: `add <ComponentType>`; set fields with `set` / `rtf`
|
|
24
24
|
5. `cms_edit ["diff"]` → `cms_edit ["save"]`
|
|
25
25
|
|
|
26
|
-
For multi-component pages, prefer `create from-json
|
|
26
|
+
For multi-component pages, prefer `create from-json --json '{…}' --dry-run --strict` first.
|
|
27
|
+
|
|
28
|
+
After each `add`, set `heading` then `cmsLabel` (not left as `New Generic`).
|
|
29
|
+
|
|
30
|
+
Test/agent pages: `indexed: false`, omit `hidden` (visible on production when published).
|
|
27
31
|
|
|
28
32
|
## Confirmation gates
|
|
29
33
|
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
2. Else inherit from linked **articleType** featured image
|
|
24
24
|
3. Else site default from `editor.defaults`
|
|
25
25
|
|
|
26
|
-
**Pages:**
|
|
26
|
+
**Pages:** **required** for new pages (reuse-first). No automatic fallback — set explicitly or via from-json.
|
|
27
27
|
|
|
28
28
|
```
|
|
29
29
|
cms_edit ["set", "@p0", "featuredImage", "<assetId>", "--links"]
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
cms_edit ["asset", "upload", "./file.jpg", "--title", "…", "--if-exists-by-filename"]
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
Sources:
|
|
32
|
+
Sources: `--url <https>` or `--base64` with `--mime` and `--file-name` (hosted MCP has no filesystem).
|
|
33
33
|
|
|
34
34
|
Optional Media wrapper:
|
|
35
35
|
|
|
@@ -42,7 +42,7 @@ After saving a draft, agents should offer **all applicable URLs** and open the b
|
|
|
42
42
|
```
|
|
43
43
|
Use `--json` for machine-readable output.
|
|
44
44
|
|
|
45
|
-
2. **Default open for new drafts:** site live preview (`siteLivePreview`)
|
|
45
|
+
2. **Default open for new drafts:** site live preview (`siteLivePreview`) — includes Vercel bypass params and `x-vercel-set-bypass-cookie=true` when configured.
|
|
46
46
|
|
|
47
47
|
3. **Open in browser** — use browser MCP on the chosen URL. Offer the user links to the other targets.
|
|
48
48
|
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
cms-edit index sync
|
|
7
|
-
cms-edit article-tags-from-json --
|
|
8
|
-
cms-edit article-tags-from-json --
|
|
7
|
+
cms-edit article-tags-from-json --json '{...}' --dry-run
|
|
8
|
+
cms-edit article-tags-from-json --json '{...}'
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
All writes create **drafts** only.
|
package/docs/help/batch-run.md
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
`batch run` executes a sequence of `cms-edit` operations from a JSON file. It is best suited for **patching fields on existing entries** — for creating complete new pages, use `create from-json` instead.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
cms-edit batch run --
|
|
7
|
-
cms-edit batch run --
|
|
6
|
+
cms-edit batch run --json '[...]'
|
|
7
|
+
cms-edit batch run --json '[...]' --dry-run # validate without saving
|
|
8
8
|
```
|
|
9
9
|
|
|
10
10
|
---
|
|
@@ -162,13 +162,13 @@ Do all `add` operations in one batch. Re-snapshot to see final refs. Write a sec
|
|
|
162
162
|
|
|
163
163
|
```bash
|
|
164
164
|
# Batch 1: add all items
|
|
165
|
-
cms-edit batch run --
|
|
165
|
+
cms-edit batch run --json '[...]'
|
|
166
166
|
|
|
167
167
|
# Inspect final refs
|
|
168
168
|
cms-edit snapshot
|
|
169
169
|
|
|
170
170
|
# Batch 2: set fields using the stable refs from snapshot
|
|
171
|
-
cms-edit batch run --
|
|
171
|
+
cms-edit batch run --json '[...]'
|
|
172
172
|
```
|
|
173
173
|
|
|
174
174
|
### Pattern C — Append to end only
|
|
@@ -200,8 +200,8 @@ For building complete page trees from scratch, `create from-json` is safer than
|
|
|
200
200
|
|
|
201
201
|
Run:
|
|
202
202
|
```bash
|
|
203
|
-
cms-edit batch run --
|
|
204
|
-
cms-edit batch run --
|
|
203
|
+
cms-edit batch run --json '[...]' --dry-run # validate first
|
|
204
|
+
cms-edit batch run --json '[...]' # apply
|
|
205
205
|
cms-edit open --page-slug /solutions # inspect result
|
|
206
206
|
```
|
|
207
207
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# cms-edit create from-json — Complete Guide
|
|
2
2
|
|
|
3
|
-
`create from-json` creates a complete new page or article — including all components, collections, and CTA links — from
|
|
3
|
+
`create from-json` creates a complete new page or article — including all components, collections, and CTA links — from inline JSON (`--json` or `--json-base64`). It is the recommended way to create new pages on hosted MCP.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
cms-edit create from-json --
|
|
7
|
-
cms-edit create from-json --
|
|
8
|
-
cms-edit create from-json --
|
|
9
|
-
cms-edit create from-json --
|
|
6
|
+
cms-edit create from-json --json '{...}'
|
|
7
|
+
cms-edit create from-json --json '{...}' --dry-run # validate without writing
|
|
8
|
+
cms-edit create from-json --json '{...}' --strict # fail on unknown JSON keys
|
|
9
|
+
cms-edit create from-json --json '{...}' --if-not-exists # return existing ID when slug exists
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
Run `cms-edit index sync` before using any `*AssetFilename` shorthand (index-backed exact `file.fileName` lookup).
|
|
@@ -240,11 +240,11 @@ Internal links resolve at creation time. If page A links to page B and B does no
|
|
|
240
240
|
|
|
241
241
|
```bash
|
|
242
242
|
# Wrong order: /solutions links to /solutions/hepatology which doesn't exist yet
|
|
243
|
-
cms-edit create from-json --
|
|
243
|
+
cms-edit create from-json --json '{...}' # FAILS mid-run
|
|
244
244
|
|
|
245
245
|
# Correct order: leaf page first, parent page second
|
|
246
|
-
cms-edit create from-json --
|
|
247
|
-
cms-edit create from-json --
|
|
246
|
+
cms-edit create from-json --json '{...}' # succeeds
|
|
247
|
+
cms-edit create from-json --json '{...}' # succeeds — slug resolves
|
|
248
248
|
```
|
|
249
249
|
|
|
250
250
|
Use `--dry-run` to catch missing slugs before writing anything (see below).
|
|
@@ -254,7 +254,7 @@ Use `--dry-run` to catch missing slugs before writing anything (see below).
|
|
|
254
254
|
`--dry-run` validates the plan without creating anything in Contentful. It prints the component tree and checks that all internal link slugs exist:
|
|
255
255
|
|
|
256
256
|
```bash
|
|
257
|
-
cms-edit create from-json --
|
|
257
|
+
cms-edit create from-json --json '{...}' --dry-run
|
|
258
258
|
```
|
|
259
259
|
|
|
260
260
|
Example output when a slug is missing:
|
|
@@ -365,8 +365,8 @@ A two-component page:
|
|
|
365
365
|
|
|
366
366
|
Run:
|
|
367
367
|
```bash
|
|
368
|
-
cms-edit create from-json --
|
|
369
|
-
cms-edit create from-json --
|
|
368
|
+
cms-edit create from-json --json '{...}' --dry-run # validate first
|
|
369
|
+
cms-edit create from-json --json '{...}' # create for real
|
|
370
370
|
cms-edit open --page-slug /solutions/hepatology # inspect result
|
|
371
371
|
```
|
|
372
372
|
|
|
@@ -55,7 +55,7 @@ cms-edit set @c1 textColour "White"
|
|
|
55
55
|
cms-edit rtf @c1 body "## Overview\n\nFirst paragraph.\n\nSecond paragraph."
|
|
56
56
|
|
|
57
57
|
# From a file
|
|
58
|
-
cms-edit rtf @c1 body --
|
|
58
|
+
cms-edit rtf @c1 body --content "# ..."
|
|
59
59
|
|
|
60
60
|
# Find and replace within existing rich text
|
|
61
61
|
cms-edit rtf replace @c1 body --find "old text" --replace-plain "new text"
|
package/docs/help/index.md
CHANGED
|
@@ -24,7 +24,7 @@ Available topics for `cms-edit help <topic>`:
|
|
|
24
24
|
| `article-tags-from-json` | Set tags on multiple articles from JSON |
|
|
25
25
|
| `bulk-rtf-replace` | Find-replace plain text across Rich Text fields in entry trees |
|
|
26
26
|
| `batch` | Edit multiple entries by Contentful entry ID, then save once |
|
|
27
|
-
| `batch-run` | Execute a JSON script of operations (`batch run --
|
|
27
|
+
| `batch-run` | Execute a JSON script of operations (`batch run --json`) |
|
|
28
28
|
| `fields` | Overview of all content types |
|
|
29
29
|
| `fields-page` | All fields on a `page` entry |
|
|
30
30
|
| `fields-article` | All fields on an `article` entry |
|
|
@@ -52,25 +52,25 @@ cms-edit set @c1 heading "New heading"
|
|
|
52
52
|
cms-edit save
|
|
53
53
|
|
|
54
54
|
# Create a complete new page from a JSON definition
|
|
55
|
-
cms-edit create from-json --
|
|
55
|
+
cms-edit create from-json --json '{...}'
|
|
56
56
|
|
|
57
57
|
# Validate a JSON file without writing anything
|
|
58
|
-
cms-edit create from-json --
|
|
58
|
+
cms-edit create from-json --json '{...}' --dry-run
|
|
59
59
|
|
|
60
60
|
# Bootstrap taxonomy for import scripts
|
|
61
|
-
cms-edit create taxonomy-from-json --
|
|
61
|
+
cms-edit create taxonomy-from-json --json '{...}' --if-not-exists
|
|
62
62
|
|
|
63
63
|
# Import authors from JSON
|
|
64
|
-
cms-edit create person-from-json --
|
|
64
|
+
cms-edit create person-from-json --json '{...}' --if-not-exists
|
|
65
65
|
|
|
66
66
|
# Bulk retag articles
|
|
67
|
-
cms-edit article-tags-from-json --
|
|
67
|
+
cms-edit article-tags-from-json --json '{...}'
|
|
68
68
|
|
|
69
69
|
# Sitewide rich-text find-replace (dry-run first)
|
|
70
70
|
cms-edit bulk-rtf-replace --find "Old" --replace-plain "New" --dry-run
|
|
71
71
|
|
|
72
72
|
# Run a batch of edits
|
|
73
|
-
cms-edit batch run --
|
|
73
|
+
cms-edit batch run --json '[...]'
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
---
|
|
@@ -139,7 +139,7 @@ cms-edit batch run --file patch.json
|
|
|
139
139
|
|---|---|
|
|
140
140
|
| `batch set <entryId>:field=value …` | Queue scalar updates on multiple entries by ID |
|
|
141
141
|
| `batch diff` / `batch save` / `batch discard` | Review and commit batch session |
|
|
142
|
-
| `batch run --
|
|
142
|
+
| `batch run --json <json> or --json-base64 <encoded>` | Execute a JSON batch of operations |
|
|
143
143
|
|
|
144
144
|
### Utilities
|
|
145
145
|
| Command | Description |
|
|
@@ -3,8 +3,8 @@
|
|
|
3
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
4
|
|
|
5
5
|
```bash
|
|
6
|
-
cms-edit create person-from-json --
|
|
7
|
-
cms-edit create person-from-json --
|
|
6
|
+
cms-edit create person-from-json --json '{...}' --dry-run
|
|
7
|
+
cms-edit create person-from-json --json '{...}' --if-not-exists
|
|
8
8
|
```
|
|
9
9
|
|
|
10
10
|
All entries are created as **drafts**. Nothing is published automatically.
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
`create taxonomy-from-json` creates multiple `tagType`, `articleType`, and `tag` entries from a single JSON file. It is the recommended way to bootstrap taxonomy for import scripts and publication workflows.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
cms-edit create taxonomy-from-json --
|
|
7
|
-
cms-edit create taxonomy-from-json --
|
|
6
|
+
cms-edit create taxonomy-from-json --json '{...}' --dry-run
|
|
7
|
+
cms-edit create taxonomy-from-json --json '{...}' --if-not-exists
|
|
8
8
|
```
|
|
9
9
|
|
|
10
10
|
Processing order: **tagTypes → articleTypes → tags** (tags depend on tagTypes).
|
|
@@ -65,7 +65,7 @@ Top-level link shorthands (`templateId`, `featuredImageId`, `topContentIds`, etc
|
|
|
65
65
|
|
|
66
66
|
| Option | Description |
|
|
67
67
|
|---|---|
|
|
68
|
-
| `--
|
|
68
|
+
| `--json <json> or --json-base64 <encoded>` | Path to taxonomy JSON (required) |
|
|
69
69
|
| `--if-not-exists` | Skip creation when slug already exists; return existing ID |
|
|
70
70
|
| `--dry-run` | Validate all entries and link targets without writing |
|
|
71
71
|
|
|
@@ -92,7 +92,7 @@ Combine batch bootstrap with `create … --if-not-exists` and `resolve` for scri
|
|
|
92
92
|
|
|
93
93
|
```bash
|
|
94
94
|
# One-time taxonomy bootstrap
|
|
95
|
-
cms-edit create taxonomy-from-json --
|
|
95
|
+
cms-edit create taxonomy-from-json --json '{...}' --if-not-exists
|
|
96
96
|
|
|
97
97
|
# Look up IDs in scripts
|
|
98
98
|
cms-edit resolve --tag-type-slug presentation-type --json
|
package/docs/help/workflow.md
CHANGED
|
@@ -78,7 +78,7 @@ cms-edit set @c2 backgroundColour "Navy"
|
|
|
78
78
|
cms-edit rtf @c2 body "## Overview\n\nFirst paragraph.\n\nSecond paragraph."
|
|
79
79
|
|
|
80
80
|
# From a file (long content)
|
|
81
|
-
cms-edit rtf @c2 body --
|
|
81
|
+
cms-edit rtf @c2 body --content "# ..."
|
|
82
82
|
```
|
|
83
83
|
|
|
84
84
|
### Multi-value: replacing inline content
|