@se-studio/contentful-cms 1.1.0 → 1.2.1

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 (196) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/HOSTED.md +1 -1
  3. package/README.md +25 -17
  4. package/dist/commands/asset.d.ts.map +1 -1
  5. package/dist/commands/asset.js +6 -5
  6. package/dist/commands/asset.js.map +1 -1
  7. package/dist/commands/backup.js +1 -1
  8. package/dist/commands/backup.js.map +1 -1
  9. package/dist/commands/create-from-json.d.ts.map +1 -1
  10. package/dist/commands/create-from-json.js +11 -7
  11. package/dist/commands/create-from-json.js.map +1 -1
  12. package/dist/commands/create-taxonomy.d.ts +4 -0
  13. package/dist/commands/create-taxonomy.d.ts.map +1 -1
  14. package/dist/commands/create-taxonomy.js +30 -8
  15. package/dist/commands/create-taxonomy.js.map +1 -1
  16. package/dist/commands/create.d.ts.map +1 -1
  17. package/dist/commands/create.js +19 -6
  18. package/dist/commands/create.js.map +1 -1
  19. package/dist/commands/diagnose.d.ts.map +1 -1
  20. package/dist/commands/diagnose.js +1 -1
  21. package/dist/commands/diagnose.js.map +1 -1
  22. package/dist/commands/discard.d.ts.map +1 -1
  23. package/dist/commands/discard.js +1 -1
  24. package/dist/commands/discard.js.map +1 -1
  25. package/dist/commands/ensure.d.ts.map +1 -1
  26. package/dist/commands/ensure.js +8 -0
  27. package/dist/commands/ensure.js.map +1 -1
  28. package/dist/commands/entry-lookup-target.d.ts +113 -0
  29. package/dist/commands/entry-lookup-target.d.ts.map +1 -0
  30. package/dist/commands/entry-lookup-target.js +235 -0
  31. package/dist/commands/entry-lookup-target.js.map +1 -0
  32. package/dist/commands/entry-search.d.ts.map +1 -1
  33. package/dist/commands/entry-search.js +1 -1
  34. package/dist/commands/entry-search.js.map +1 -1
  35. package/dist/commands/help.js +1 -1
  36. package/dist/commands/help.js.map +1 -1
  37. package/dist/commands/index-dump.d.ts +2 -0
  38. package/dist/commands/index-dump.d.ts.map +1 -1
  39. package/dist/commands/index-dump.js +53 -7
  40. package/dist/commands/index-dump.js.map +1 -1
  41. package/dist/commands/index.d.ts.map +1 -1
  42. package/dist/commands/index.js +26 -20
  43. package/dist/commands/index.js.map +1 -1
  44. package/dist/commands/list.d.ts.map +1 -1
  45. package/dist/commands/list.js +84 -9
  46. package/dist/commands/list.js.map +1 -1
  47. package/dist/commands/nav.d.ts.map +1 -1
  48. package/dist/commands/nav.js +39 -22
  49. package/dist/commands/nav.js.map +1 -1
  50. package/dist/commands/open.d.ts.map +1 -1
  51. package/dist/commands/open.js +36 -21
  52. package/dist/commands/open.js.map +1 -1
  53. package/dist/commands/peek.d.ts.map +1 -1
  54. package/dist/commands/peek.js +36 -31
  55. package/dist/commands/peek.js.map +1 -1
  56. package/dist/commands/resolve.d.ts.map +1 -1
  57. package/dist/commands/resolve.js +104 -86
  58. package/dist/commands/resolve.js.map +1 -1
  59. package/dist/commands/screenshot.js +2 -2
  60. package/dist/commands/screenshot.js.map +1 -1
  61. package/dist/commands/set.d.ts.map +1 -1
  62. package/dist/commands/set.js +16 -0
  63. package/dist/commands/set.js.map +1 -1
  64. package/dist/commands/skill.d.ts.map +1 -1
  65. package/dist/commands/skill.js +11 -35
  66. package/dist/commands/skill.js.map +1 -1
  67. package/dist/contentful/asset-link-from-json.d.ts +1 -1
  68. package/dist/contentful/asset-link-from-json.d.ts.map +1 -1
  69. package/dist/contentful/asset-link-from-json.js +3 -3
  70. package/dist/contentful/asset-link-from-json.js.map +1 -1
  71. package/dist/contentful/cda-sync.d.ts +11 -3
  72. package/dist/contentful/cda-sync.d.ts.map +1 -1
  73. package/dist/contentful/cda-sync.js +158 -4
  74. package/dist/contentful/cda-sync.js.map +1 -1
  75. package/dist/contentful/entry-fields.d.ts +1 -0
  76. package/dist/contentful/entry-fields.d.ts.map +1 -1
  77. package/dist/contentful/entry-fields.js +31 -3
  78. package/dist/contentful/entry-fields.js.map +1 -1
  79. package/dist/contentful/entry-lookup.d.ts +16 -0
  80. package/dist/contentful/entry-lookup.d.ts.map +1 -0
  81. package/dist/contentful/entry-lookup.js +273 -0
  82. package/dist/contentful/entry-lookup.js.map +1 -0
  83. package/dist/contentful/fetch.d.ts +1 -1
  84. package/dist/contentful/fetch.d.ts.map +1 -1
  85. package/dist/contentful/fetch.js +8 -2
  86. package/dist/contentful/fetch.js.map +1 -1
  87. package/dist/contentful/field-value-from-json.d.ts.map +1 -1
  88. package/dist/contentful/field-value-from-json.js +5 -5
  89. package/dist/contentful/field-value-from-json.js.map +1 -1
  90. package/dist/contentful/reference-record.d.ts +41 -0
  91. package/dist/contentful/reference-record.d.ts.map +1 -0
  92. package/dist/contentful/reference-record.js +99 -0
  93. package/dist/contentful/reference-record.js.map +1 -0
  94. package/dist/contentful/resolve-content-type.d.ts +1 -1
  95. package/dist/contentful/resolve-content-type.d.ts.map +1 -1
  96. package/dist/contentful/resolve-content-type.js +1 -1
  97. package/dist/contentful/resolve-content-type.js.map +1 -1
  98. package/dist/contentful/slug-validation.d.ts +7 -0
  99. package/dist/contentful/slug-validation.d.ts.map +1 -0
  100. package/dist/contentful/slug-validation.js +15 -0
  101. package/dist/contentful/slug-validation.js.map +1 -0
  102. package/dist/generated/hosted-guide.d.ts +1 -1
  103. package/dist/generated/hosted-guide.d.ts.map +1 -1
  104. package/dist/generated/hosted-guide.js +1 -1
  105. package/dist/generated/hosted-guide.js.map +1 -1
  106. package/dist/generated/version.d.ts +1 -1
  107. package/dist/generated/version.js +1 -1
  108. package/dist/index/db.d.ts +6 -4
  109. package/dist/index/db.d.ts.map +1 -1
  110. package/dist/index/db.js +17 -0
  111. package/dist/index/db.js.map +1 -1
  112. package/dist/index/errors.d.ts +18 -0
  113. package/dist/index/errors.d.ts.map +1 -0
  114. package/dist/index/errors.js +18 -0
  115. package/dist/index/errors.js.map +1 -0
  116. package/dist/index/query.d.ts +41 -0
  117. package/dist/index/query.d.ts.map +1 -1
  118. package/dist/index/query.js +181 -0
  119. package/dist/index/query.js.map +1 -1
  120. package/dist/index/reference-lookup.d.ts +18 -0
  121. package/dist/index/reference-lookup.d.ts.map +1 -0
  122. package/dist/index/reference-lookup.js +119 -0
  123. package/dist/index/reference-lookup.js.map +1 -0
  124. package/dist/index/require.d.ts +13 -8
  125. package/dist/index/require.d.ts.map +1 -1
  126. package/dist/index/require.js +49 -17
  127. package/dist/index/require.js.map +1 -1
  128. package/dist/index/run-sync.d.ts +20 -0
  129. package/dist/index/run-sync.d.ts.map +1 -0
  130. package/dist/index/run-sync.js +69 -0
  131. package/dist/index/run-sync.js.map +1 -0
  132. package/dist/index/schema.d.ts +11 -2
  133. package/dist/index/schema.d.ts.map +1 -1
  134. package/dist/index/schema.js +37 -1
  135. package/dist/index/schema.js.map +1 -1
  136. package/dist/index/sync-lock.d.ts +9 -0
  137. package/dist/index/sync-lock.d.ts.map +1 -0
  138. package/dist/index/sync-lock.js +98 -0
  139. package/dist/index/sync-lock.js.map +1 -0
  140. package/dist/index/sync-log.d.ts +7 -0
  141. package/dist/index/sync-log.d.ts.map +1 -0
  142. package/dist/index/sync-log.js +23 -0
  143. package/dist/index/sync-log.js.map +1 -0
  144. package/dist/index/sync.d.ts +14 -1
  145. package/dist/index/sync.d.ts.map +1 -1
  146. package/dist/index/sync.js +139 -17
  147. package/dist/index/sync.js.map +1 -1
  148. package/dist/mcp/guide.d.ts +2 -2
  149. package/dist/mcp/guide.d.ts.map +1 -1
  150. package/dist/mcp/guide.js +3 -0
  151. package/dist/mcp/guide.js.map +1 -1
  152. package/dist/mcp/prompts/onboarding.d.ts.map +1 -1
  153. package/dist/mcp/prompts/onboarding.js +61 -0
  154. package/dist/mcp/prompts/onboarding.js.map +1 -1
  155. package/dist/mcp/tools/cms-edit.d.ts +1 -1
  156. package/dist/mcp/tools/cms-edit.d.ts.map +1 -1
  157. package/dist/mcp/tools/cms-edit.js +11 -11
  158. package/dist/output/json.d.ts +6 -0
  159. package/dist/output/json.d.ts.map +1 -1
  160. package/dist/output/json.js +21 -0
  161. package/dist/output/json.js.map +1 -1
  162. package/dist/session/store.js +2 -2
  163. package/dist/session/store.js.map +1 -1
  164. package/dist/setup/wizard.d.ts.map +1 -1
  165. package/dist/setup/wizard.js +23 -1
  166. package/dist/setup/wizard.js.map +1 -1
  167. package/dist/skills/install.d.ts +13 -0
  168. package/dist/skills/install.d.ts.map +1 -0
  169. package/dist/skills/install.js +37 -0
  170. package/dist/skills/install.js.map +1 -0
  171. package/docs/FUNCTIONAL_SPEC.md +9 -8
  172. package/docs/MEDIA_INDEX_PLAN.md +19 -1
  173. package/docs/SKILLS.md +29 -0
  174. package/docs/help/create-from-json.md +4 -4
  175. package/docs/help/fields-article.md +2 -2
  176. package/docs/help/fields-collection.md +1 -1
  177. package/docs/help/fields-component.md +1 -1
  178. package/docs/help/fields-page.md +2 -2
  179. package/docs/help/fields-taxonomy.md +8 -4
  180. package/docs/help/index-sync.md +64 -11
  181. package/docs/help/index.md +8 -7
  182. package/docs/help/lookup.md +123 -0
  183. package/docs/help/run.md +1 -1
  184. package/docs/help/taxonomy-from-json.md +2 -2
  185. package/docs/help/workflow.md +6 -6
  186. package/docs/mcp/hosted-guide.md +20 -5
  187. package/package.json +5 -4
  188. package/skills/README.md +30 -0
  189. package/skills/core/SKILL.md +882 -0
  190. package/skills/manifest.json +5 -0
  191. package/skills/setup/SKILL.md +129 -0
  192. package/skills/templates/SKILL.md +21 -0
  193. package/dist/commands/resolve-options.d.ts +0 -13
  194. package/dist/commands/resolve-options.d.ts.map +0 -1
  195. package/dist/commands/resolve-options.js +0 -29
  196. package/dist/commands/resolve-options.js.map +0 -1
@@ -0,0 +1,882 @@
1
+ ---
2
+ name: contentful-cms-core
3
+ description: "Use cms-edit CLI to read/edit Contentful content (open → snapshot → read → set/rtf → diff → save)."
4
+ ---
5
+
6
+ # Skill: contentful-cms CLI
7
+
8
+ Use this skill when you need to read or edit content in Contentful CMS using the `cms-edit` CLI tool.
9
+
10
+ ## Overview
11
+
12
+ `cms-edit` lets you read and edit Contentful draft content without publishing. It uses a **snapshot → ref → edit → save** workflow:
13
+
14
+ 1. `open` a page to load the content tree into a session
15
+ 2. `snapshot` to see the tree with `@ref` labels
16
+ 3. `read` an entry to inspect its fields
17
+ 4. `set` / `rtf` to modify fields
18
+ 5. `diff` to review changes
19
+ 6. `save` to write drafts to Contentful (NEVER publishes)
20
+
21
+ ## Safety Rules
22
+
23
+ **This tool CANNOT and WILL NOT:**
24
+ - Publish any entry
25
+ - Unpublish any entry
26
+ - Archive or delete published entries
27
+ - Upload new assets
28
+
29
+ All `save` operations create **draft** versions. A human must review and publish in Contentful.
30
+
31
+ ## Prerequisites
32
+
33
+ - `.contentful-cms.json` must exist in the project root (or ancestor directory)
34
+ - A Contentful Management Token with editor-only permissions (no publish rights) must be set as an env var and referenced in the config
35
+
36
+ To get the path to the full README (e.g. for an LLM to read): `cms-edit --docs`
37
+
38
+ ## Core Workflow
39
+
40
+ ### Step 1: Open a page
41
+
42
+ ```bash
43
+ # By page slug (trailing slash OK)
44
+ cms-edit open --page-slug /pricing
45
+
46
+ # By page cmsLabel (when editors use cmsLabel heavily)
47
+ cms-edit open --page-cms-label "Pricing page"
48
+
49
+ # By slug with explicit space
50
+ cms-edit --space om1 open --page-slug /pricing
51
+
52
+ # By Contentful entry ID
53
+ cms-edit open --id 4xKj2abcDef
54
+
55
+ # Home page (slug is 'index')
56
+ cms-edit open --page-slug /
57
+ ```
58
+
59
+ **Flat lookup flags:** provide **exactly one** primary flag per `open` / `resolve` / `nav open`. See `cms-edit help lookup`. Run `cms-edit index sync` so catalog types resolve from the local index.
60
+
61
+ ### Step 2: Read the snapshot
62
+
63
+ ```bash
64
+ cms-edit snapshot
65
+ ```
66
+
67
+ Output:
68
+ ```
69
+ Page: /pricing [4xKj2abc | published] · om1
70
+
71
+ @c0 Component[HeroSimple] "Transparent Pricing" [published]
72
+ @c1 Component[RichText] "How it works" [published]
73
+ @c2 Collection[CardGrid] "Plans" [published]
74
+ @c3 Component[Card] "Starter" [published]
75
+ @c4 Component[Card] "Pro" [draft]
76
+ @c5 Component[CTA] "Get started today" [published]
77
+ ```
78
+
79
+ Use `snapshot -c` for compact output (types only, no labels).
80
+
81
+ **Ref cheat sheet:**
82
+ | Ref | Resolves to |
83
+ |-----|-------------|
84
+ | `@root` | Root entry of the current session (works in any session type) |
85
+ | `@p0` | Root entry — alias for `@root` in **page** and **article** sessions only |
86
+ | `@c0` | Same as `@root` (first entry in depth-first traversal order) |
87
+ | `@c1`, `@c2`, … | Child entries in depth-first traversal order |
88
+
89
+ In **navigation sessions**, use `@root` or `@c0` for the nav root — `@p0` is not valid.
90
+
91
+ ### Step 3: Read entry fields
92
+
93
+ ```bash
94
+ # All fields summary
95
+ cms-edit read @c0
96
+
97
+ # Specific field (shows plain text for scalars, Markdown for rich text)
98
+ cms-edit read @c0 heading
99
+ cms-edit read @c1 body
100
+ ```
101
+
102
+ ### Step 4: Edit fields
103
+
104
+ **Scalar fields** (heading, title, slug, showHeading, etc.):
105
+ ```bash
106
+ cms-edit set @c0 heading "New heading text"
107
+ cms-edit set @c0 showHeading true
108
+ cms-edit set @c0 preHeading "Featured"
109
+ cms-edit set @c0 anchor "hero-section"
110
+ ```
111
+
112
+ **Bulk scalar updates** — set a field on multiple entries in one command:
113
+ ```bash
114
+ cms-edit set @c1:cmsLabel="Hero — School avoidance" @c2:cmsLabel="What is school avoidance?" @c3:cmsLabel="Signs of school avoidance"
115
+ cms-edit set @c1:heading="Title A" @c2:heading="Title B"
116
+ ```
117
+ Each token is `@ref:fieldName=value`. All values are scalar (string, boolean, number). Flags like `--link`, `--links`, `--file` do not apply in multi mode.
118
+
119
+ **Entry link fields** (template, articleType, etc. — value is the linked entry ID):
120
+ ```bash
121
+ cms-edit set @c0 template 3I0HxGKbUd173wIpFCsbVr --link
122
+ ```
123
+
124
+ **Entry link arrays** (`--links` works on any field that is an array of entry links — not just the standard page content fields):
125
+ ```bash
126
+ # Standard page content arrays
127
+ cms-edit set @p0 content @c1,@c2,@c3 --links
128
+ cms-edit set @p0 bottomContent @c4 --links --append
129
+
130
+ # Navigation items array (use @root or @c0 in a nav session)
131
+ cms-edit set @root items <id1>,<id2>,<id3> --links
132
+ ```
133
+
134
+ **Rich text fields** (body, additionalCopy):
135
+ ```bash
136
+ printf '## Why it matters\n\nOur platform helps teams **move faster** with [confidence](https://example.com).\n\n- Instant setup\n- No code required\n- 99.9%% uptime\n' | cms-edit rtf @c1 body --markdown -
137
+ ```
138
+
139
+ Markdown support:
140
+ - `# Heading 1` through `###### Heading 6`
141
+ - `**bold**`, `_italic_`, `***bold italic***`
142
+ - `[link text](https://url)`
143
+ - `- item` for unordered lists, `1. item` for ordered
144
+ - `> blockquote`
145
+ - `` `inline code` ``
146
+ - `---` for horizontal rule
147
+
148
+ For any content with multiple paragraphs or newlines, use `printf` piped to stdin — `\n` in a double-quoted shell string is **not** interpreted as a newline by bash:
149
+
150
+ ```bash
151
+ # Correct — printf interprets \n properly
152
+ printf '## Why it matters\n\nOur platform helps teams **move faster**.\n\n- Instant setup\n- No code required\n' | cms-edit rtf @c1 body --markdown -
153
+
154
+ # Also correct — file input
155
+ cms-edit rtf @c1 body --markdown --file path/to/file.md
156
+ cms-edit rtf @c1 body --markdown - < path/to/file.md
157
+ ```
158
+
159
+ Single-line content (no newlines) can be passed as a quoted argument directly:
160
+
161
+ ```bash
162
+ cms-edit rtf @c1 body --markdown "Simple single-paragraph body text with **bold**."
163
+ ```
164
+
165
+ **Surgical rich text replace** (compliance / quidget tokens — does not re-import the whole field):
166
+
167
+ - Matching is **per Contentful text node** only. If the author split a phrase with bold (e.g. `**Annual fee: **$95`), the string `Annual fee: $95` will **not** match as one piece; use a shorter `--find` or full `rtf … --file`.
168
+ - Quidget strings contain `*`, which Markdown would treat as italic — use **`--replace-plain`**, not `--replace`.
169
+
170
+ ```bash
171
+ # Replace every "$95" in this field with the quidget (e.g. multiple table cells)
172
+ cms-edit rtf replace @c2 body --find '$95' --replace-plain '{*credit_card_id*:*5048345*,*field*:*annual_fees*,*api*:*cc*}' --mode all
173
+
174
+ # Exactly one occurrence required (fails if 0 or 2+)
175
+ cms-edit rtf replace @c2 body --find '75,000 miles after spending $4,000 in the first 3 months' \
176
+ --replace-plain '{*credit_card_id*:*5048345*,*field*:*bonus_miles*,*api*:*cc*}' --mode exactlyOne
177
+ ```
178
+
179
+ ### Step 5: Review changes
180
+
181
+ ```bash
182
+ cms-edit diff
183
+ ```
184
+
185
+ Shows a diff of all modified fields across all changed entries.
186
+
187
+ ### Step 6: Save
188
+
189
+ ```bash
190
+ cms-edit save
191
+ ```
192
+
193
+ Writes all changes to Contentful as **drafts**. The changes are visible in Contentful's web app but NOT live until a human publishes them.
194
+
195
+ After saving, the session is cleared automatically if all changes were saved.
196
+
197
+ ### Discard
198
+
199
+ ```bash
200
+ cms-edit discard
201
+ ```
202
+
203
+ Throws away all unsaved local changes without writing to Contentful.
204
+
205
+ ## Content Field Names
206
+
207
+ Based on the SE Studio content model:
208
+
209
+ ### Component fields
210
+ | Field | Type | Notes |
211
+ |-------|------|-------|
212
+ | `cmsLabel` | string | Internal name (required) |
213
+ | `componentType` | string | Type discriminator (e.g. `HeroSimple`) |
214
+ | `heading` | string | Main heading (only shown when `showHeading` is true) |
215
+ | `showHeading` | boolean | Whether to display the heading |
216
+ | `preHeading` | string | Text above the heading |
217
+ | `postHeading` | string | Text below the heading |
218
+ | `body` | rich text | Main body copy |
219
+ | `additionalCopy` | rich text | Secondary body copy |
220
+ | `anchor` | string | Section anchor ID |
221
+ | `backgroundColour` | string | Background colour name |
222
+ | `textColour` | string | Text colour name |
223
+
224
+ ### Collection fields
225
+ Same as Component plus:
226
+ | Field | Type | Notes |
227
+ |-------|------|-------|
228
+ | `collectionType` | string | Type discriminator (e.g. `CardGrid`) |
229
+
230
+ ### Page fields
231
+ | Field | Type | Notes |
232
+ |-------|------|-------|
233
+ | `slug` | string | URL slug (no leading slash in CMS) |
234
+ | `title` | string | SEO/display title |
235
+ | `description` | string | Meta description |
236
+ | `indexed` | boolean | Whether to index in search engines |
237
+
238
+ ## Order of operations: article + CTA
239
+
240
+ When adding body content and a CTA (e.g. PDF download) to an article:
241
+
242
+ 1. `cms-edit open --article-slug <slug>` (or `open --id <id>`)
243
+ 2. Set body: `cms-edit rtf @<ref> body --markdown "..."` or `--markdown --file path/to.md`. If you need to add a body component first, use `add` then `rtf`.
244
+ 3. `cms-edit add CTA --target bottomContent`
245
+ 4. Set CTA links: use `--type external --label "Download PDF" --href <url>` for an external PDF URL, or `--type download --label "Download PDF" --asset-id <asset-id>` for a Contentful asset (get the ID from `cms-edit asset search "..."` or `asset info <id>`).
246
+ 5. `cms-edit save`
247
+
248
+ ## Structure Commands
249
+
250
+ ### Add a new component
251
+
252
+ ```bash
253
+ # Add at the end of page content
254
+ cms-edit add HeroSimple
255
+
256
+ # Add to article/page bottomContent (when session is an article or page)
257
+ cms-edit add CTA --target bottomContent
258
+
259
+ # Add after a specific component
260
+ cms-edit add HeroSimple --after @c1
261
+
262
+ # Add inside a collection (--parent derives target field from the parent's content type)
263
+ # collection parent → uses 'contents'; page/article parent → uses 'content' by default
264
+ cms-edit add Card --parent @c2
265
+ cms-edit add Hero --parent @c0 --target content # explicit target when parent is a page
266
+
267
+ # Add an explicit collection type
268
+ cms-edit add CardGrid --content-type collection
269
+
270
+ # Link an EXISTING entry instead of creating a new one (e.g. a shared CTA used on every page)
271
+ cms-edit add CTA --content-type component --existing-id 4xKj2abcDef
272
+ ```
273
+
274
+ Discover available types first:
275
+ ```bash
276
+ cms-edit types component
277
+ cms-edit types collection
278
+ ```
279
+
280
+ ### Remove a component
281
+
282
+ ```bash
283
+ cms-edit remove @c3
284
+ ```
285
+
286
+ If the entry is a draft and unreferenced elsewhere, it will be deleted on save. If it's published, it's unlinked only.
287
+
288
+ ### Move/reorder
289
+
290
+ ```bash
291
+ # Move @c3 to after @c1
292
+ cms-edit move @c3 --after @c1
293
+
294
+ # Move to before @c1
295
+ cms-edit move @c3 --before @c1
296
+
297
+ # Move to first position
298
+ cms-edit move @c3
299
+ ```
300
+
301
+ ## Links (CTAs)
302
+
303
+ Put the ref **after the subcommand** (e.g. `links add @c5`). The `links add` command creates the link entry and attaches it to the CTA in one step.
304
+
305
+ - **External:** `--type external --label "..." --href <url>` (required: `--href`)
306
+ - **Internal:** use `--slug /page` to look up by slug, or `--id <entry-id>` to reference by Contentful entry ID (required: `--slug` or `--id`)
307
+ - **Download:** `--type download --label "..." --asset-id <asset-id>` (required: `--asset-id`; get the ID from `asset search` or `asset info`)
308
+
309
+ ```bash
310
+ # List current links
311
+ cms-edit links list @c5
312
+
313
+ # Add an external link
314
+ cms-edit links add @c5 --type external --label "Learn more" --href https://example.com
315
+
316
+ # Add an external PDF CTA (URL to the file)
317
+ cms-edit links add @c5 --type external --label "Download PDF" --href "https://www.example.com/whitepaper.pdf"
318
+
319
+ # Add an internal link by slug
320
+ cms-edit links add @c5 --type internal --label "Pricing" --slug /pricing
321
+
322
+ # Add an internal link by entry ID
323
+ cms-edit links add @c5 --type internal --label "About" --id 4xKj2abcDef
324
+
325
+ # Add a download link (Contentful asset)
326
+ cms-edit links add @c5 --type download --label "Download PDF" --asset-id 5xKj2abcDef
327
+
328
+ # Remove link at index 1
329
+ cms-edit links remove @c5 1
330
+
331
+ # Move link from index 2 to index 0
332
+ cms-edit links move @c5 2 0
333
+ ```
334
+
335
+ You can also bulk-replace the `links` array on a component using `set --links`:
336
+
337
+ ```bash
338
+ # Replace the entire links array with specific IDs
339
+ cms-edit set @c5 links linkId1,linkId2,linkId3 --links
340
+
341
+ # Append a link entry ID to the existing array
342
+ cms-edit set @c5 links linkId4 --links --append
343
+ ```
344
+
345
+ ## Assets
346
+
347
+ **Content index:** Run `cms-edit index sync` once per space before asset search, media-by-filename list, asset audit, or `--if-exists-by-filename`. The same sync indexes the full **content catalog** (pages, articles, taxonomy, navigation, templates) for fast `list`, `open`, and `resolve`. Default sync uses the **Preview API** (draft content). See `cms-edit help index-sync` and `cms-edit help lookup`.
348
+
349
+ ```bash
350
+ cms-edit index sync
351
+ cms-edit index status
352
+ cms-edit list --type page
353
+ cms-edit list --type template
354
+ cms-edit resolve --tag-type-slug topic
355
+
356
+ # Published-only index (optional)
357
+ cms-edit index sync --published
358
+
359
+ # Search for an asset by title (requires index)
360
+ cms-edit asset search "hero background"
361
+
362
+ # Search by fileName
363
+ cms-edit asset search --filename istockphoto-123.jpg
364
+ cms-edit asset search --filename-match 'istockphoto-.*'
365
+
366
+ # Upload from local file, URL, or base64
367
+ cms-edit asset upload ./poster.jpg --title "Poster"
368
+ cms-edit asset upload --url https://example.com/image.jpg --if-exists-by-filename
369
+ cms-edit asset upload --base64 "$B64" --mime image/png --file-name poster.png
370
+
371
+ # Upload and create a Media wrapper in one step
372
+ cms-edit asset upload ./figure.png --with-media --media-name "Figure 1" --media-position Middle
373
+
374
+ # Get asset details
375
+ cms-edit asset info 5xKj2abcDef
376
+
377
+ # Set a visual field
378
+ cms-edit asset set @c0 visual 5xKj2abcDef
379
+ ```
380
+
381
+ JSON output for upload (`CMS_EDIT_JSON=1`): `{ ok, id, fileName, url, mediaId?, mediaIds? }`. Max upload size is **10MB** per file.
382
+
383
+ **Idempotent upload:** `--if-exists-by-filename` is check-then-create. Do not upload the same `fileName` in parallel — serialize per fileName or re-run to converge.
384
+
385
+ ## Navigation
386
+
387
+ ```bash
388
+ # Open a navigation entry (navigation uses `name`, not slug)
389
+ cms-edit nav open --nav-name "Main navigation"
390
+
391
+ # Add a new item
392
+ cms-edit nav add --label "Pricing" --slug /pricing
393
+ cms-edit nav add --label "Docs" --href https://docs.example.com --after @c1
394
+
395
+ # Link an existing NavigationItem (share items across navigations)
396
+ cms-edit nav add --existing-id <navigationItem-entry-id>
397
+
398
+ # Clone a navigation (duplicates all items)
399
+ cms-edit nav clone <source-nav-id>
400
+ cms-edit nav clone <source-nav-id> --label "LP Nav" --slug lp-nav
401
+ ```
402
+
403
+ ## Create New Entries
404
+
405
+ ```bash
406
+ # Create a new page (session opens on the new entry)
407
+ # All flags after --title are optional
408
+ cms-edit create page --slug /about-us --title "About Us" --description "Learn about our team"
409
+ cms-edit create page --slug /about-us --title "About Us" \
410
+ --template-id <template-entry-id> \
411
+ --featured-image <asset-id> \
412
+ --indexed \
413
+ --cms-label "About Us (internal)"
414
+
415
+ # Create a new article (requires articleType entry ID)
416
+ cms-edit create article --slug /blog/my-post --title "My Post" --article-type-id 3abcDef456
417
+
418
+ # Create taxonomy entries (draft only)
419
+ cms-edit create tag-type --slug conference-venue --name "Conference Venue"
420
+ cms-edit create article-type --slug resources/publications --name "Publications"
421
+ cms-edit create tag --slug poster-presentation --name "Poster Presentation" --tag-type-slug presentation-type
422
+ # cmsLabel defaults to "<tagType name> — <tag name>" when --cms-label omitted
423
+ cms-edit create tag --slug easl-congress-2026 --name "EASL Congress 2026" --tag-type publication-source \
424
+ --description "Research presented at EASL Congress 2026." --featured-image <logoAssetId>
425
+
426
+ # Full fields via JSON
427
+ cms-edit create tag --json-file tag.json --tag-type presentation-type --if-not-exists
428
+
429
+ # Batch bootstrap
430
+ cms-edit create taxonomy-from-json --file taxonomy.json --if-not-exists
431
+
432
+ # Idempotent single-entry creates
433
+ cms-edit ensure tag-type --slug conference-venue --name "Conference Venue"
434
+ cms-edit ensure tag --slug asco-2025 --name "ASCO 2025" --tag-type conference-venue \
435
+ --description "Annual ASCO conference." --featured-image <logoAssetId>
436
+ ```
437
+
438
+ See `cms-edit help fields-taxonomy` and `cms-edit help taxonomy-from-json` for field reference and batch schema.
439
+
440
+ **Idempotent taxonomy:** `--if-not-exists` / `ensure` are check-then-create — safe for sequential imports, not for parallel creates on the same slug.
441
+
442
+ ```bash
443
+ # Resolve taxonomy IDs without a session
444
+ cms-edit resolve --tag-type-slug presentation-type
445
+ cms-edit resolve --tag-name "ASCO 2025" --tag-type-name "Conference Venue"
446
+ ```
447
+
448
+ Use flat flags: `--page-slug`, `--article-cms-label`, `--tag-slug`, `--template-label`, etc. (`cms-edit help lookup`).
449
+
450
+ ## Search and Discovery
451
+
452
+ ```bash
453
+ # Search entries full-text (searches all content types by default)
454
+ cms-edit search "pricing page"
455
+ cms-edit search "hero" --type component
456
+
457
+ # List valid type values
458
+ cms-edit types component
459
+ cms-edit types collection
460
+
461
+ # List entries with filters
462
+ cms-edit list --type article --has-download # articles with a download asset
463
+ cms-edit list --type article --slug my-article # article with a specific slug
464
+ cms-edit list --type article --has-field tags # articles where tags field is non-empty
465
+
466
+ # Resolve any entry or asset by ID (no open session required)
467
+ cms-edit resolve --id 4xKj2abcDefGhijK # entry: shows type, title, slug, status
468
+ cms-edit resolve --id 7pQrStuvWxyzAbc # asset: shows title, fileName, URL
469
+ cms-edit resolve --tag-type-slug presentation-type
470
+ cms-edit resolve --tag-slug asco-2025 --tag-type-slug conference-venue
471
+ cms-edit resolve --tag-type-slug presentation-type --json
472
+
473
+ # Find Media entries by asset
474
+ cms-edit list --type media --asset-id 7pQrStuvWxyzAbc
475
+ cms-edit list --type media --asset-filename istockphoto-123.jpg
476
+ cms-edit list --type media --asset-filename-match 'istockphoto-.*'
477
+ ```
478
+
479
+ To resolve a **tag entry ID** to its slug or label (e.g. for constructing article URLs such as `/resources/publications/<tag>/<slug>`):
480
+
481
+ ```bash
482
+ cms-edit resolve <tag-entry-id>
483
+ # Output includes: content type, title/slug, status
484
+ # Use the slug field value to build the URL path segment
485
+ ```
486
+
487
+ ## Multi-space
488
+
489
+ ```bash
490
+ # Specify space explicitly
491
+ cms-edit --space brightline open --page-slug /home
492
+ cms-edit --space om1 open --page-slug /pricing
493
+ ```
494
+
495
+ Or set `CMS_EDIT_SPACE=om1` environment variable.
496
+
497
+ ## Complete Example: Update a Hero Section
498
+
499
+ ```bash
500
+ # 1. Open the page
501
+ cms-edit open --page-slug /about-us
502
+
503
+ # 2. Find the hero component
504
+ cms-edit snapshot
505
+
506
+ # 3. Read it to understand current state
507
+ cms-edit read @c0
508
+
509
+ # 4. Update the heading
510
+ cms-edit set @c0 heading "We build for the future"
511
+
512
+ # 5. Update the body copy (use printf for multiline content)
513
+ printf '## Our mission\n\nWe help companies **ship faster** and _smarter_.\n\n- Founded in 2018\n- 500+ clients\n- [Join us](/careers)\n' | cms-edit rtf @c0 body --markdown -
514
+
515
+ # 6. Review
516
+ cms-edit diff
517
+
518
+ # 7. Save as draft
519
+ cms-edit save
520
+ # → "Saved 1 entry as draft. A human must publish for changes to go live."
521
+ ```
522
+
523
+ ## Common Patterns
524
+
525
+ ### Update an existing article
526
+ ```bash
527
+ cms-edit open --article-slug /blog/old-title # or cms-edit open --id <id>
528
+ cms-edit set @p0 title "New Article Title" # @p0 works in article sessions too
529
+ cms-edit set @p0 slug new-article-slug
530
+ cms-edit set @p0 description "Updated description"
531
+ cms-edit save
532
+ ```
533
+
534
+ ### Add a new section to a page
535
+ ```bash
536
+ cms-edit open --page-slug /products
537
+ cms-edit types component # discover what's available
538
+ cms-edit add CTA --after @c3
539
+ cms-edit set @c4 heading "Ready to get started?"
540
+ cms-edit rtf @c4 body --markdown "Join thousands of teams who trust us."
541
+ cms-edit links add @c4 --type external --label "Start free trial" --href https://app.example.com
542
+ cms-edit save
543
+ ```
544
+
545
+ ### Reorder page sections
546
+ ```bash
547
+ cms-edit open --page-slug /home
548
+ cms-edit snapshot # see current order
549
+ cms-edit move @c3 --after @c1 # move section 3 to position 2
550
+ cms-edit save
551
+ ```
552
+
553
+ ## Screenshots
554
+
555
+ 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).
556
+
557
+ **Prerequisites:** `npm install -g agent-browser && agent-browser install`. For `@ref` and `--json-file`, the app must be running at `devBaseUrl`.
558
+
559
+ **Config:** Add `devBaseUrl` to the space in `.contentful-cms.json` so the CLI knows where your dev server runs:
560
+ ```json
561
+ {
562
+ "spaces": {
563
+ "om1": {
564
+ "devBaseUrl": "http://localhost:3013"
565
+ }
566
+ }
567
+ }
568
+ ```
569
+ If omitted, defaults to `http://localhost:3000` with a warning.
570
+
571
+ ### From session ref (full-fidelity)
572
+
573
+ `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.
574
+
575
+ ```bash
576
+ # Any entry type (component, collection, externalComponent, person)
577
+ cms-edit screenshot @c0
578
+
579
+ # Full-page capture (auto-applied for component/collection)
580
+ cms-edit screenshot @c0 --full
581
+
582
+ # Just print URL
583
+ cms-edit screenshot @c0 --url-only
584
+ ```
585
+
586
+ ### From JSON file (no Contentful)
587
+
588
+ Screenshot an IBase* JSON file (e.g. exported from `cms-edit read @c0 --json` or a fixture). App must be running.
589
+
590
+ ```bash
591
+ cms-edit screenshot --json-file path/to/component.json
592
+ ```
593
+
594
+ ### By type (showcase mock, no session)
595
+
596
+ Uses `/cms/showcase/render` with mock data. Fast, no preview token.
597
+
598
+ ```bash
599
+ cms-edit screenshot --component HeroSimple
600
+ cms-edit screenshot --collection CardGrid
601
+ cms-edit screenshot @c0 --embedded --full # when using ref with showcase-style capture
602
+ ```
603
+
604
+ ### Page screenshots
605
+
606
+ ```bash
607
+ # Current open page (uses session root slug)
608
+ cms-edit screenshot
609
+
610
+ # Explicit page slug
611
+ cms-edit screenshot /pricing
612
+ cms-edit screenshot /about-us --full
613
+ ```
614
+
615
+ ### Options
616
+
617
+ | Flag | Description |
618
+ |------|-------------|
619
+ | `--json-file <path>` | Read IBase* JSON from file and screenshot via render-json (no Contentful) |
620
+ | `--live` | Legacy: use `/cms/preview/render?id=...` for ref (optional; @ref is already full-fidelity) |
621
+ | `--out <path>` | Output file path (default: `./screenshot-<type>-<timestamp>.png`) |
622
+ | `--full` | Full-page capture (passed to `agent-browser screenshot --full`) |
623
+ | `--embedded` | Append `&embedded=true` to showcase URL (suppresses IframeHeightReporter) |
624
+ | `--wait <ms>` | Wait milliseconds after page load before capturing (default: 500) |
625
+ | `--url-only` | Print URL only, do not invoke agent-browser |
626
+ | `--json` | Output `{ ok, url, file }` as JSON |
627
+
628
+ ### Visual diffing
629
+
630
+ Use `agent-browser diff screenshot` to compare before/after a content change:
631
+
632
+ ```bash
633
+ # 1. Capture baseline before editing
634
+ cms-edit screenshot @c0 --out before.png
635
+
636
+ # 2. Edit content
637
+ cms-edit set @c0 heading "New heading"
638
+ cms-edit save
639
+
640
+ # 3. Capture after
641
+ cms-edit screenshot @c0 --out after.png
642
+
643
+ # 4. Diff
644
+ agent-browser diff screenshot --baseline before.png after.png
645
+ ```
646
+
647
+ ## Revert
648
+
649
+ Field-level undo — restore fields to their original values from when the session was opened.
650
+
651
+ ```bash
652
+ cms-edit revert @c0 heading # Revert a single field to its original value
653
+ cms-edit revert @c0 # Revert all fields on an entry
654
+ cms-edit revert --all # Revert all modified entries (session stays open)
655
+ ```
656
+
657
+ Note: Entries created via `add` cannot be reverted — use `remove` instead.
658
+
659
+ ## Health Check
660
+
661
+ Validate config and connectivity before running a workflow.
662
+
663
+ ```bash
664
+ cms-edit health # Check config file, space config, Contentful connectivity, agent-browser
665
+ ```
666
+
667
+ ## Schema Inspection
668
+
669
+ Inspect field definitions for a content type. Prefer this over `cms-edit types <ct>` when you need full field info.
670
+
671
+ ```bash
672
+ cms-edit schema component # Show all fields, types, enum values, link targets
673
+ cms-edit schema component --json # Full JSON output
674
+ ```
675
+
676
+ ## Sitemap
677
+
678
+ Browse all pages in the space.
679
+
680
+ ```bash
681
+ cms-edit sitemap # All pages, sorted by slug
682
+ cms-edit sitemap --prefix /blog # Filter by slug prefix
683
+ cms-edit sitemap --status draft # Draft pages only
684
+ cms-edit sitemap --sort updated # Most recently updated first
685
+ cms-edit sitemap --tree # Tree rendering
686
+ cms-edit sitemap --include page,article # Include articles too
687
+ ```
688
+
689
+ ## Peek
690
+
691
+ Inspect a page without affecting your active session.
692
+
693
+ ```bash
694
+ cms-edit peek --page-slug /pricing # Show snapshot of /pricing; your active session is unchanged
695
+ cms-edit peek --id <entryId> # Look up by entry ID
696
+ ```
697
+
698
+ ## Batch Operations (run)
699
+
700
+ Run a sequence of operations from a JSON file or stdin.
701
+
702
+ ```bash
703
+ cms-edit run --file ops.json # Run batch ops from file
704
+ echo '[...]' | cms-edit run # Pipe from stdin
705
+ cms-edit run --file ops.json --dry-run # Validate without saving
706
+ ```
707
+
708
+ Supported ops: `open`, `set`, `rtf`, `rtf-replace`, `save`, `add`, `links-add`.
709
+
710
+ | Op | args | opts |
711
+ |----|------|------|
712
+ | `open` | `["/slug"]` | — |
713
+ | `set` | `[ref, field, value]` | — |
714
+ | `rtf` | `[ref, field, markdown]` | — |
715
+ | `rtf-replace` | `[ref, field]` | `{ find, replacePlain?, mode? }` |
716
+ | `save` | — | — |
717
+ | `add` | `[type, contentType]` | `{ after?, parent?, target?, existingId? }` |
718
+ | `links-add` | `[ref]` | `{ type, label, href?, slug?, id?, assetId? }` |
719
+
720
+ The `add` op returns the new `@ref` in the step message; subsequent ops can reference it.
721
+
722
+ Example `ops.json` — update an existing page with a new CTA that has two buttons:
723
+ ```json
724
+ [
725
+ { "cmd": "open", "args": ["/pricing"] },
726
+ { "cmd": "add", "args": ["CTA", "component"], "opts": { "target": "bottomContent" } },
727
+ { "cmd": "set", "args": ["@c5", "heading", "Ready to get started?"] },
728
+ { "cmd": "links-add", "args": ["@c5"], "opts": { "type": "external", "label": "Start free trial", "href": "https://app.example.com" } },
729
+ { "cmd": "links-add", "args": ["@c5"], "opts": { "type": "internal", "label": "Learn more", "slug": "/about" } },
730
+ { "cmd": "save" }
731
+ ]
732
+ ```
733
+
734
+ ## Create Page or Article from JSON
735
+
736
+ Create a complete page or article — including all components, fields, and CTA links — from a single declarative JSON file. This is the recommended approach for creating multiple pages or articles in bulk.
737
+
738
+ ```bash
739
+ cms-edit create from-json --file page.json # Create from file
740
+ cms-edit create from-json --file page.json --dry-run # Preview without writing
741
+ cat page.json | cms-edit create from-json # Pipe from stdin
742
+ ```
743
+
744
+ **Page JSON schema:**
745
+
746
+ ```json
747
+ {
748
+ "type": "page",
749
+ "slug": "/parent-coaching/digital-life-safety/cyberbullying",
750
+ "title": "Cyberbullying",
751
+ "description": "Optional meta description (SEO)",
752
+ "templateId": "contentful-template-entry-id",
753
+ "indexed": true,
754
+ "components": [
755
+ {
756
+ "contentType": "component",
757
+ "type": "HeroSimple",
758
+ "cmsLabel": "Hero — Protecting Your Child from Cyberbullying",
759
+ "target": "content",
760
+ "fields": {
761
+ "heading": "Protecting Your Child from Cyberbullying",
762
+ "body": "## Why it matters\n\nContent here with **bold** and [links](https://example.com).",
763
+ "backgroundColour": "Yellow"
764
+ },
765
+ "links": [
766
+ { "type": "external", "label": "Download Guide", "href": "https://example.com/guide.pdf" },
767
+ { "type": "internal", "label": "Learn More", "slug": "/resources" }
768
+ ]
769
+ },
770
+ {
771
+ "contentType": "collection",
772
+ "type": "CardGrid",
773
+ "cmsLabel": "Related topics grid",
774
+ "fields": { "heading": "Related topics" },
775
+ "items": [
776
+ {
777
+ "contentType": "component",
778
+ "type": "Card",
779
+ "cmsLabel": "Card — Screen Time",
780
+ "fields": { "heading": "Screen Time" }
781
+ },
782
+ {
783
+ "existingId": "abc123def456",
784
+ "comment": "Reuse existing 'Emotional Regulation' card"
785
+ }
786
+ ]
787
+ },
788
+ {
789
+ "existingId": "xyz789ghi012",
790
+ "comment": "Shared 'Join BLK Now' CTA reused on every page"
791
+ }
792
+ ]
793
+ }
794
+ ```
795
+
796
+ **Article JSON schema:**
797
+
798
+ ```json
799
+ {
800
+ "type": "article",
801
+ "slug": "/resources/publications/cyberbullying/new-research-2025",
802
+ "title": "New Research on Cyberbullying 2025",
803
+ "description": "Key findings from the 2025 cyberbullying study.",
804
+ "articleTypeId": "3abcDef456ghi",
805
+ "date": "2025-04-14",
806
+ "components": [
807
+ {
808
+ "contentType": "component",
809
+ "type": "RichText",
810
+ "fields": {
811
+ "body": "## Introduction\n\nNew research shows..."
812
+ }
813
+ },
814
+ {
815
+ "contentType": "component",
816
+ "type": "CTA",
817
+ "target": "bottomContent",
818
+ "links": [
819
+ { "type": "external", "label": "Download Full Report", "href": "https://example.com/report.pdf" }
820
+ ]
821
+ }
822
+ ]
823
+ }
824
+ ```
825
+
826
+ - `type` defaults to `"page"`. Set `"type": "article"` (or include `articleTypeId`) for articles.
827
+ - `articleTypeId` is required for articles. Find valid IDs with `cms-edit list --type articleType`.
828
+ - `date` defaults to today (YYYY-MM-DD) if omitted.
829
+
830
+ **Key points:**
831
+ - Any component entry in `components` or `items` may use `{ existingId }` to link an existing entry instead of creating a new one.
832
+ - The same applies to `links` entries — use `{ existingId }` to attach an existing link entry.
833
+ - `cmsLabel` sets the human-readable label shown in Contentful's entry list. Defaults to `type` or `contentType` if omitted. **Always set `cmsLabel` on components when a page has multiple instances of the same type** (e.g. three CTAs) — editors need to distinguish them.
834
+ - String `fields` values become Rich Text when they auto-detect as Markdown (same heuristic), HTML (tag-like), or Rich Text JSON (`nodeType: document`). Otherwise strings stay as-is — use `{ "value": "…", "format": "text"|"markdown"|"html"|"json" }` or `cms-edit rtf` with `--text|--markdown|--html|--rtf-json`.
835
+ - `target` sets which content array to use: `topContent`, `content` (default), or `bottomContent`.
836
+ - Slugs must not have a trailing slash — `from-json` strips it with a warning, but avoid it in source JSON.
837
+ - All entries are created as **drafts**. A human must publish in Contentful.
838
+ - `--dry-run` prints the full plan without writing anything.
839
+
840
+ ## Find Existing Entries (for existingId)
841
+
842
+ When building page JSON that references existing entries, find their Contentful IDs first:
843
+
844
+ ```bash
845
+ # Search for a shared component by name
846
+ cms-edit search "join blk now" --type component --json
847
+ # → output includes "id" field — use this as existingId in your page JSON
848
+
849
+ # Browse all components of a specific type
850
+ cms-edit list --type component --filter 'fields.componentType=CTA'
851
+
852
+ # Confirm an entry before referencing it
853
+ cms-edit resolve 4xKj2abcDef
854
+ ```
855
+
856
+ ## Inventory & Status
857
+
858
+ Use `sitemap` to see all pages in a space with their publication status:
859
+
860
+ ```bash
861
+ cms-edit sitemap # All pages
862
+ cms-edit sitemap --prefix /parent-coaching # Filter by slug prefix
863
+ cms-edit sitemap --status draft # Draft pages only
864
+ cms-edit sitemap --sort updated # Most recently updated first
865
+ cms-edit sitemap --tree # Tree view
866
+ cms-edit sitemap --include page,article # Include articles
867
+ ```
868
+
869
+ **Note on bulk publish:** The tool cannot publish entries — all saves create drafts only. This is intentional. Review and publish drafts from the Contentful web app.
870
+
871
+ ## Concurrent Sessions
872
+
873
+ Use `--session <name>` or `CONTENTFUL_CMS_SESSION=<name>` to isolate parallel workflows.
874
+
875
+ ```bash
876
+ cms-edit --session agent-1 open --page-slug /pricing
877
+ cms-edit --session agent-2 open --article-slug /blog
878
+ ```
879
+
880
+ ## Related skills
881
+
882
+ 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.