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