@se-studio/contentful-cms 1.0.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.
- package/CHANGELOG.md +15 -0
- package/README.md +519 -0
- package/dist/bin/cms-edit.d.ts +4 -0
- package/dist/bin/cms-edit.d.ts.map +1 -0
- package/dist/bin/cms-edit.js +101 -0
- package/dist/bin/cms-edit.js.map +1 -0
- package/dist/commands/add.d.ts +4 -0
- package/dist/commands/add.d.ts.map +1 -0
- package/dist/commands/add.js +166 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/asset.d.ts +4 -0
- package/dist/commands/asset.d.ts.map +1 -0
- package/dist/commands/asset.js +110 -0
- package/dist/commands/asset.js.map +1 -0
- package/dist/commands/colours.d.ts +4 -0
- package/dist/commands/colours.d.ts.map +1 -0
- package/dist/commands/colours.js +91 -0
- package/dist/commands/colours.js.map +1 -0
- package/dist/commands/create.d.ts +4 -0
- package/dist/commands/create.d.ts.map +1 -0
- package/dist/commands/create.js +223 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/diff.d.ts +4 -0
- package/dist/commands/diff.d.ts.map +1 -0
- package/dist/commands/diff.js +141 -0
- package/dist/commands/diff.js.map +1 -0
- package/dist/commands/discard.d.ts +4 -0
- package/dist/commands/discard.d.ts.map +1 -0
- package/dist/commands/discard.js +36 -0
- package/dist/commands/discard.js.map +1 -0
- package/dist/commands/entry-search.d.ts +4 -0
- package/dist/commands/entry-search.d.ts.map +1 -0
- package/dist/commands/entry-search.js +81 -0
- package/dist/commands/entry-search.js.map +1 -0
- package/dist/commands/export-converted.d.ts +8 -0
- package/dist/commands/export-converted.d.ts.map +1 -0
- package/dist/commands/export-converted.js +62 -0
- package/dist/commands/export-converted.js.map +1 -0
- package/dist/commands/links.d.ts +4 -0
- package/dist/commands/links.d.ts.map +1 -0
- package/dist/commands/links.js +255 -0
- package/dist/commands/links.js.map +1 -0
- package/dist/commands/list.d.ts +4 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +91 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/move.d.ts +3 -0
- package/dist/commands/move.d.ts.map +1 -0
- package/dist/commands/move.js +84 -0
- package/dist/commands/move.js.map +1 -0
- package/dist/commands/nav.d.ts +4 -0
- package/dist/commands/nav.d.ts.map +1 -0
- package/dist/commands/nav.js +196 -0
- package/dist/commands/nav.js.map +1 -0
- package/dist/commands/open.d.ts +4 -0
- package/dist/commands/open.d.ts.map +1 -0
- package/dist/commands/open.js +74 -0
- package/dist/commands/open.js.map +1 -0
- package/dist/commands/read.d.ts +4 -0
- package/dist/commands/read.d.ts.map +1 -0
- package/dist/commands/read.js +102 -0
- package/dist/commands/read.js.map +1 -0
- package/dist/commands/remove.d.ts +4 -0
- package/dist/commands/remove.d.ts.map +1 -0
- package/dist/commands/remove.js +98 -0
- package/dist/commands/remove.js.map +1 -0
- package/dist/commands/rtf.d.ts +3 -0
- package/dist/commands/rtf.d.ts.map +1 -0
- package/dist/commands/rtf.js +131 -0
- package/dist/commands/rtf.js.map +1 -0
- package/dist/commands/save.d.ts +4 -0
- package/dist/commands/save.d.ts.map +1 -0
- package/dist/commands/save.js +59 -0
- package/dist/commands/save.js.map +1 -0
- package/dist/commands/screenshot.d.ts +4 -0
- package/dist/commands/screenshot.d.ts.map +1 -0
- package/dist/commands/screenshot.js +246 -0
- package/dist/commands/screenshot.js.map +1 -0
- package/dist/commands/set.d.ts +3 -0
- package/dist/commands/set.d.ts.map +1 -0
- package/dist/commands/set.js +152 -0
- package/dist/commands/set.js.map +1 -0
- package/dist/commands/skill.d.ts +4 -0
- package/dist/commands/skill.d.ts.map +1 -0
- package/dist/commands/skill.js +73 -0
- package/dist/commands/skill.js.map +1 -0
- package/dist/commands/snapshot.d.ts +3 -0
- package/dist/commands/snapshot.d.ts.map +1 -0
- package/dist/commands/snapshot.js +21 -0
- package/dist/commands/snapshot.js.map +1 -0
- package/dist/commands/types.d.ts +4 -0
- package/dist/commands/types.d.ts.map +1 -0
- package/dist/commands/types.js +78 -0
- package/dist/commands/types.js.map +1 -0
- package/dist/config/load.d.ts +14 -0
- package/dist/config/load.d.ts.map +1 -0
- package/dist/config/load.js +79 -0
- package/dist/config/load.js.map +1 -0
- package/dist/config/types.d.ts +13 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +2 -0
- package/dist/config/types.js.map +1 -0
- package/dist/contentful/assets.d.ts +20 -0
- package/dist/contentful/assets.d.ts.map +1 -0
- package/dist/contentful/assets.js +36 -0
- package/dist/contentful/assets.js.map +1 -0
- package/dist/contentful/client.d.ts +28 -0
- package/dist/contentful/client.d.ts.map +1 -0
- package/dist/contentful/client.js +30 -0
- package/dist/contentful/client.js.map +1 -0
- package/dist/contentful/fetch.d.ts +20 -0
- package/dist/contentful/fetch.d.ts.map +1 -0
- package/dist/contentful/fetch.js +154 -0
- package/dist/contentful/fetch.js.map +1 -0
- package/dist/contentful/references.d.ts +7 -0
- package/dist/contentful/references.d.ts.map +1 -0
- package/dist/contentful/references.js +12 -0
- package/dist/contentful/references.js.map +1 -0
- package/dist/contentful/write.d.ts +16 -0
- package/dist/contentful/write.d.ts.map +1 -0
- package/dist/contentful/write.js +75 -0
- package/dist/contentful/write.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/output/json.d.ts +47 -0
- package/dist/output/json.d.ts.map +1 -0
- package/dist/output/json.js +87 -0
- package/dist/output/json.js.map +1 -0
- package/dist/output/mode.d.ts +3 -0
- package/dist/output/mode.d.ts.map +1 -0
- package/dist/output/mode.js +16 -0
- package/dist/output/mode.js.map +1 -0
- package/dist/output/print.d.ts +14 -0
- package/dist/output/print.d.ts.map +1 -0
- package/dist/output/print.js +61 -0
- package/dist/output/print.js.map +1 -0
- package/dist/rtf/fromMarkdown.d.ts +19 -0
- package/dist/rtf/fromMarkdown.d.ts.map +1 -0
- package/dist/rtf/fromMarkdown.js +230 -0
- package/dist/rtf/fromMarkdown.js.map +1 -0
- package/dist/rtf/toMarkdown.d.ts +6 -0
- package/dist/rtf/toMarkdown.d.ts.map +1 -0
- package/dist/rtf/toMarkdown.js +105 -0
- package/dist/rtf/toMarkdown.js.map +1 -0
- package/dist/session/refs.d.ts +35 -0
- package/dist/session/refs.d.ts.map +1 -0
- package/dist/session/refs.js +128 -0
- package/dist/session/refs.js.map +1 -0
- package/dist/session/state.d.ts +91 -0
- package/dist/session/state.d.ts.map +1 -0
- package/dist/session/state.js +61 -0
- package/dist/session/state.js.map +1 -0
- package/dist/session/store.d.ts +10 -0
- package/dist/session/store.d.ts.map +1 -0
- package/dist/session/store.js +62 -0
- package/dist/session/store.js.map +1 -0
- package/dist/snapshot/render.d.ts +15 -0
- package/dist/snapshot/render.d.ts.map +1 -0
- package/dist/snapshot/render.js +166 -0
- package/dist/snapshot/render.js.map +1 -0
- package/dist/validation/allowed-types.d.ts +7 -0
- package/dist/validation/allowed-types.d.ts.map +1 -0
- package/dist/validation/allowed-types.js +16 -0
- package/dist/validation/allowed-types.js.map +1 -0
- package/package.json +61 -0
- package/skills/core/SKILL.md +483 -0
- package/skills/manifest.json +7 -0
- package/skills/navigation/SKILL.md +18 -0
- package/skills/rich-text/SKILL.md +23 -0
- package/skills/screenshots/SKILL.md +32 -0
- package/skills/templates/SKILL.md +16 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @se-studio/contentful-cms Changelog
|
|
2
|
+
|
|
3
|
+
## 1.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Bulk version bump: patch for all packages
|
|
8
|
+
|
|
9
|
+
## 1.0.0
|
|
10
|
+
|
|
11
|
+
- Initial release.
|
|
12
|
+
- **Added:** `set <ref> <field> <entry-id> --link` to set entry link fields (e.g. page template).
|
|
13
|
+
- **Added:** `links <ref> add --type internal --id <entry-id>` to add an internal link by Contentful entry ID (in addition to `--slug`).
|
|
14
|
+
- **Added:** `links <ref> add --type download --label "..." --asset-id <asset-id>` to add a download link referencing a Contentful asset by ID.
|
|
15
|
+
- **Fixed:** `open <slug>` with Contentful Management API: slug lookup now queries one content type at a time (page, then article). Navigation entries are not findable by slug (use `nav open` by id/slug).
|
package/README.md
ADDED
|
@@ -0,0 +1,519 @@
|
|
|
1
|
+
# @se-studio/contentful-cms
|
|
2
|
+
|
|
3
|
+
A CLI tool for AI agents to read and edit Contentful draft content across all SE Studio apps. Provides a `cms-edit` binary with a snapshot → ref → edit → save workflow similar to `agent-browser`.
|
|
4
|
+
|
|
5
|
+
**Key constraint:** This tool has NO ability to publish, unpublish, archive, or delete published entries. All writes create drafts that a human must review and publish in Contentful.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @se-studio/contentful-cms
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or from the monorepo root:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm install
|
|
17
|
+
pnpm build
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Contentful Role Setup (Required)
|
|
21
|
+
|
|
22
|
+
Before using this tool, create a dedicated **AI Editor** role in your Contentful space with restricted permissions. This provides defence-in-depth safety on top of the CLI's own restrictions.
|
|
23
|
+
|
|
24
|
+
### Steps
|
|
25
|
+
|
|
26
|
+
1. Go to **Settings → Roles & Permissions** in your Contentful web app
|
|
27
|
+
2. Click **Add Role** and name it `AI Editor`
|
|
28
|
+
3. Under **Content** permissions, set:
|
|
29
|
+
- Entries: ✅ Read, ✅ Create, ✅ Edit — ❌ Publish, ❌ Unpublish, ❌ Archive, ❌ Delete
|
|
30
|
+
- Assets: ✅ Read — ❌ everything else
|
|
31
|
+
4. Under **Space** and **Settings** — leave all ❌
|
|
32
|
+
5. Save the role
|
|
33
|
+
6. Go to **Settings → API Keys** → **Content management tokens**
|
|
34
|
+
7. Create a Personal Access Token scoped to this role (or invite a service account user with this role and generate their token)
|
|
35
|
+
8. Store the token as an environment variable (e.g. `CMS_EDIT_TOKEN`)
|
|
36
|
+
|
|
37
|
+
## Configuration
|
|
38
|
+
|
|
39
|
+
Create `.contentful-cms.json` in your project root (copy from `.contentful-cms.example.json`):
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"defaultSpace": "om1",
|
|
44
|
+
"spaces": {
|
|
45
|
+
"om1": {
|
|
46
|
+
"spaceId": "your-space-id",
|
|
47
|
+
"environment": "master",
|
|
48
|
+
"managementToken": "${CMS_EDIT_TOKEN_OM1}",
|
|
49
|
+
"defaultLocale": "en-US"
|
|
50
|
+
},
|
|
51
|
+
"brightline": {
|
|
52
|
+
"spaceId": "another-space-id",
|
|
53
|
+
"environment": "master",
|
|
54
|
+
"managementToken": "${CMS_EDIT_TOKEN_BRIGHTLINE}",
|
|
55
|
+
"defaultLocale": "en-US"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Token values use `${ENV_VAR}` syntax and are resolved from your `.env.local` at runtime.
|
|
62
|
+
|
|
63
|
+
## Workflow
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# 1. Open a page by slug — fetches the entry tree and starts a session
|
|
67
|
+
cms-edit open /pricing
|
|
68
|
+
|
|
69
|
+
# 2. View the content tree with @refs
|
|
70
|
+
cms-edit snapshot
|
|
71
|
+
|
|
72
|
+
# 3. Read a specific component's fields
|
|
73
|
+
cms-edit read @c2
|
|
74
|
+
|
|
75
|
+
# 4. Read a specific rich text field
|
|
76
|
+
cms-edit read @c2 body
|
|
77
|
+
|
|
78
|
+
# 5. Edit a scalar field
|
|
79
|
+
cms-edit set @c2 heading "New heading text"
|
|
80
|
+
cms-edit set @c2 showHeading true
|
|
81
|
+
|
|
82
|
+
# 5b. Set an Object/JSON field from a file
|
|
83
|
+
cms-edit set @c2 data --file chart-data.json
|
|
84
|
+
|
|
85
|
+
# 5c. Set an entry link field (e.g. page template)
|
|
86
|
+
cms-edit set @c0 template 3I0HxGKbUd173wIpFCsbVr --link
|
|
87
|
+
|
|
88
|
+
# 6. Edit a rich text field (Markdown input)
|
|
89
|
+
cms-edit rtf @c2 body "## Why it matters\n\nOur platform helps teams **move faster** with [confidence](https://example.com)."
|
|
90
|
+
|
|
91
|
+
# 7. Review changes before saving
|
|
92
|
+
cms-edit diff
|
|
93
|
+
|
|
94
|
+
# 8. Save all changes as Contentful drafts (NEVER publishes)
|
|
95
|
+
cms-edit save
|
|
96
|
+
|
|
97
|
+
# 9. Discard changes if needed
|
|
98
|
+
cms-edit discard
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Command Reference
|
|
102
|
+
|
|
103
|
+
### Navigation
|
|
104
|
+
|
|
105
|
+
| Command | Description |
|
|
106
|
+
|---------|-------------|
|
|
107
|
+
| `open <slug>` | Load a page/article by slug and start a session |
|
|
108
|
+
| `open <id> --id` | Load by Contentful entry ID |
|
|
109
|
+
| `snapshot [-c]` | Re-print content tree (`-c` for compact) |
|
|
110
|
+
| `read [ref] [field]` | Read all fields of a ref, or a specific field |
|
|
111
|
+
| `diff` | Show unsaved changes |
|
|
112
|
+
| `save` | Write all changes to Contentful as drafts |
|
|
113
|
+
| `discard [--all]` | Discard session changes |
|
|
114
|
+
|
|
115
|
+
### Field Editing
|
|
116
|
+
|
|
117
|
+
| Command | Description |
|
|
118
|
+
|---------|-------------|
|
|
119
|
+
| `set <ref> <field> <value>` | Set a scalar field (string, boolean, number) |
|
|
120
|
+
| `set <ref> <field> --file <path>` | Set an Object/JSON field from a file (e.g. `data`) |
|
|
121
|
+
| `set <ref> <field> --json '<json>'` | Set an Object/JSON field from an inline JSON string |
|
|
122
|
+
| `set <ref> <field> <entry-id> --link` | Set an entry link field (e.g. template) |
|
|
123
|
+
| `set <ref> <field> <refs-or-ids> --links [--append]` | Set a content array (topContent, content, bottomContent, contents); replace by default, or append with `--append` |
|
|
124
|
+
| `rtf <ref> <field> "<markdown>"` | Set a rich text field from Markdown |
|
|
125
|
+
| `rtf <ref> <field> --file <path>` | Set rich text from a file |
|
|
126
|
+
| `rtf <ref> <field> -` | Set rich text from stdin (e.g. `cms-edit rtf @c2 body - < file.md`) |
|
|
127
|
+
| `rtf embed <ref> <field> <entry-id> [--at N]` | Insert embedded entry block; use `--at N` for 0-based position, omit to append |
|
|
128
|
+
| `rtf embed <ref> <field> <asset-id> --asset` | Insert embedded asset block |
|
|
129
|
+
|
|
130
|
+
### Structure
|
|
131
|
+
|
|
132
|
+
| Command | Description |
|
|
133
|
+
|---------|-------------|
|
|
134
|
+
| `add <type> --content-type <ct> [--after <ref>] [--parent <ref>] [--target topContent\|content\|bottomContent]` | Create and link a new entry; `--content-type` is required (e.g. `component`, `collection`, `externalComponent`, `person`) |
|
|
135
|
+
| `remove <ref>` | Unlink from page (deletes if unreferenced draft) |
|
|
136
|
+
| `move <ref> [--after <ref2>] [--before <ref2>]` | Reorder within parent |
|
|
137
|
+
|
|
138
|
+
**`add` — content type is always explicit:**
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
cms-edit add "Hero" --content-type component
|
|
142
|
+
cms-edit add "Card Grid" --content-type collection
|
|
143
|
+
cms-edit add "Research chart" --content-type externalComponent
|
|
144
|
+
cms-edit add "Dr. Jane Smith" --content-type person
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
For content types that follow the `${contentType}Type` naming convention (e.g. `component` → `componentType`, `externalComponent` → `externalComponentType`), the `<type>` argument is stored in that field. For content types without a type discriminator the `<type>` is used as the initial `cmsLabel` only.
|
|
148
|
+
|
|
149
|
+
### Create
|
|
150
|
+
|
|
151
|
+
| Command | Description |
|
|
152
|
+
|---------|-------------|
|
|
153
|
+
| `create page --slug /x --title "X"` | Create a new page entry |
|
|
154
|
+
| `create article --slug /x --title "X" --article-type-id <id>` | Create a new article |
|
|
155
|
+
| `create template --label "X"` | Create a new template entry |
|
|
156
|
+
|
|
157
|
+
### Templates
|
|
158
|
+
|
|
159
|
+
Create a template: `cms-edit create template --label 'Campaign Landing'`. Edit: `cms-edit open <template-id> --id`. List template IDs: `cms-edit list --type template`.
|
|
160
|
+
|
|
161
|
+
### Links (CTAs)
|
|
162
|
+
|
|
163
|
+
Put the ref **after the subcommand** (e.g. `links add @c5`).
|
|
164
|
+
|
|
165
|
+
| Command | Description |
|
|
166
|
+
|---------|-------------|
|
|
167
|
+
| `links list <ref>` | List CTA links on an entry |
|
|
168
|
+
| `links add <ref> --type external --label "X" --href <url>` | Add an external link (requires `--href`) |
|
|
169
|
+
| `links add <ref> --type internal --label "X" --slug /page` | Add an internal link by page/article slug |
|
|
170
|
+
| `links add <ref> --type internal --label "X" --id <entry-id>` | Add an internal link by Contentful entry ID |
|
|
171
|
+
| `links add <ref> --type download --label "X" --asset-id <asset-id>` | Add a download link to an asset (requires `--asset-id`) |
|
|
172
|
+
| `links remove <ref> <index>` | Remove a link by index |
|
|
173
|
+
| `links move <ref> <from> <to>` | Reorder links |
|
|
174
|
+
|
|
175
|
+
**Examples:**
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
cms-edit links list @c5
|
|
179
|
+
cms-edit links add @c5 --type external --label "Download PDF" --href "https://www.example.com/whitepaper.pdf"
|
|
180
|
+
cms-edit links add @c5 --type internal --label "Pricing" --slug /pricing
|
|
181
|
+
cms-edit links add @c5 --type internal --label "About" --id 4xKj2abcDef
|
|
182
|
+
cms-edit links add @c5 --type download --label "Download PDF" --asset-id 5xKj2abcDef
|
|
183
|
+
cms-edit links remove @c5 1
|
|
184
|
+
cms-edit links move @c5 2 0
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Assets
|
|
188
|
+
|
|
189
|
+
| Command | Description |
|
|
190
|
+
|---------|-------------|
|
|
191
|
+
| `asset search "<query>"` | Search assets by title |
|
|
192
|
+
| `asset info <asset-id>` | Show asset details |
|
|
193
|
+
| `asset set <ref> <field> <asset-id>` | Set a visual/asset field |
|
|
194
|
+
|
|
195
|
+
### Navigation Entries
|
|
196
|
+
|
|
197
|
+
| Command | Description |
|
|
198
|
+
|---------|-------------|
|
|
199
|
+
| `nav open <slug-or-id>` | Load a navigation entry |
|
|
200
|
+
| `nav add --label "X" --slug /page` | Add a navigation item |
|
|
201
|
+
|
|
202
|
+
### Discovery
|
|
203
|
+
|
|
204
|
+
| Command | Description |
|
|
205
|
+
|---------|-------------|
|
|
206
|
+
| `types <content-type>` | List valid type-discriminator values for any content type (looks up the `${contentType}Type` field) |
|
|
207
|
+
| `colours` | List valid `backgroundColour` and `textColour` values from the content model (one list each, no session required) |
|
|
208
|
+
| `search "<query>"` | Full-text search across entries |
|
|
209
|
+
| `list --type <type>` | List **all** entries of a content type (paginates automatically) |
|
|
210
|
+
|
|
211
|
+
**`types` examples:**
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
cms-edit types component # lists componentType values
|
|
215
|
+
cms-edit types collection # lists collectionType values
|
|
216
|
+
cms-edit types externalComponent # lists externalComponentType values
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Screenshot
|
|
220
|
+
|
|
221
|
+
Capture a PNG of a component, collection, external component, person, or page. **Requires [agent-browser](https://github.com/vercel-labs/agent-browser)** (`npm install -g agent-browser && agent-browser install`). For `@ref` and `--json-file`, the app must be running at `devBaseUrl` (see `.contentful-cms.json`).
|
|
222
|
+
|
|
223
|
+
| Target | Command |
|
|
224
|
+
|--------|---------|
|
|
225
|
+
| Session ref (full-fidelity) | `cms-edit screenshot @c0` — all types (component, collection, externalComponent, person) via convert API and `/cms-preview/render-json` |
|
|
226
|
+
| JSON file (no Contentful) | `cms-edit screenshot --json-file path/to/entry.json` — IBase* JSON; validates or screenshots without a session |
|
|
227
|
+
| By type (mock, no session) | `cms-edit screenshot --component HeroSimple`, `cms-edit screenshot --collection CardGrid` |
|
|
228
|
+
| Page | `cms-edit screenshot` (current page) or `cms-edit screenshot /pricing` |
|
|
229
|
+
|
|
230
|
+
**Options:** `--out <path>`, `--full`, `--embedded`, `--wait <ms>`, `--url-only` (print URL only), `--json` (machine-readable output). For `--component` / `--collection`: **`--param key=value`** (repeatable) to override showcase controls (e.g. `--param backgroundColour=Navy --param textColour="Off White"`). **`--width <px>`** and **`--height <px>`** set viewport size before capture (e.g. `--width 375` for mobile).
|
|
231
|
+
|
|
232
|
+
Use `--out before.png` / `--out after.png` with `agent-browser diff screenshot` for visual diffing. See the **screenshots** skill for details.
|
|
233
|
+
|
|
234
|
+
### export-converted
|
|
235
|
+
|
|
236
|
+
Export a session ref's entry as **converted (`IBase*`) JSON** via the app's convert API. Use the output with `screenshot --json-file` for custom variants without a session.
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
cms-edit open /your-page
|
|
240
|
+
# Snapshot shows refs; find the component ref (e.g. @c1)
|
|
241
|
+
cms-edit export-converted @c1 --out hero-base.json
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
App must be running at `devBaseUrl`. See example-brightline **docs/cms-edit-hero-variants.md** for a full workflow (Hero variants, viewport widths, custom params).
|
|
245
|
+
|
|
246
|
+
## Machine-readable Output (`--json`)
|
|
247
|
+
|
|
248
|
+
All commands support JSON output via the global `--json` flag or the `CMS_EDIT_JSON=1` environment variable (see [JSON Mode](#json-mode-llm--machine-readable-output) above). In addition, a subset of data-query commands also accept a per-command `--json` flag:
|
|
249
|
+
|
|
250
|
+
| Command | `--json` output |
|
|
251
|
+
|---------|-----------------|
|
|
252
|
+
| `list --type <type> --json` | JSON array of entry objects including all fields |
|
|
253
|
+
| `search "<query>" --json` | JSON array of entry objects including all fields |
|
|
254
|
+
| `read <ref> --json` | JSON object for one entry including all fields |
|
|
255
|
+
| `read <ref> <field> --json` | JSON value for a single field |
|
|
256
|
+
| `asset info <id> --json` | JSON object for one asset |
|
|
257
|
+
|
|
258
|
+
**Entry JSON shape** (for `list`, `search`, `read`):
|
|
259
|
+
|
|
260
|
+
```json
|
|
261
|
+
{
|
|
262
|
+
"id": "abc123",
|
|
263
|
+
"contentType": "article",
|
|
264
|
+
"title": "My Article",
|
|
265
|
+
"slug": "my-article",
|
|
266
|
+
"status": "published",
|
|
267
|
+
"updatedAt": "2024-01-01T00:00:00Z",
|
|
268
|
+
"fields": {
|
|
269
|
+
"title": "My Article",
|
|
270
|
+
"slug": "my-article",
|
|
271
|
+
"articleType": { "id": "entryId", "linkType": "Entry" },
|
|
272
|
+
"download": { "id": "assetId", "linkType": "Asset" },
|
|
273
|
+
"tags": ["tag1", "tag2"],
|
|
274
|
+
"body": "## Heading\n\nRich text rendered as Markdown."
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
Fields are flattened to the space's default locale. Link fields become `{ id, linkType }` objects. Rich text fields become Markdown strings.
|
|
280
|
+
|
|
281
|
+
**Asset JSON shape** (for `asset info`):
|
|
282
|
+
|
|
283
|
+
```json
|
|
284
|
+
{
|
|
285
|
+
"id": "assetId",
|
|
286
|
+
"title": "My PDF",
|
|
287
|
+
"fileName": "report-2024.pdf",
|
|
288
|
+
"contentType": "application/pdf",
|
|
289
|
+
"url": "https://assets.ctfassets.net/...",
|
|
290
|
+
"width": null,
|
|
291
|
+
"height": null,
|
|
292
|
+
"size": 102400
|
|
293
|
+
}
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
Progress messages from `list` are always written to stderr, so they do not contaminate the JSON on stdout.
|
|
297
|
+
|
|
298
|
+
### Scripting example: build an article–asset mapping
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
# 1. Get all articles as JSON (no session required)
|
|
302
|
+
cms-edit list --type article --json > articles.json
|
|
303
|
+
|
|
304
|
+
# 2. For each article, fetch the download asset filename
|
|
305
|
+
jq -r '.[].fields.download.id // empty' articles.json | while read assetId; do
|
|
306
|
+
# Requires an open session for space resolution — run `cms-edit open /any-page` first
|
|
307
|
+
cms-edit asset info "$assetId" --json
|
|
308
|
+
done
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
## Global Options
|
|
312
|
+
|
|
313
|
+
```
|
|
314
|
+
--space <name> Override the default space (from config)
|
|
315
|
+
--config <path> Custom config file path
|
|
316
|
+
--json Output all results as machine-readable JSON (see below)
|
|
317
|
+
--docs Print absolute path to this README and exit (for LLM or script tooling)
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
Use `cms-edit --docs` to get the path to the README so an LLM or script can read it.
|
|
321
|
+
|
|
322
|
+
## JSON Mode (LLM / machine-readable output)
|
|
323
|
+
|
|
324
|
+
Enable JSON mode to get machine-readable output from every command. Two ways to activate:
|
|
325
|
+
|
|
326
|
+
```bash
|
|
327
|
+
# Global flag (placed before the subcommand name):
|
|
328
|
+
cms-edit --json snapshot
|
|
329
|
+
cms-edit --json diff
|
|
330
|
+
cms-edit --json set @c2 heading "New title"
|
|
331
|
+
cms-edit --json add "Research chart" --content-type externalComponent --target content
|
|
332
|
+
|
|
333
|
+
# Environment variable (set once for the whole session):
|
|
334
|
+
export CMS_EDIT_JSON=1
|
|
335
|
+
cms-edit snapshot # → JSON
|
|
336
|
+
cms-edit diff # → JSON
|
|
337
|
+
cms-edit set @c2 data --file chart.json # → JSON
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### JSON output shapes
|
|
341
|
+
|
|
342
|
+
**Action commands** (`set`, `rtf`, `add`, `remove`, `move`, `save`, `discard`, `links`, …):
|
|
343
|
+
```json
|
|
344
|
+
{"ok": true, "message": "Set heading on @c2 to: New title"}
|
|
345
|
+
{"ok": false, "error": "Ref @c99 not found. Available refs: @c0, @c1, @c2"}
|
|
346
|
+
{"warn": "Entry is saved to Contentful but changes to the parent page are unsaved."}
|
|
347
|
+
```
|
|
348
|
+
Multiple lines may appear for a single command (one per message). Errors go to stderr; warnings and results go to stdout.
|
|
349
|
+
|
|
350
|
+
**`snapshot` / `tree`**:
|
|
351
|
+
```json
|
|
352
|
+
{
|
|
353
|
+
"rootType": "article",
|
|
354
|
+
"rootSlug": "/publications/study-1",
|
|
355
|
+
"rootId": "4xKj2abc",
|
|
356
|
+
"rootStatus": "published",
|
|
357
|
+
"spaceKey": "om1",
|
|
358
|
+
"fetchedAt": "2026-03-05T10:00:00.000Z",
|
|
359
|
+
"unsavedChanges": 1,
|
|
360
|
+
"pendingDeletions": 0,
|
|
361
|
+
"entries": [
|
|
362
|
+
{
|
|
363
|
+
"ref": "@c0",
|
|
364
|
+
"entryId": "abc123",
|
|
365
|
+
"contentType": "component",
|
|
366
|
+
"type": "RichText",
|
|
367
|
+
"label": "Introduction",
|
|
368
|
+
"status": "published",
|
|
369
|
+
"depth": 1,
|
|
370
|
+
"parentRef": null,
|
|
371
|
+
"parentField": "content"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"ref": "@c1",
|
|
375
|
+
"entryId": "def456",
|
|
376
|
+
"contentType": "externalComponent",
|
|
377
|
+
"type": "Research chart",
|
|
378
|
+
"label": "Figure 1: Cost-Efficiency",
|
|
379
|
+
"status": "draft",
|
|
380
|
+
"depth": 1,
|
|
381
|
+
"parentRef": null,
|
|
382
|
+
"parentField": "content"
|
|
383
|
+
}
|
|
384
|
+
]
|
|
385
|
+
}
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
**`diff`**:
|
|
389
|
+
```json
|
|
390
|
+
{
|
|
391
|
+
"hasChanges": true,
|
|
392
|
+
"modified": [
|
|
393
|
+
{
|
|
394
|
+
"ref": "@c1",
|
|
395
|
+
"entryId": "def456",
|
|
396
|
+
"contentType": "externalComponent",
|
|
397
|
+
"type": "Research chart",
|
|
398
|
+
"label": "Figure 1",
|
|
399
|
+
"isNew": false,
|
|
400
|
+
"fields": {
|
|
401
|
+
"heading": {"before": null, "after": "Figure 1: Cost-Efficiency"},
|
|
402
|
+
"data": {"before": null, "after": {"type": "bar", "categories": ["A", "B"]}}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
],
|
|
406
|
+
"deletions": []
|
|
407
|
+
}
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
**`read`**, **`list`**, **`search`**, **`asset info`**: same JSON shapes as their existing per-command `--json` flag.
|
|
411
|
+
|
|
412
|
+
## Order of operations: article + CTA
|
|
413
|
+
|
|
414
|
+
To add body content and a CTA (e.g. PDF download) to an article:
|
|
415
|
+
|
|
416
|
+
1. **Open the article:** `cms-edit open <article-slug>` or `cms-edit open <id> --id`
|
|
417
|
+
2. **Set or add body:** If the article has a rich text component, use `cms-edit rtf @<ref> body "..."` or `cms-edit rtf @<ref> body --file path/to.md`. If you need to add a new body component first, use `add` then `rtf`.
|
|
418
|
+
3. **Add CTA at bottom:** `cms-edit add CTA --content-type component --target bottomContent` (or add to main content with `--after @<ref>` if you prefer)
|
|
419
|
+
4. **Set CTA links:** Use one of:
|
|
420
|
+
- External (e.g. PDF URL): `cms-edit links add @<ctaRef> --type external --label "Download PDF" --href <url>`
|
|
421
|
+
- Download (Contentful asset): `cms-edit links add @<ctaRef> --type download --label "Download PDF" --asset-id <asset-id>` (get the ID from `cms-edit asset search "..."` or `cms-edit asset info <id>`)
|
|
422
|
+
5. **Save:** `cms-edit save`
|
|
423
|
+
|
|
424
|
+
## Order of operations: article + Research chart
|
|
425
|
+
|
|
426
|
+
To populate an article with a Research chart (external component):
|
|
427
|
+
|
|
428
|
+
```bash
|
|
429
|
+
# 1. Open the article
|
|
430
|
+
cms-edit open <article-slug>
|
|
431
|
+
|
|
432
|
+
# 2. Discover valid externalComponentType values
|
|
433
|
+
cms-edit types externalComponent
|
|
434
|
+
|
|
435
|
+
# 3. Add a Research chart to the content array
|
|
436
|
+
cms-edit add "Research chart" --content-type externalComponent --target content
|
|
437
|
+
|
|
438
|
+
# 4. Set the heading (scalar field)
|
|
439
|
+
cms-edit set @c2 heading "Figure 1: Cost-Efficiency of Data Automation"
|
|
440
|
+
|
|
441
|
+
# 5. Set the data field from a JSON file
|
|
442
|
+
cms-edit set @c2 data --file figure1-data.json
|
|
443
|
+
|
|
444
|
+
# 6. Set the additionalCopy footnote (rich text)
|
|
445
|
+
cms-edit rtf @c2 additionalCopy --file footnote.md
|
|
446
|
+
|
|
447
|
+
# 7. Review and save
|
|
448
|
+
cms-edit diff
|
|
449
|
+
cms-edit save
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
## Snapshot Format
|
|
453
|
+
|
|
454
|
+
```
|
|
455
|
+
Page: /pricing [4xKj2abc | published] · om1
|
|
456
|
+
|
|
457
|
+
@c0 Component[HeroSimple] "Transparent Pricing" [changed]
|
|
458
|
+
@c1 Component[RichText] "How it works" [published]
|
|
459
|
+
@c2 Collection[CardGrid] "Plans" [published]
|
|
460
|
+
@c3 Component[Card] "Starter" [published]
|
|
461
|
+
@c4 Component[Card] "Pro" [draft]
|
|
462
|
+
@c5 ExternalComponent[Research chart] "Figure 1: Cost-Efficiency" [draft]
|
|
463
|
+
@c6 Component[CTA] "Get started today" [published]
|
|
464
|
+
@c7 Person "Dr. Jane Smith" [published]
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
The type label follows the `${contentType}Type` convention:
|
|
468
|
+
- `component` → `Component[<componentType>]`
|
|
469
|
+
- `collection` → `Collection[<collectionType>]`
|
|
470
|
+
- `externalComponent` → `ExternalComponent[<externalComponentType>]`
|
|
471
|
+
- Any content type without a type discriminator → capitalised content type ID (e.g. `Person`)
|
|
472
|
+
|
|
473
|
+
**Status badges:**
|
|
474
|
+
- `[published]` — live, no pending changes
|
|
475
|
+
- `[draft]` — never published
|
|
476
|
+
- `[pending]` — published but has newer draft in Contentful
|
|
477
|
+
- `[changed]` — has unsaved local changes (run `save`)
|
|
478
|
+
|
|
479
|
+
## Rich Text (Markdown) Support
|
|
480
|
+
|
|
481
|
+
The `rtf` command accepts basic Markdown:
|
|
482
|
+
|
|
483
|
+
```
|
|
484
|
+
# Heading 1 → heading-1
|
|
485
|
+
## Heading 2 → heading-2
|
|
486
|
+
**bold** → bold mark
|
|
487
|
+
_italic_ → italic mark
|
|
488
|
+
***bold italic***
|
|
489
|
+
[text](url) → hyperlink
|
|
490
|
+
- item → unordered list
|
|
491
|
+
1. item → ordered list
|
|
492
|
+
> quote → blockquote
|
|
493
|
+
--- → horizontal rule
|
|
494
|
+
`code` → code mark
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
## Multi-space Usage
|
|
498
|
+
|
|
499
|
+
```bash
|
|
500
|
+
cms-edit --space om1 open /pricing
|
|
501
|
+
cms-edit --space brightline open /home
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
## What This Tool Cannot Do
|
|
505
|
+
|
|
506
|
+
By design, the following operations are **not available**:
|
|
507
|
+
|
|
508
|
+
- Publish entries (no `publish` command)
|
|
509
|
+
- Unpublish entries
|
|
510
|
+
- Archive entries
|
|
511
|
+
- Delete published entries
|
|
512
|
+
- Upload new assets
|
|
513
|
+
|
|
514
|
+
These restrictions are enforced at two levels:
|
|
515
|
+
|
|
516
|
+
1. **Contentful Role** — the management token should use a role with no publish permissions
|
|
517
|
+
2. **CLI** — no publish/delete commands exist in this tool
|
|
518
|
+
|
|
519
|
+
All saves create draft versions that remain invisible to visitors until a human reviews and publishes them in the Contentful web app.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cms-edit.d.ts","sourceRoot":"","sources":["../../src/bin/cms-edit.ts"],"names":[],"mappings":";AACA,uFAAuF"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/** biome-ignore-all lint/suspicious/noConsole: Console output is intentional in CLI */
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { Command } from 'commander';
|
|
6
|
+
import { registerAddCommand } from '../commands/add.js';
|
|
7
|
+
import { registerAssetCommand } from '../commands/asset.js';
|
|
8
|
+
import { registerColoursCommand } from '../commands/colours.js';
|
|
9
|
+
import { registerCreateCommand } from '../commands/create.js';
|
|
10
|
+
import { registerDiffCommand } from '../commands/diff.js';
|
|
11
|
+
import { registerDiscardCommand } from '../commands/discard.js';
|
|
12
|
+
import { registerEntrySearchCommand } from '../commands/entry-search.js';
|
|
13
|
+
import { registerExportConvertedCommand } from '../commands/export-converted.js';
|
|
14
|
+
import { registerLinksCommand } from '../commands/links.js';
|
|
15
|
+
import { registerListCommand } from '../commands/list.js';
|
|
16
|
+
import { registerMoveCommand } from '../commands/move.js';
|
|
17
|
+
import { registerNavCommand } from '../commands/nav.js';
|
|
18
|
+
import { registerOpenCommand } from '../commands/open.js';
|
|
19
|
+
import { registerReadCommand } from '../commands/read.js';
|
|
20
|
+
import { registerRemoveCommand } from '../commands/remove.js';
|
|
21
|
+
import { registerRtfCommand } from '../commands/rtf.js';
|
|
22
|
+
import { registerSaveCommand } from '../commands/save.js';
|
|
23
|
+
import { registerScreenshotCommand } from '../commands/screenshot.js';
|
|
24
|
+
import { registerSetCommand } from '../commands/set.js';
|
|
25
|
+
import { registerSkillCommand } from '../commands/skill.js';
|
|
26
|
+
import { registerSnapshotCommand } from '../commands/snapshot.js';
|
|
27
|
+
import { registerTypesCommand } from '../commands/types.js';
|
|
28
|
+
import { setJsonMode } from '../output/mode.js';
|
|
29
|
+
const program = new Command('cms-edit');
|
|
30
|
+
const LLM_INTRO = 'Opinionated CLI for editing Contentful draft content (pages, articles, templates, navigation). No publish — all saves create drafts.\n' +
|
|
31
|
+
'Workflow: open → snapshot → read/set/rtf/add/remove/move → diff → save. Use @refs from snapshot (e.g. @c0); re-snapshot after add/remove/move.\n' +
|
|
32
|
+
'Full docs: cms-edit --docs. Install skills: cms-edit skill install [--global].\n' +
|
|
33
|
+
'Check your work: cms-edit screenshot [@ref|/slug] (requires agent-browser).';
|
|
34
|
+
program
|
|
35
|
+
.name('cms-edit')
|
|
36
|
+
.version('1.0.0')
|
|
37
|
+
.description(LLM_INTRO)
|
|
38
|
+
.option('--space <name>', 'Contentful space to use (overrides defaultSpace in config)')
|
|
39
|
+
.option('--config <path>', 'Path to .contentful-cms.json config file')
|
|
40
|
+
.option('--json', 'Output all results as machine-readable JSON (also enabled by CMS_EDIT_JSON=1 env var)')
|
|
41
|
+
.option('--docs', 'Print absolute path to package README and exit (for LLM tooling)');
|
|
42
|
+
// Activate JSON mode before any command action runs, honouring both the global --json flag
|
|
43
|
+
// and the CMS_EDIT_JSON environment variable (which is already checked in mode.ts init).
|
|
44
|
+
program.hook('preAction', () => {
|
|
45
|
+
if (program.opts().json) {
|
|
46
|
+
setJsonMode(true);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
registerOpenCommand(program);
|
|
50
|
+
registerSnapshotCommand(program);
|
|
51
|
+
registerReadCommand(program);
|
|
52
|
+
registerSetCommand(program);
|
|
53
|
+
registerRtfCommand(program);
|
|
54
|
+
registerDiffCommand(program);
|
|
55
|
+
registerSaveCommand(program);
|
|
56
|
+
registerDiscardCommand(program);
|
|
57
|
+
registerLinksCommand(program);
|
|
58
|
+
registerAddCommand(program);
|
|
59
|
+
registerRemoveCommand(program);
|
|
60
|
+
registerMoveCommand(program);
|
|
61
|
+
registerCreateCommand(program);
|
|
62
|
+
registerNavCommand(program);
|
|
63
|
+
registerAssetCommand(program);
|
|
64
|
+
registerTypesCommand(program);
|
|
65
|
+
registerColoursCommand(program);
|
|
66
|
+
registerEntrySearchCommand(program);
|
|
67
|
+
registerExportConvertedCommand(program);
|
|
68
|
+
registerListCommand(program);
|
|
69
|
+
registerScreenshotCommand(program);
|
|
70
|
+
registerSkillCommand(program);
|
|
71
|
+
if (process.argv.includes('--docs')) {
|
|
72
|
+
const dir = path.dirname(fileURLToPath(import.meta.url));
|
|
73
|
+
const packageRoot = path.resolve(dir, '..', '..');
|
|
74
|
+
const readmePath = path.join(packageRoot, 'README.md');
|
|
75
|
+
console.log(path.resolve(readmePath));
|
|
76
|
+
process.exit(0);
|
|
77
|
+
}
|
|
78
|
+
// No-arg or "help" → show help and exit 0 (before parseAsync so Commander does not exit 1)
|
|
79
|
+
const argv = process.argv.slice(2);
|
|
80
|
+
let idx = 0;
|
|
81
|
+
let firstPositional;
|
|
82
|
+
while (idx < argv.length) {
|
|
83
|
+
const a = argv[idx];
|
|
84
|
+
if (a === undefined || !a.startsWith('-')) {
|
|
85
|
+
firstPositional = a;
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
if (a === '--config' || a === '--space')
|
|
89
|
+
idx += 2;
|
|
90
|
+
else
|
|
91
|
+
idx += 1;
|
|
92
|
+
}
|
|
93
|
+
if (firstPositional === undefined || firstPositional === 'help') {
|
|
94
|
+
program.outputHelp();
|
|
95
|
+
process.exit(0);
|
|
96
|
+
}
|
|
97
|
+
program.parseAsync(process.argv).catch((err) => {
|
|
98
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
99
|
+
process.exit(1);
|
|
100
|
+
});
|
|
101
|
+
//# sourceMappingURL=cms-edit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cms-edit.js","sourceRoot":"","sources":["../../src/bin/cms-edit.ts"],"names":[],"mappings":";AACA,uFAAuF;AAEvF,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAs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