@se-studio/contentful-cms 1.2.0 → 1.2.2
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 +44 -0
- package/HOSTED.md +1 -1
- package/README.md +20 -19
- package/dist/commands/audit.d.ts.map +1 -1
- package/dist/commands/audit.js +5 -32
- package/dist/commands/audit.js.map +1 -1
- package/dist/commands/backup.js +1 -1
- package/dist/commands/backup.js.map +1 -1
- package/dist/commands/create-from-json.d.ts.map +1 -1
- package/dist/commands/create-from-json.js +11 -7
- package/dist/commands/create-from-json.js.map +1 -1
- package/dist/commands/create-taxonomy.d.ts +4 -0
- package/dist/commands/create-taxonomy.d.ts.map +1 -1
- package/dist/commands/create-taxonomy.js +22 -4
- package/dist/commands/create-taxonomy.js.map +1 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +16 -6
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/diagnose.d.ts.map +1 -1
- package/dist/commands/diagnose.js +1 -1
- package/dist/commands/diagnose.js.map +1 -1
- package/dist/commands/discard.d.ts.map +1 -1
- package/dist/commands/discard.js +1 -1
- package/dist/commands/discard.js.map +1 -1
- package/dist/commands/ensure.d.ts.map +1 -1
- package/dist/commands/ensure.js +8 -0
- package/dist/commands/ensure.js.map +1 -1
- package/dist/commands/entry-lookup-target.d.ts +113 -0
- package/dist/commands/entry-lookup-target.d.ts.map +1 -0
- package/dist/commands/entry-lookup-target.js +235 -0
- package/dist/commands/entry-lookup-target.js.map +1 -0
- package/dist/commands/entry-search.d.ts.map +1 -1
- package/dist/commands/entry-search.js +1 -1
- package/dist/commands/entry-search.js.map +1 -1
- package/dist/commands/help.js +1 -1
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +6 -1
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +31 -9
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/nav.d.ts.map +1 -1
- package/dist/commands/nav.js +39 -22
- package/dist/commands/nav.js.map +1 -1
- package/dist/commands/open.d.ts.map +1 -1
- package/dist/commands/open.js +36 -21
- package/dist/commands/open.js.map +1 -1
- package/dist/commands/peek.d.ts.map +1 -1
- package/dist/commands/peek.js +36 -31
- package/dist/commands/peek.js.map +1 -1
- package/dist/commands/resolve.d.ts.map +1 -1
- package/dist/commands/resolve.js +82 -131
- package/dist/commands/resolve.js.map +1 -1
- package/dist/commands/screenshot.js +2 -2
- package/dist/commands/screenshot.js.map +1 -1
- package/dist/commands/set.d.ts.map +1 -1
- package/dist/commands/set.js +16 -0
- package/dist/commands/set.js.map +1 -1
- package/dist/contentful/cda-sync.d.ts +3 -1
- package/dist/contentful/cda-sync.d.ts.map +1 -1
- package/dist/contentful/cda-sync.js +128 -16
- package/dist/contentful/cda-sync.js.map +1 -1
- package/dist/contentful/entry-fields.d.ts +1 -0
- package/dist/contentful/entry-fields.d.ts.map +1 -1
- package/dist/contentful/entry-fields.js +21 -0
- package/dist/contentful/entry-fields.js.map +1 -1
- package/dist/contentful/entry-lookup.d.ts +16 -0
- package/dist/contentful/entry-lookup.d.ts.map +1 -0
- package/dist/contentful/entry-lookup.js +273 -0
- package/dist/contentful/entry-lookup.js.map +1 -0
- package/dist/contentful/fetch.d.ts +1 -1
- package/dist/contentful/fetch.d.ts.map +1 -1
- package/dist/contentful/fetch.js +11 -77
- package/dist/contentful/fetch.js.map +1 -1
- package/dist/contentful/linkedEntryFields.d.ts +27 -0
- package/dist/contentful/linkedEntryFields.d.ts.map +1 -0
- package/dist/contentful/linkedEntryFields.js +95 -0
- package/dist/contentful/linkedEntryFields.js.map +1 -0
- package/dist/contentful/reference-record.d.ts +16 -7
- package/dist/contentful/reference-record.d.ts.map +1 -1
- package/dist/contentful/reference-record.js +57 -16
- package/dist/contentful/reference-record.js.map +1 -1
- package/dist/contentful/resolve-content-type.d.ts +1 -1
- package/dist/contentful/resolve-content-type.d.ts.map +1 -1
- package/dist/contentful/resolve-content-type.js +1 -1
- package/dist/contentful/resolve-content-type.js.map +1 -1
- package/dist/contentful/slug-validation.d.ts +7 -0
- package/dist/contentful/slug-validation.d.ts.map +1 -0
- package/dist/contentful/slug-validation.js +15 -0
- package/dist/contentful/slug-validation.js.map +1 -0
- package/dist/generated/hosted-guide.d.ts +1 -1
- package/dist/generated/hosted-guide.d.ts.map +1 -1
- package/dist/generated/hosted-guide.js +1 -1
- package/dist/generated/hosted-guide.js.map +1 -1
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/index/db.d.ts.map +1 -1
- package/dist/index/db.js +17 -0
- package/dist/index/db.js.map +1 -1
- package/dist/index/query.d.ts +13 -2
- package/dist/index/query.d.ts.map +1 -1
- package/dist/index/query.js +62 -5
- package/dist/index/query.js.map +1 -1
- package/dist/index/reference-lookup.d.ts.map +1 -1
- package/dist/index/reference-lookup.js +12 -0
- package/dist/index/reference-lookup.js.map +1 -1
- package/dist/index/require.d.ts.map +1 -1
- package/dist/index/require.js +6 -0
- package/dist/index/require.js.map +1 -1
- package/dist/index/run-sync.d.ts +2 -0
- package/dist/index/run-sync.d.ts.map +1 -1
- package/dist/index/run-sync.js +25 -4
- package/dist/index/run-sync.js.map +1 -1
- package/dist/index/schema.d.ts +10 -4
- package/dist/index/schema.d.ts.map +1 -1
- package/dist/index/schema.js +26 -4
- package/dist/index/schema.js.map +1 -1
- package/dist/index/sync-lock.d.ts +1 -0
- package/dist/index/sync-lock.d.ts.map +1 -1
- package/dist/index/sync-lock.js +43 -30
- package/dist/index/sync-lock.js.map +1 -1
- package/dist/index/sync-log.d.ts +7 -0
- package/dist/index/sync-log.d.ts.map +1 -0
- package/dist/index/sync-log.js +23 -0
- package/dist/index/sync-log.js.map +1 -0
- package/dist/index/sync.d.ts.map +1 -1
- package/dist/index/sync.js +7 -4
- package/dist/index/sync.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 +11 -11
- package/dist/session/store.js +2 -2
- package/dist/session/store.js.map +1 -1
- package/docs/FUNCTIONAL_SPEC.md +9 -8
- package/docs/help/create-from-json.md +4 -4
- package/docs/help/fields-article.md +2 -2
- package/docs/help/fields-collection.md +1 -1
- package/docs/help/fields-component.md +1 -1
- package/docs/help/fields-page.md +2 -2
- package/docs/help/fields-taxonomy.md +8 -4
- package/docs/help/index-sync.md +36 -18
- package/docs/help/index.md +8 -7
- package/docs/help/lookup.md +123 -0
- package/docs/help/run.md +1 -1
- package/docs/help/taxonomy-from-json.md +2 -2
- package/docs/help/workflow.md +6 -6
- package/docs/mcp/hosted-guide.md +4 -4
- package/package.json +1 -1
- package/skills/core/SKILL.md +39 -30
- package/skills/templates/SKILL.md +1 -1
- package/dist/commands/resolve-options.d.ts +0 -20
- package/dist/commands/resolve-options.d.ts.map +0 -1
- package/dist/commands/resolve-options.js +0 -51
- package/dist/commands/resolve-options.js.map +0 -1
|
@@ -95,8 +95,8 @@ Combine batch bootstrap with `ensure` and `resolve` for script-friendly imports:
|
|
|
95
95
|
cms-edit create taxonomy-from-json --file taxonomy.json --if-not-exists
|
|
96
96
|
|
|
97
97
|
# Look up IDs in scripts
|
|
98
|
-
cms-edit resolve --type
|
|
99
|
-
cms-edit resolve --
|
|
98
|
+
cms-edit resolve --tag-type-slug presentation-type --json
|
|
99
|
+
cms-edit resolve --tag-slug asco-2025 --json
|
|
100
100
|
|
|
101
101
|
# Add a single entry idempotently
|
|
102
102
|
cms-edit ensure tag --slug new-tag --name "New Tag" --tag-type presentation-type
|
package/docs/help/workflow.md
CHANGED
|
@@ -19,9 +19,9 @@ cms-edit search "hepatology"
|
|
|
19
19
|
## Step 2: Open a Page or Article
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
cms-edit open /solutions/hepatology
|
|
22
|
+
cms-edit open --page-slug /solutions/hepatology
|
|
23
23
|
# or by entry ID:
|
|
24
|
-
cms-edit open 4xKpzQ2abc123
|
|
24
|
+
cms-edit open --id 4xKpzQ2abc123
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
`open` fetches the full entry tree and saves it to a local session file. All subsequent commands operate on this session without re-fetching from Contentful until you `save`.
|
|
@@ -136,7 +136,7 @@ Writes all changes to Contentful as **drafts**. Nothing is published. A human mu
|
|
|
136
136
|
|
|
137
137
|
### Edit a specific component's heading and body
|
|
138
138
|
```bash
|
|
139
|
-
cms-edit open /about
|
|
139
|
+
cms-edit open --page-slug /about
|
|
140
140
|
cms-edit snapshot
|
|
141
141
|
cms-edit set @c3 heading "Updated heading"
|
|
142
142
|
cms-edit rtf @c3 body "New body text\n\nSecond paragraph."
|
|
@@ -146,7 +146,7 @@ cms-edit save
|
|
|
146
146
|
|
|
147
147
|
### Add a new section to an existing page
|
|
148
148
|
```bash
|
|
149
|
-
cms-edit open /home
|
|
149
|
+
cms-edit open --page-slug /home
|
|
150
150
|
cms-edit snapshot
|
|
151
151
|
# Add a new Text Block after @c2
|
|
152
152
|
cms-edit add TextBlock component --after @c2
|
|
@@ -159,11 +159,11 @@ cms-edit save
|
|
|
159
159
|
### Fix a field on multiple pages
|
|
160
160
|
Use `--session` to work on multiple pages without losing state:
|
|
161
161
|
```bash
|
|
162
|
-
cms-edit --session fix-1 open /page-one
|
|
162
|
+
cms-edit --session fix-1 open --page-slug /page-one
|
|
163
163
|
cms-edit --session fix-1 set @c1 heading "Fixed"
|
|
164
164
|
cms-edit --session fix-1 save
|
|
165
165
|
|
|
166
|
-
cms-edit --session fix-2 open /page-two
|
|
166
|
+
cms-edit --session fix-2 open --page-slug /page-two
|
|
167
167
|
cms-edit --session fix-2 set @c1 heading "Fixed"
|
|
168
168
|
cms-edit --session fix-2 save
|
|
169
169
|
```
|
package/docs/mcp/hosted-guide.md
CHANGED
|
@@ -146,13 +146,13 @@ Asset search and media-by-filename list **require** the index. Template/taxonomy
|
|
|
146
146
|
|
|
147
147
|
| Goal | MCP args |
|
|
148
148
|
|------|----------|
|
|
149
|
-
| Edit workflow (session) | `["open", "/"]` then `["read", "@c0"]` |
|
|
150
|
-
| Preview tree + fields, no session | `["peek", "/pricing"]` or `["peek", "
|
|
149
|
+
| Edit workflow (session) | `["open", "--page-slug", "/"]` then `["read", "@c0"]` |
|
|
150
|
+
| Preview tree + fields, no session | `["peek", "--page-slug", "/pricing"]` or `["peek", "--id", "<entry-id>"]` (JSON includes `rootFields`) |
|
|
151
151
|
| Read fields by entry ID, no session | `["read", "<entry-id>", "--id"]` or `["read", "<entry-id>", "--id", "heading"]` |
|
|
152
152
|
| Debug session persistence | `["diagnose"]` — reports store, userId, active session key |
|
|
153
153
|
|
|
154
154
|
- **`peek` is one-shot** — prints tree and **root field values** (`rootFields` in JSON). No session is created; do not chain `read @ref` afterward.
|
|
155
|
-
- **
|
|
155
|
+
- **Use flat lookup flags** for `open` and `peek` — same as CLI (`--page-slug`, `--id`, etc.). See `help lookup`.
|
|
156
156
|
- **`read @root`** only works after `open` (uses the active session). The hint in peek output is for terminal users who already ran `open`.
|
|
157
157
|
- **Do not invent flags** — there is no `--read`, `--then`, or chained peek+read syntax. One command per `cms_edit` call.
|
|
158
158
|
|
|
@@ -170,7 +170,7 @@ Asset search and media-by-filename list **require** the index. Template/taxonomy
|
|
|
170
170
|
|
|
171
171
|
**Discovery:** `sitemap`, `list --type <type>`, `search <query>`, `schema <contentType>`, `index sync`, `index status`
|
|
172
172
|
|
|
173
|
-
**Reading:** `open <slug>`, `open <id
|
|
173
|
+
**Reading:** `open --page-slug <slug>`, `open --id <id>`, `peek --page-slug <slug>`, `peek --id <id>`, `snapshot`, `read <ref>`, `read <ref> <field>`, `read <id> --id [field]`
|
|
174
174
|
|
|
175
175
|
**Diagnostics:** `diagnose` — session store, userId, active session (after open/read issues)
|
|
176
176
|
|
package/package.json
CHANGED
package/skills/core/SKILL.md
CHANGED
|
@@ -40,20 +40,23 @@ To get the path to the full README (e.g. for an LLM to read): `cms-edit --docs`
|
|
|
40
40
|
### Step 1: Open a page
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
|
-
# By slug
|
|
44
|
-
cms-edit open /pricing
|
|
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"
|
|
45
48
|
|
|
46
49
|
# By slug with explicit space
|
|
47
|
-
cms-edit --space om1 open /pricing
|
|
50
|
+
cms-edit --space om1 open --page-slug /pricing
|
|
48
51
|
|
|
49
52
|
# By Contentful entry ID
|
|
50
|
-
cms-edit open
|
|
53
|
+
cms-edit open --id 4xKj2abcDef
|
|
51
54
|
|
|
52
55
|
# Home page (slug is 'index')
|
|
53
|
-
cms-edit open /
|
|
56
|
+
cms-edit open --page-slug /
|
|
54
57
|
```
|
|
55
58
|
|
|
56
|
-
**
|
|
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.
|
|
57
60
|
|
|
58
61
|
### Step 2: Read the snapshot
|
|
59
62
|
|
|
@@ -236,7 +239,7 @@ Same as Component plus:
|
|
|
236
239
|
|
|
237
240
|
When adding body content and a CTA (e.g. PDF download) to an article:
|
|
238
241
|
|
|
239
|
-
1. `cms-edit open
|
|
242
|
+
1. `cms-edit open --article-slug <slug>` (or `open --id <id>`)
|
|
240
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`.
|
|
241
244
|
3. `cms-edit add CTA --target bottomContent`
|
|
242
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>`).
|
|
@@ -341,13 +344,14 @@ cms-edit set @c5 links linkId4 --links --append
|
|
|
341
344
|
|
|
342
345
|
## Assets
|
|
343
346
|
|
|
344
|
-
**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
|
|
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`.
|
|
345
348
|
|
|
346
349
|
```bash
|
|
347
350
|
cms-edit index sync
|
|
348
351
|
cms-edit index status
|
|
352
|
+
cms-edit list --type page
|
|
349
353
|
cms-edit list --type template
|
|
350
|
-
cms-edit resolve --type
|
|
354
|
+
cms-edit resolve --tag-type-slug topic
|
|
351
355
|
|
|
352
356
|
# Published-only index (optional)
|
|
353
357
|
cms-edit index sync --published
|
|
@@ -381,8 +385,8 @@ JSON output for upload (`CMS_EDIT_JSON=1`): `{ ok, id, fileName, url, mediaId?,
|
|
|
381
385
|
## Navigation
|
|
382
386
|
|
|
383
387
|
```bash
|
|
384
|
-
# Open a navigation entry
|
|
385
|
-
cms-edit nav open
|
|
388
|
+
# Open a navigation entry (navigation uses `name`, not slug)
|
|
389
|
+
cms-edit nav open --nav-name "Main navigation"
|
|
386
390
|
|
|
387
391
|
# Add a new item
|
|
388
392
|
cms-edit nav add --label "Pricing" --slug /pricing
|
|
@@ -414,7 +418,10 @@ cms-edit create article --slug /blog/my-post --title "My Post" --article-type-id
|
|
|
414
418
|
# Create taxonomy entries (draft only)
|
|
415
419
|
cms-edit create tag-type --slug conference-venue --name "Conference Venue"
|
|
416
420
|
cms-edit create article-type --slug resources/publications --name "Publications"
|
|
417
|
-
cms-edit create tag --slug poster-presentation --name "Poster Presentation" --tag-type presentation-type
|
|
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>
|
|
418
425
|
|
|
419
426
|
# Full fields via JSON
|
|
420
427
|
cms-edit create tag --json-file tag.json --tag-type presentation-type --if-not-exists
|
|
@@ -424,7 +431,8 @@ cms-edit create taxonomy-from-json --file taxonomy.json --if-not-exists
|
|
|
424
431
|
|
|
425
432
|
# Idempotent single-entry creates
|
|
426
433
|
cms-edit ensure tag-type --slug conference-venue --name "Conference Venue"
|
|
427
|
-
cms-edit ensure tag --slug asco-2025 --name "ASCO 2025" --tag-type 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>
|
|
428
436
|
```
|
|
429
437
|
|
|
430
438
|
See `cms-edit help fields-taxonomy` and `cms-edit help taxonomy-from-json` for field reference and batch schema.
|
|
@@ -433,10 +441,11 @@ See `cms-edit help fields-taxonomy` and `cms-edit help taxonomy-from-json` for f
|
|
|
433
441
|
|
|
434
442
|
```bash
|
|
435
443
|
# Resolve taxonomy IDs without a session
|
|
436
|
-
cms-edit resolve --
|
|
444
|
+
cms-edit resolve --tag-type-slug presentation-type
|
|
445
|
+
cms-edit resolve --tag-name "ASCO 2025" --tag-type-name "Conference Venue"
|
|
437
446
|
```
|
|
438
447
|
|
|
439
|
-
|
|
448
|
+
Use flat flags: `--page-slug`, `--article-cms-label`, `--tag-slug`, `--template-label`, etc. (`cms-edit help lookup`).
|
|
440
449
|
|
|
441
450
|
## Search and Discovery
|
|
442
451
|
|
|
@@ -455,11 +464,11 @@ cms-edit list --type article --slug my-article # article with a specific slug
|
|
|
455
464
|
cms-edit list --type article --has-field tags # articles where tags field is non-empty
|
|
456
465
|
|
|
457
466
|
# Resolve any entry or asset by ID (no open session required)
|
|
458
|
-
cms-edit resolve 4xKj2abcDefGhijK
|
|
459
|
-
cms-edit resolve 7pQrStuvWxyzAbc
|
|
460
|
-
cms-edit resolve --type
|
|
461
|
-
cms-edit resolve --
|
|
462
|
-
cms-edit resolve
|
|
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
|
|
463
472
|
|
|
464
473
|
# Find Media entries by asset
|
|
465
474
|
cms-edit list --type media --asset-id 7pQrStuvWxyzAbc
|
|
@@ -479,8 +488,8 @@ cms-edit resolve <tag-entry-id>
|
|
|
479
488
|
|
|
480
489
|
```bash
|
|
481
490
|
# Specify space explicitly
|
|
482
|
-
cms-edit --space brightline open /home
|
|
483
|
-
cms-edit --space om1 open /pricing
|
|
491
|
+
cms-edit --space brightline open --page-slug /home
|
|
492
|
+
cms-edit --space om1 open --page-slug /pricing
|
|
484
493
|
```
|
|
485
494
|
|
|
486
495
|
Or set `CMS_EDIT_SPACE=om1` environment variable.
|
|
@@ -489,7 +498,7 @@ Or set `CMS_EDIT_SPACE=om1` environment variable.
|
|
|
489
498
|
|
|
490
499
|
```bash
|
|
491
500
|
# 1. Open the page
|
|
492
|
-
cms-edit open /about-us
|
|
501
|
+
cms-edit open --page-slug /about-us
|
|
493
502
|
|
|
494
503
|
# 2. Find the hero component
|
|
495
504
|
cms-edit snapshot
|
|
@@ -515,7 +524,7 @@ cms-edit save
|
|
|
515
524
|
|
|
516
525
|
### Update an existing article
|
|
517
526
|
```bash
|
|
518
|
-
cms-edit open /blog/old-title
|
|
527
|
+
cms-edit open --article-slug /blog/old-title # or cms-edit open --id <id>
|
|
519
528
|
cms-edit set @p0 title "New Article Title" # @p0 works in article sessions too
|
|
520
529
|
cms-edit set @p0 slug new-article-slug
|
|
521
530
|
cms-edit set @p0 description "Updated description"
|
|
@@ -524,7 +533,7 @@ cms-edit save
|
|
|
524
533
|
|
|
525
534
|
### Add a new section to a page
|
|
526
535
|
```bash
|
|
527
|
-
cms-edit open /products
|
|
536
|
+
cms-edit open --page-slug /products
|
|
528
537
|
cms-edit types component # discover what's available
|
|
529
538
|
cms-edit add CTA --after @c3
|
|
530
539
|
cms-edit set @c4 heading "Ready to get started?"
|
|
@@ -535,7 +544,7 @@ cms-edit save
|
|
|
535
544
|
|
|
536
545
|
### Reorder page sections
|
|
537
546
|
```bash
|
|
538
|
-
cms-edit open /home
|
|
547
|
+
cms-edit open --page-slug /home
|
|
539
548
|
cms-edit snapshot # see current order
|
|
540
549
|
cms-edit move @c3 --after @c1 # move section 3 to position 2
|
|
541
550
|
cms-edit save
|
|
@@ -682,8 +691,8 @@ cms-edit sitemap --include page,article # Include articles too
|
|
|
682
691
|
Inspect a page without affecting your active session.
|
|
683
692
|
|
|
684
693
|
```bash
|
|
685
|
-
cms-edit peek /pricing # Show snapshot of /pricing; your active session is unchanged
|
|
686
|
-
cms-edit peek <
|
|
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
|
|
687
696
|
```
|
|
688
697
|
|
|
689
698
|
## Batch Operations (run)
|
|
@@ -864,8 +873,8 @@ cms-edit sitemap --include page,article # Include articles
|
|
|
864
873
|
Use `--session <name>` or `CONTENTFUL_CMS_SESSION=<name>` to isolate parallel workflows.
|
|
865
874
|
|
|
866
875
|
```bash
|
|
867
|
-
cms-edit --session agent-1 open /pricing
|
|
868
|
-
cms-edit --session agent-2 open /blog
|
|
876
|
+
cms-edit --session agent-1 open --page-slug /pricing
|
|
877
|
+
cms-edit --session agent-2 open --article-slug /blog
|
|
869
878
|
```
|
|
870
879
|
|
|
871
880
|
## Related skills
|
|
@@ -11,7 +11,7 @@ Use this skill when creating or editing **templates** (layout shells with preCon
|
|
|
11
11
|
|
|
12
12
|
1. **Create** a template: `cms-edit create template --label 'Campaign Landing'`
|
|
13
13
|
2. **List** templates: `cms-edit list --type template`
|
|
14
|
-
3. **Open** by ID: `cms-edit open
|
|
14
|
+
3. **Open** by cmsLabel or ID: `cms-edit open --template-label "Default"` or `cms-edit open --id <template-id>`
|
|
15
15
|
4. Edit content: set **preContent** and **postContent** (content arrays) via session snapshot refs; use `add`, `set`, `remove`, `move` as for pages. Set **menu** and **footer** (single navigation links) with `cms-edit set @ref menu <nav-entry-id> --link` and same for `footer`.
|
|
16
16
|
5. Set **colours**: `cms-edit set @ref backgroundColour Navy`, `cms-edit set @ref textColour White` (or project colour names).
|
|
17
17
|
6. **Save**: `cms-edit save`
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export type ResolveMode = 'by-slug' | 'by-id';
|
|
2
|
-
/**
|
|
3
|
-
* Determines how `resolve` should run. Returns null when options are invalid or incomplete.
|
|
4
|
-
*/
|
|
5
|
-
export declare function getResolveMode(id: string | undefined, opts: {
|
|
6
|
-
type?: string;
|
|
7
|
-
slug?: string;
|
|
8
|
-
label?: string;
|
|
9
|
-
}): ResolveMode | null;
|
|
10
|
-
export declare function resolveBySlugWarning(opts: {
|
|
11
|
-
type?: string;
|
|
12
|
-
slug?: string;
|
|
13
|
-
label?: string;
|
|
14
|
-
}, hasPositionalId: boolean): string | null;
|
|
15
|
-
export declare function resolveModeErrorMessage(opts: {
|
|
16
|
-
type?: string;
|
|
17
|
-
slug?: string;
|
|
18
|
-
label?: string;
|
|
19
|
-
}): string;
|
|
20
|
-
//# sourceMappingURL=resolve-options.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-options.d.ts","sourceRoot":"","sources":["../../src/commands/resolve-options.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC;AAE9C;;GAEG;AACH,wBAAgB,cAAc,CAC5B,EAAE,EAAE,MAAM,GAAG,SAAS,EACtB,IAAI,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GACrD,WAAW,GAAG,IAAI,CAuBpB;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,EACtD,eAAe,EAAE,OAAO,GACvB,MAAM,GAAG,IAAI,CAOf;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,MAAM,CAgBT"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Determines how `resolve` should run. Returns null when options are invalid or incomplete.
|
|
3
|
-
*/
|
|
4
|
-
export function getResolveMode(id, opts) {
|
|
5
|
-
const hasType = opts.type !== undefined && opts.type.trim() !== '';
|
|
6
|
-
const hasSlug = opts.slug !== undefined && opts.slug.trim() !== '';
|
|
7
|
-
const hasLabel = opts.label !== undefined && opts.label.trim() !== '';
|
|
8
|
-
const isTemplate = hasType && opts.type?.trim().toLowerCase() === 'template';
|
|
9
|
-
if (isTemplate) {
|
|
10
|
-
if (!hasSlug && !hasLabel) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
return 'by-slug';
|
|
14
|
-
}
|
|
15
|
-
if (hasType !== hasSlug) {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
if (hasType && hasSlug) {
|
|
19
|
-
return 'by-slug';
|
|
20
|
-
}
|
|
21
|
-
if (!id) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
return 'by-id';
|
|
25
|
-
}
|
|
26
|
-
export function resolveBySlugWarning(opts, hasPositionalId) {
|
|
27
|
-
if (!hasPositionalId)
|
|
28
|
-
return null;
|
|
29
|
-
const isTemplate = opts.type?.trim().toLowerCase() === 'template';
|
|
30
|
-
if (isTemplate) {
|
|
31
|
-
return 'Ignoring positional ID — resolving template by --label or --slug (cmsLabel).';
|
|
32
|
-
}
|
|
33
|
-
return 'Ignoring positional ID — resolving by --type and --slug.';
|
|
34
|
-
}
|
|
35
|
-
export function resolveModeErrorMessage(opts) {
|
|
36
|
-
const hasType = opts.type !== undefined && opts.type.trim() !== '';
|
|
37
|
-
const hasSlug = opts.slug !== undefined && opts.slug.trim() !== '';
|
|
38
|
-
const hasLabel = opts.label !== undefined && opts.label.trim() !== '';
|
|
39
|
-
const isTemplate = hasType && opts.type?.trim().toLowerCase() === 'template';
|
|
40
|
-
if (isTemplate && !hasSlug && !hasLabel) {
|
|
41
|
-
return 'Template resolve requires --label or --slug (cmsLabel).';
|
|
42
|
-
}
|
|
43
|
-
if (hasType && !hasSlug) {
|
|
44
|
-
return '--slug is required when using --type.';
|
|
45
|
-
}
|
|
46
|
-
if (hasSlug && !hasType) {
|
|
47
|
-
return '--type is required when using --slug.';
|
|
48
|
-
}
|
|
49
|
-
return 'Provide an entry/asset ID, or --type and --slug together.';
|
|
50
|
-
}
|
|
51
|
-
//# sourceMappingURL=resolve-options.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-options.js","sourceRoot":"","sources":["../../src/commands/resolve-options.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,EAAsB,EACtB,IAAsD;IAEtD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;IACnE,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;IACnE,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;IACtE,MAAM,UAAU,GAAG,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,UAAU,CAAC;IAE7E,IAAI,UAAU,EAAE,CAAC;QACf,IAAI,CAAC,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,OAAO,IAAI,OAAO,EAAE,CAAC;QACvB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,IAAsD,EACtD,eAAwB;IAExB,IAAI,CAAC,eAAe;QAAE,OAAO,IAAI,CAAC;IAClC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,UAAU,CAAC;IAClE,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,8EAA8E,CAAC;IACxF,CAAC;IACD,OAAO,0DAA0D,CAAC;AACpE,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,IAIvC;IACC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;IACnE,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;IACnE,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;IACtE,MAAM,UAAU,GAAG,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,UAAU,CAAC;IAE7E,IAAI,UAAU,IAAI,CAAC,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;QACxC,OAAO,yDAAyD,CAAC;IACnE,CAAC;IACD,IAAI,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;QACxB,OAAO,uCAAuC,CAAC;IACjD,CAAC;IACD,IAAI,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;QACxB,OAAO,uCAAuC,CAAC;IACjD,CAAC;IACD,OAAO,2DAA2D,CAAC;AACrE,CAAC"}
|