@se-studio/contentful-cms 2.3.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/HOSTED.md +2 -2
- package/INSTALL.md +14 -136
- package/README.md +27 -54
- package/dist/bin/contentful-cms.js +2 -12
- package/dist/bin/contentful-cms.js.map +1 -1
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +11 -11
- package/dist/cli/program.js.map +1 -1
- package/dist/commands/article-tags-from-json.d.ts +4 -0
- package/dist/commands/article-tags-from-json.d.ts.map +1 -0
- package/dist/commands/article-tags-from-json.js +54 -0
- package/dist/commands/article-tags-from-json.js.map +1 -0
- package/dist/commands/{screenshot.d.ts → bulk-rtf-replace.d.ts} +2 -2
- package/dist/commands/bulk-rtf-replace.d.ts.map +1 -0
- package/dist/commands/bulk-rtf-replace.js +103 -0
- package/dist/commands/bulk-rtf-replace.js.map +1 -0
- package/dist/commands/create-person-from-json.d.ts +4 -0
- package/dist/commands/create-person-from-json.d.ts.map +1 -0
- package/dist/commands/create-person-from-json.js +85 -0
- package/dist/commands/create-person-from-json.js.map +1 -0
- package/dist/commands/create-person.d.ts +4 -0
- package/dist/commands/create-person.d.ts.map +1 -0
- package/dist/commands/create-person.js +56 -0
- package/dist/commands/create-person.js.map +1 -0
- package/dist/commands/create-taxonomy-from-json.d.ts.map +1 -1
- package/dist/commands/create-taxonomy-from-json.js +47 -31
- package/dist/commands/create-taxonomy-from-json.js.map +1 -1
- package/dist/commands/create-taxonomy.d.ts +2 -0
- package/dist/commands/create-taxonomy.d.ts.map +1 -1
- package/dist/commands/create-taxonomy.js +7 -6
- package/dist/commands/create-taxonomy.js.map +1 -1
- package/dist/commands/ensure.d.ts.map +1 -1
- package/dist/commands/ensure.js +49 -0
- package/dist/commands/ensure.js.map +1 -1
- package/dist/commands/health.d.ts.map +1 -1
- package/dist/commands/health.js +2 -22
- package/dist/commands/health.js.map +1 -1
- package/dist/commands/help.js +1 -1
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/preview.d.ts.map +1 -1
- package/dist/commands/preview.js +63 -16
- package/dist/commands/preview.js.map +1 -1
- package/dist/commands/project.d.ts.map +1 -1
- package/dist/commands/project.js +35 -0
- package/dist/commands/project.js.map +1 -1
- package/dist/config/types.d.ts +3 -3
- package/dist/config/types.d.ts.map +1 -1
- package/dist/contentful/article-tags-from-json.d.ts +25 -0
- package/dist/contentful/article-tags-from-json.d.ts.map +1 -0
- package/dist/contentful/article-tags-from-json.js +121 -0
- package/dist/contentful/article-tags-from-json.js.map +1 -0
- package/dist/contentful/bulk-rtf-replace.d.ts +29 -0
- package/dist/contentful/bulk-rtf-replace.d.ts.map +1 -0
- package/dist/contentful/bulk-rtf-replace.js +119 -0
- package/dist/contentful/bulk-rtf-replace.js.map +1 -0
- package/dist/contentful/entry-fields.d.ts +1 -1
- package/dist/contentful/entry-fields.d.ts.map +1 -1
- package/dist/contentful/entry-fields.js +13 -0
- package/dist/contentful/entry-fields.js.map +1 -1
- package/dist/contentful/person-create.d.ts +31 -0
- package/dist/contentful/person-create.d.ts.map +1 -0
- package/dist/contentful/person-create.js +111 -0
- package/dist/contentful/person-create.js.map +1 -0
- package/dist/editor-pack/capabilities.d.ts +82 -0
- package/dist/editor-pack/capabilities.d.ts.map +1 -0
- package/dist/editor-pack/capabilities.js +350 -0
- package/dist/editor-pack/capabilities.js.map +1 -0
- package/dist/editor-pack/generate.d.ts.map +1 -1
- package/dist/editor-pack/generate.js +57 -15
- package/dist/editor-pack/generate.js.map +1 -1
- 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/hosted/customer-playbooks.d.ts.map +1 -1
- package/dist/hosted/customer-playbooks.js +3 -16
- package/dist/hosted/customer-playbooks.js.map +1 -1
- package/dist/hosted/next/pages/CmsEditPage.d.ts.map +1 -1
- package/dist/hosted/next/pages/CmsEditPage.js +1 -1
- package/dist/hosted/next/pages/CmsEditPage.js.map +1 -1
- package/dist/hosted/next/pages/CustomerPlaybooksPage.d.ts.map +1 -1
- package/dist/hosted/next/pages/CustomerPlaybooksPage.js +12 -3
- package/dist/hosted/next/pages/CustomerPlaybooksPage.js.map +1 -1
- package/dist/hosted/next/pages/HomePage.d.ts.map +1 -1
- package/dist/hosted/next/pages/HomePage.js +1 -1
- package/dist/hosted/next/pages/HomePage.js.map +1 -1
- package/dist/mcp/guide.d.ts +2 -2
- package/dist/mcp/guide.d.ts.map +1 -1
- package/dist/mcp/guide.js +10 -5
- package/dist/mcp/guide.js.map +1 -1
- package/dist/mcp/prompts/onboarding.d.ts.map +1 -1
- package/dist/mcp/prompts/onboarding.js +116 -2
- package/dist/mcp/prompts/onboarding.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -1
- package/dist/mcp/server.d.ts.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 +4 -0
- package/dist/mcp/tools/cms-edit.js.map +1 -1
- package/dist/preview/capture-urls.d.ts +12 -0
- package/dist/preview/capture-urls.d.ts.map +1 -0
- package/dist/preview/capture-urls.js +41 -0
- package/dist/preview/capture-urls.js.map +1 -0
- package/dist/project/doctor.d.ts +9 -0
- package/dist/project/doctor.d.ts.map +1 -0
- package/dist/project/doctor.js +136 -0
- package/dist/project/doctor.js.map +1 -0
- package/docs/FUNCTIONAL_SPEC.md +4 -4
- package/docs/MEDIA_INDEX_PLAN.md +1 -1
- package/docs/SKILLS.md +3 -3
- package/docs/help/article-tags-from-json.md +62 -0
- package/docs/help/bulk-rtf-replace.md +80 -0
- package/docs/help/index.md +18 -2
- package/docs/help/person-from-json.md +82 -0
- package/docs/mcp/hosted-guide.md +15 -4
- package/package.json +2 -5
- package/skills/README.md +1 -1
- package/skills/core/SKILL.md +20 -79
- package/skills/editor-tasks/SKILL.md +83 -0
- package/skills/manifest.json +2 -1
- package/skills/setup/SKILL.md +21 -87
- package/dist/bin/cms-edit-mcp.d.ts +0 -3
- package/dist/bin/cms-edit-mcp.d.ts.map +0 -1
- package/dist/bin/cms-edit-mcp.js +0 -15
- package/dist/bin/cms-edit-mcp.js.map +0 -1
- package/dist/bin/cms-edit-setup.d.ts +0 -3
- package/dist/bin/cms-edit-setup.d.ts.map +0 -1
- package/dist/bin/cms-edit-setup.js +0 -7
- package/dist/bin/cms-edit-setup.js.map +0 -1
- package/dist/commands/screenshot.d.ts.map +0 -1
- package/dist/commands/screenshot.js +0 -275
- package/dist/commands/screenshot.js.map +0 -1
- package/dist/setup/wizard.d.ts +0 -4
- package/dist/setup/wizard.d.ts.map +0 -1
- package/dist/setup/wizard.js +0 -260
- package/dist/setup/wizard.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,50 @@
|
|
|
1
1
|
# @se-studio/contentful-cms Changelog
|
|
2
2
|
|
|
3
|
+
## 2.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- bc538fd: Editor-pack capabilities router (`capabilities.json`, `tasks-index`, task playbooks), batch commands (`article-tags-from-json`, `bulk-rtf-replace`, `create person` / `person-from-json`, `ensure person`), and `cms-edit project doctor`.
|
|
8
|
+
|
|
9
|
+
Hosted-first MCP: setup wizard, `cms-edit setup`, `cms-edit-setup` and `cms-edit-mcp` bins, and local install scripts removed. Editors connect via `/cms-edit` OAuth; developers use `cms-edit` CLI (`npx @se-studio/contentful-cms` aliases the CLI).
|
|
10
|
+
|
|
11
|
+
**Breaking:** Do not use local `mcpServers.cms-edit` or `cms-edit setup` — those entry points are removed.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- bc538fd: chore: dependency updates (contentful-management, live-preview, hubspot api-client, js-yaml, biome js-api)
|
|
16
|
+
|
|
17
|
+
## Unreleased
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- **Editor-pack capabilities router** — `capabilities.json`, `tasks-index.md`, `checklist.md`, and per-task playbooks generated with `editor-pack generate`; `cms-edit project doctor` validates example sites.
|
|
22
|
+
- **Batch commands** — `article-tags-from-json`, `bulk-rtf-replace`, `create person` / `person-from-json`, `ensure person`; taxonomy batch continues on per-item errors with aggregate JSON output.
|
|
23
|
+
- **Hosted-first MCP** — setup wizard, `cms-edit setup`, `cms-edit-setup` bin, and local stdio MCP (`cms-edit-mcp`) removed. Editors use `/cms-edit` OAuth; developers use `cms-edit` CLI. `npx @se-studio/contentful-cms` aliases the CLI.
|
|
24
|
+
|
|
25
|
+
### Breaking Changes
|
|
26
|
+
|
|
27
|
+
- **Removed:** `cms-edit setup`, `cms-edit-setup` bin, `cms-edit-mcp` bin, `install.sh` / `install.ps1` local MCP installers.
|
|
28
|
+
|
|
29
|
+
## 2.4.0
|
|
30
|
+
|
|
31
|
+
### Minor Changes
|
|
32
|
+
|
|
33
|
+
- Remove `cms-edit screenshot` command and agent-browser from cms-edit install/health docs. Add `preview url` / `preview showcase` for preview URLs (open with browser MCP). Refactor `cms-capture-screenshots` to call `cms-edit preview showcase --json` and drive agent-browser directly (no npm dependency on contentful-cms).
|
|
34
|
+
|
|
35
|
+
**Breaking:** `cms-edit screenshot` is removed (no `@ref`, `--json-file`, `--live`, or viewport flags). Use `preview url` / `preview showcase` instead. Guidelines PNG capture stays on `cms-capture-screenshots` only.
|
|
36
|
+
|
|
3
37
|
## 2.3.0
|
|
4
38
|
|
|
5
39
|
### Minor Changes
|
|
6
40
|
|
|
7
41
|
- Add `cms-edit asset review` to audit visual assets (filename, alt text, dimensions, file size, GIF) from the Preview API index, plus the `contentful-cms-media-review` skill for spreadsheet workflows.
|
|
42
|
+
- Remove `cms-edit screenshot`. Use `cms-edit preview url` and `cms-edit preview showcase` for preview URLs (open with a browser MCP). Guidelines tooling (`cms-capture-screenshots`) shells out to `preview showcase`. Remove agent-browser from install scripts and `cms-edit health`.
|
|
43
|
+
|
|
44
|
+
### Breaking Changes
|
|
45
|
+
|
|
46
|
+
- **Removed:** `cms-edit screenshot` and the `contentful-cms-screenshots` skill. No PNG capture, `@ref` render-json URLs, `--json-file`, `--live`, or `--width`/`--height` via cms-edit.
|
|
47
|
+
- **Replacement:** `cms-edit preview url <slug>` for pages; `cms-edit preview showcase --component|--collection` for showcase mock URLs. CMS guidelines batch capture remains `cms-capture-screenshots` in `@se-studio/project-build` (requires agent-browser).
|
|
8
48
|
|
|
9
49
|
### Patch Changes
|
|
10
50
|
|
package/HOSTED.md
CHANGED
|
@@ -110,6 +110,6 @@ Older deployments used a Claude Desktop **extension** (`.mcpb`) with a manual Co
|
|
|
110
110
|
|
|
111
111
|
---
|
|
112
112
|
|
|
113
|
-
##
|
|
113
|
+
## Developers
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
Local stdio MCP is not supported. Use the hosted connector URL from `/cms-edit`, or run `cms-edit` CLI in a repo with `.contentful-cms.json`. See [INSTALL.md](./INSTALL.md).
|
package/INSTALL.md
CHANGED
|
@@ -1,151 +1,29 @@
|
|
|
1
|
-
# Installing the Contentful CMS Editor for Claude
|
|
1
|
+
# Installing the Contentful CMS Editor for Claude
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Editors connect Claude to Contentful through **hosted cms-edit MCP** — no Node.js, terminal, or personal access token required.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Hosted setup
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|------|-----|--------------|
|
|
9
|
-
| **Hosted** | Content editors on a client site | Claude Desktop Integrations + onboarding URL from SE — **no Node.js** |
|
|
10
|
-
| **Local** | Developers / multi-space workflows | Node.js + setup wizard |
|
|
7
|
+
If SE sent you an **onboarding link** (e.g. `https://your-site.content.se.studio/cms-edit`), follow [HOSTED.md](./HOSTED.md):
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
If SE sent you an **onboarding link** (e.g. `https://your-site.content.se.studio/cms-edit`), follow [HOSTED.md](./HOSTED.md). Connect via Claude Integrations and sign in with Contentful — no terminal, Node.js, or personal access token required.
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## Local setup (developers)
|
|
21
|
-
|
|
22
|
-
### What you'll need
|
|
23
|
-
|
|
24
|
-
- **Contentful Management Token** — a secret key that gives Claude permission to edit content (the setup wizard will discover your Space ID and environments automatically)
|
|
25
|
-
- **Node.js** — required to run the setup wizard and for screenshot support. Download the LTS version from [nodejs.org](https://nodejs.org) if you don't have it
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
### Step 1 — Get your Contentful Management Token
|
|
30
|
-
|
|
31
|
-
1. Log in to [contentful.com](https://app.contentful.com)
|
|
32
|
-
2. Click **Settings** in the top menu → **API keys**
|
|
33
|
-
3. Click the **Content management tokens** tab
|
|
34
|
-
4. Click **Generate personal token**
|
|
35
|
-
5. Give it a name (e.g. `Claude Desktop`) and click **Generate**
|
|
36
|
-
6. **Copy the token now** — you won't be able to see it again
|
|
9
|
+
1. Open the link and click **Connect to Claude**
|
|
10
|
+
2. Confirm the connector in Claude Desktop or claude.ai
|
|
11
|
+
3. Sign in with your Contentful account when prompted
|
|
12
|
+
4. Verify by asking Claude to read the cms-edit **tasks-index**
|
|
37
13
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
### Step 2 — Run the setup wizard
|
|
41
|
-
|
|
42
|
-
Open a terminal and run:
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
npx @se-studio/contentful-cms@latest setup
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
The wizard will:
|
|
49
|
-
1. Ask for your management token (input is hidden)
|
|
50
|
-
2. Automatically discover which Contentful spaces and environments your token has access to
|
|
51
|
-
3. Ask for a short project name and an optional staging URL
|
|
52
|
-
4. Write your config file and update Claude Desktop automatically
|
|
53
|
-
|
|
54
|
-
That's it — no need to find your Space ID manually.
|
|
14
|
+
**Reconnect:** use `/cms-edit` on your site or Claude → Settings → Integrations.
|
|
55
15
|
|
|
56
16
|
---
|
|
57
17
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
Fully quit Claude Desktop and reopen it.
|
|
61
|
-
|
|
62
|
-
- **Mac:** Right-click the Dock icon and choose **Quit** (just closing the window isn't enough)
|
|
63
|
-
- **Windows/Linux:** Close the window and reopen from the Start menu / app launcher
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
### Step 4 — Test it
|
|
68
|
-
|
|
69
|
-
In a new Claude conversation, type:
|
|
70
|
-
|
|
71
|
-
> What Contentful spaces do you have access to?
|
|
72
|
-
|
|
73
|
-
Claude should respond with the space name you chose. If it does, you're all set.
|
|
74
|
-
|
|
75
|
-
---
|
|
76
|
-
|
|
77
|
-
## Adding more spaces later
|
|
78
|
-
|
|
79
|
-
Run the wizard again for each additional space:
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
npx @se-studio/contentful-cms@latest setup
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
Each run merges a new space into your existing config — it won't overwrite spaces you've already set up.
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## Manual setup (if you'd prefer not to use the wizard)
|
|
90
|
-
|
|
91
|
-
<details>
|
|
92
|
-
<summary>Click to expand manual instructions</summary>
|
|
93
|
-
|
|
94
|
-
### Create your config file
|
|
95
|
-
|
|
96
|
-
Create a file called `.contentful-cms.json` in your home folder:
|
|
97
|
-
- **Windows:** `C:\Users\YourName\.contentful-cms.json`
|
|
98
|
-
- **Mac/Linux:** `~/.contentful-cms.json`
|
|
99
|
-
|
|
100
|
-
```json
|
|
101
|
-
{
|
|
102
|
-
"defaultSpace": "my-project",
|
|
103
|
-
"spaces": {
|
|
104
|
-
"my-project": {
|
|
105
|
-
"spaceId": "YOUR_SPACE_ID",
|
|
106
|
-
"environment": "master",
|
|
107
|
-
"managementToken": "YOUR_MANAGEMENT_TOKEN",
|
|
108
|
-
"defaultLocale": "en-US"
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
Replace `my-project` (both places), `YOUR_SPACE_ID`, and `YOUR_MANAGEMENT_TOKEN` with your values.
|
|
115
|
-
|
|
116
|
-
Your Space ID is in Contentful under **Settings → General settings**.
|
|
117
|
-
|
|
118
|
-
**Windows tip:** In Notepad's Save dialog, set "Save as type" to **All Files** so it doesn't add `.txt`.
|
|
119
|
-
|
|
120
|
-
### Configure Claude Desktop
|
|
121
|
-
|
|
122
|
-
Edit the Claude Desktop config file:
|
|
123
|
-
- **Windows:** `C:\Users\YourName\AppData\Roaming\Claude\claude_desktop_config.json`
|
|
124
|
-
- **Mac:** `/Users/YourName/Library/Application Support/Claude/claude_desktop_config.json`
|
|
125
|
-
- **Linux:** `~/.config/Claude/claude_desktop_config.json`
|
|
126
|
-
|
|
127
|
-
Add (or merge) this into the file:
|
|
128
|
-
|
|
129
|
-
```json
|
|
130
|
-
{
|
|
131
|
-
"mcpServers": {
|
|
132
|
-
"cms-edit": {
|
|
133
|
-
"command": "npx",
|
|
134
|
-
"args": ["-y", "@se-studio/contentful-cms@latest"],
|
|
135
|
-
"cwd": "/Users/YourName"
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
Replace `/Users/YourName` with your actual home folder path.
|
|
18
|
+
## Developers
|
|
142
19
|
|
|
143
|
-
|
|
20
|
+
Local stdio MCP and the setup wizard are **not supported**.
|
|
144
21
|
|
|
145
|
-
|
|
22
|
+
- **Content editing via Claude:** use the hosted connector URL from your site's `/cms-edit` page (same as editors).
|
|
23
|
+
- **CLI / agents in a repo:** configure `.contentful-cms.json`, install skills (`npx skills add @se-studio/skills` or `cms-edit skill install`), and read the editor pack before editing. See [README.md](./README.md) and [docs/SKILLS.md](./docs/SKILLS.md).
|
|
146
24
|
|
|
147
25
|
---
|
|
148
26
|
|
|
149
27
|
## Something not working?
|
|
150
28
|
|
|
151
|
-
Get in touch and we'll sort it out together.
|
|
29
|
+
Get in touch and we'll sort it out together.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @se-studio/contentful-cms
|
|
2
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
|
|
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.
|
|
4
4
|
|
|
5
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
6
|
|
|
@@ -17,50 +17,19 @@ pnpm install
|
|
|
17
17
|
pnpm build
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
## MCP Setup (
|
|
20
|
+
## MCP Setup (hosted)
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Editors connect Claude via **hosted cms-edit MCP** (OAuth) — no Node.js or local setup wizard.
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
1. Deploy a thin Next.js host (`cms-edit host scaffold`) or use an existing site host
|
|
25
|
+
2. Configure OAuth env vars (see [HOSTED.md](./HOSTED.md))
|
|
26
|
+
3. Send editors the `/cms-edit` onboarding URL
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
Shared route logic lives in `@se-studio/contentful-cms/hosted/next`. Editor walkthrough: [INSTALL.md](./INSTALL.md).
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
npx @se-studio/contentful-cms@latest setup
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
It discovers your Contentful spaces and environments automatically from your management token, writes `~/.contentful-cms.json`, and updates the Claude Desktop config. See [INSTALL.md](./INSTALL.md) for a full walkthrough.
|
|
33
|
-
|
|
34
|
-
**Hosted mode (no Node.js for editors):** deploy a thin Next.js host to Vercel (`cms-edit host scaffold`), configure OAuth env vars, and send editors your `/cms-edit` onboarding URL plus [HOSTED.md](./HOSTED.md). Shared route logic lives in `@se-studio/contentful-cms/hosted/next`.
|
|
35
|
-
|
|
36
|
-
**Manual config** — if you'd prefer to configure by hand, add this to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
|
|
37
|
-
|
|
38
|
-
```json
|
|
39
|
-
{
|
|
40
|
-
"mcpServers": {
|
|
41
|
-
"cms-edit": {
|
|
42
|
-
"command": "npx",
|
|
43
|
-
"args": ["-y", "@se-studio/contentful-cms@latest"],
|
|
44
|
-
"cwd": "/path/to/your/project"
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
- `cwd` must point to the directory containing your `.contentful-cms.json` (or omit `cwd` and place the file in your home directory — `~/.contentful-cms.json` on macOS/Linux, `C:\Users\<you>\.contentful-cms.json` on Windows).
|
|
51
|
-
- `npx -y @se-studio/contentful-cms` always pulls the latest published version — no global install needed.
|
|
52
|
-
|
|
53
|
-
If you have the package installed globally, you can use `"command": "cms-edit-mcp"` (no `args`) instead.
|
|
54
|
-
|
|
55
|
-
### Claude Code
|
|
30
|
+
**Local stdio MCP is not supported** — do not register `mcpServers.cms-edit` in Claude Desktop. Developers use the hosted connector URL from the site's `/cms-edit` page, or run `cms-edit` (or `npx @se-studio/contentful-cms`) in a repo with `.contentful-cms.json`.
|
|
56
31
|
|
|
57
|
-
|
|
58
|
-
claude mcp add cms-edit -- npx -y @se-studio/contentful-cms
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Then set env vars in your project's `.env.local` (they are picked up automatically via the config's `${ENV_VAR}` syntax).
|
|
62
|
-
|
|
63
|
-
### What the MCP server exposes
|
|
32
|
+
### What hosted MCP exposes
|
|
64
33
|
|
|
65
34
|
A single `cms_edit` tool that accepts an `args` array matching any `cms-edit` CLI command:
|
|
66
35
|
|
|
@@ -123,8 +92,8 @@ Token values use `${ENV_VAR}` syntax and are resolved from your `.env.local` at
|
|
|
123
92
|
|
|
124
93
|
### Deployment Protection Bypass
|
|
125
94
|
|
|
126
|
-
When your dev site is deployed behind Vercel deployment protection (or similar),
|
|
127
|
-
|
|
95
|
+
When your dev site is deployed behind Vercel deployment protection (or similar), commands that
|
|
96
|
+
build URLs from `devBaseUrl` (e.g. `preview url`, `preview showcase`) need to bypass the protection.
|
|
128
97
|
|
|
129
98
|
**Via query parameter** (Vercel protection bypass):
|
|
130
99
|
```json
|
|
@@ -140,7 +109,7 @@ The token is appended as a query parameter to every URL built from `devBaseUrl`.
|
|
|
140
109
|
"x-custom-header": "${CUSTOM_HEADER_VALUE}"
|
|
141
110
|
}
|
|
142
111
|
```
|
|
143
|
-
|
|
112
|
+
`requestHeaders` are read by `cms-capture-screenshots` when driving agent-browser (query bypass uses `requestParams` via `cms-edit preview showcase`).
|
|
144
113
|
|
|
145
114
|
Both `requestParams` and `requestHeaders` values support `${ENV_VAR}` token syntax.
|
|
146
115
|
Set the token values in `.env.local` — they are never committed to version control.
|
|
@@ -257,9 +226,12 @@ For content types that follow the `${contentType}Type` naming convention (e.g. `
|
|
|
257
226
|
| `create from-json --file <path> --dry-run` | Preview the creation plan without writing to Contentful |
|
|
258
227
|
| `create from-json --file <path> --strict` | Fail on unknown JSON keys (also strict on `--dry-run`) |
|
|
259
228
|
| `create taxonomy-from-json --file <path> [--if-not-exists] [--dry-run]` | Batch-create tagType, articleType, and tag entries from JSON |
|
|
229
|
+
| `create person-from-json --file <path> [--if-not-exists] [--dry-run]` | Batch-create person/author entries from JSON |
|
|
230
|
+
| `create person --slug <slug> --name "X" [--job-title <t>] [--json-file <path>] [--if-not-exists] [--dry-run]` | Create a person entry (draft) |
|
|
231
|
+
| `create person … [--bio-markdown <md>]` or `[--bio-file <path>]` | Bio as Markdown (mutually exclusive paths) |
|
|
260
232
|
| `create tag-type --slug <slug> --name "X" [--json-file <path>] [--if-not-exists] [--dry-run]` | Create a tagType entry (draft) |
|
|
261
233
|
| `create article-type --slug <slug> --name "X" [--json-file <path>] [--if-not-exists] [--dry-run]` | Create an articleType entry (draft) |
|
|
262
|
-
| `create tag --slug <slug> --name "X" --tag-type <tagType-slug> [--tag-type-id <id>] [--description <desc>] [--featured-image <asset-id>] [--json-file <path>] [--if-not-exists]` | Create a tag entry (draft) |
|
|
234
|
+
| `create tag --slug <slug> --name "X" --tag-type <tagType-slug> [--tag-type-id <id>] [--description <desc>] [--featured-image <asset-id>] [--json-file <path>] [--if-not-exists] [--dry-run]` | Create a tag entry (draft) |
|
|
263
235
|
| `create template --label "X"` | Create a new template entry |
|
|
264
236
|
| `create media --asset-id <id> --name "X" [--position Left\|Middle\|Right] [--width <1–100>]` | Create a **Media** entry (draft); does not start a new cms-edit session; prints entry ID for `rtf embed` |
|
|
265
237
|
|
|
@@ -276,6 +248,10 @@ For content types that follow the `${contentType}Type` naming convention (e.g. `
|
|
|
276
248
|
| `ensure tag-type --slug <slug> --name "X" [--json-file <path>]` | Create tagType if missing; return existing ID when slug matches |
|
|
277
249
|
| `ensure article-type --slug <slug> --name "X" [--json-file <path>]` | Create articleType if missing |
|
|
278
250
|
| `ensure tag --slug <slug> --name "X" --tag-type <slug> [--description <desc>] [--featured-image <asset-id>] [--json-file <path>]` | Create tag if missing |
|
|
251
|
+
| `ensure person --slug <slug> --name "X" [--job-title <t>] [--json-file <path>]` | Create person if missing |
|
|
252
|
+
| `ensure person … [--bio-markdown <md>]` or `[--bio-file <path>]` | Bio as Markdown (mutually exclusive paths) |
|
|
253
|
+
| `article-tags-from-json --file <path> [--dry-run]` | Set tags on multiple articles from JSON |
|
|
254
|
+
| `bulk-rtf-replace --find <text> --replace-plain <text> [--include page,article] [--prefix <slug>] [--limit <n>] [--dry-run]` | Find-replace plain text in Rich Text across page/article trees |
|
|
279
255
|
|
|
280
256
|
Set `CMS_EDIT_JSON=1` for machine-readable output (`{ ok, id, slug, contentType, status }`).
|
|
281
257
|
|
|
@@ -406,22 +382,19 @@ cms-edit types collection # lists collectionType values
|
|
|
406
382
|
cms-edit types externalComponent # lists externalComponentType values
|
|
407
383
|
```
|
|
408
384
|
|
|
409
|
-
###
|
|
385
|
+
### Preview URLs
|
|
410
386
|
|
|
411
|
-
|
|
387
|
+
Generate URLs for visual checks with a browser MCP (no capture built into cms-edit):
|
|
412
388
|
|
|
413
389
|
| Target | Command |
|
|
414
390
|
|--------|---------|
|
|
415
|
-
|
|
|
416
|
-
|
|
|
417
|
-
|
|
|
418
|
-
| Page | `cms-edit screenshot` (current page) or `cms-edit screenshot /pricing` |
|
|
419
|
-
|
|
420
|
-
**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).
|
|
391
|
+
| Page slug | `cms-edit preview url /pricing` (or `preview url` with an open session) |
|
|
392
|
+
| Component showcase | `cms-edit preview showcase --component HeroSimple` |
|
|
393
|
+
| Collection showcase | `cms-edit preview showcase --collection CardGrid --param backgroundColour=Navy` |
|
|
421
394
|
|
|
422
|
-
|
|
395
|
+
Requires `devBaseUrl` in `.contentful-cms.json`. Use `--json` for machine-readable output.
|
|
423
396
|
|
|
424
|
-
**
|
|
397
|
+
**CMS guidelines batch capture:** `@se-studio/project-build` ships `cms-capture-screenshots` for the guidelines pipeline only (requires agent-browser). Run from the monorepo root: `cms-capture-screenshots --variants /tmp/type-variants.json --app-dir apps/example-se2026`.
|
|
425
398
|
|
|
426
399
|
## Machine-readable Output (`--json`)
|
|
427
400
|
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
if (process.argv[2] === 'setup') {
|
|
5
|
-
const { runSetupWizard } = await import('../setup/wizard.js');
|
|
6
|
-
await runSetupWizard().catch((err) => {
|
|
7
|
-
console.error(err instanceof Error ? err.message : String(err));
|
|
8
|
-
process.exit(1);
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
await import('./cms-edit-mcp.js');
|
|
13
|
-
}
|
|
2
|
+
// Alias for `cms-edit` — `npx @se-studio/contentful-cms` runs the CLI (hosted MCP is via `/cms-edit` OAuth).
|
|
3
|
+
await import('./cms-edit.js');
|
|
14
4
|
export {};
|
|
15
5
|
//# sourceMappingURL=contentful-cms.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentful-cms.js","sourceRoot":"","sources":["../../src/bin/contentful-cms.ts"],"names":[],"mappings":";AACA,
|
|
1
|
+
{"version":3,"file":"contentful-cms.js","sourceRoot":"","sources":["../../src/bin/contentful-cms.ts"],"names":[],"mappings":";AACA,6GAA6G;AAE7G,MAAM,MAAM,CAAC,eAAe,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/cli/program.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/cli/program.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkEpC,MAAM,WAAW,mBAAmB;IAClC,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;CAClC;AAED,wBAAgB,oBAAoB,CAAC,KAAK,GAAE,mBAAwB,GAAG,OAAO,CA2G7E"}
|
package/dist/cli/program.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
/** biome-ignore-all lint/suspicious/noConsole: Console output is intentional in CLI */
|
|
2
2
|
import { Command } from 'commander';
|
|
3
3
|
import { registerAddCommand } from '../commands/add.js';
|
|
4
|
+
import { registerArticleTagsFromJsonCommand } from '../commands/article-tags-from-json.js';
|
|
4
5
|
import { registerAssetCommand } from '../commands/asset.js';
|
|
5
6
|
import { registerAuditCommand } from '../commands/audit.js';
|
|
6
7
|
import { registerBackupCommand } from '../commands/backup.js';
|
|
7
8
|
import { registerBatchCommand } from '../commands/batch.js';
|
|
9
|
+
import { registerBulkRtfReplaceCommand } from '../commands/bulk-rtf-replace.js';
|
|
8
10
|
import { registerColoursCommand } from '../commands/colours.js';
|
|
9
11
|
import { registerCreateCommand } from '../commands/create.js';
|
|
10
12
|
import { registerCreateFromJsonCommand } from '../commands/create-from-json.js';
|
|
13
|
+
import { registerPersonCreateCommands } from '../commands/create-person.js';
|
|
14
|
+
import { registerPersonFromJsonCommand } from '../commands/create-person-from-json.js';
|
|
11
15
|
import { registerTaxonomyCreateCommands } from '../commands/create-taxonomy.js';
|
|
12
16
|
import { registerTaxonomyFromJsonCommand } from '../commands/create-taxonomy-from-json.js';
|
|
13
17
|
import { registerCustomerCommand } from '../commands/customer.js';
|
|
@@ -39,7 +43,6 @@ import { registerRtfCommand } from '../commands/rtf.js';
|
|
|
39
43
|
import { registerRunCommand } from '../commands/run.js';
|
|
40
44
|
import { registerSaveCommand } from '../commands/save.js';
|
|
41
45
|
import { registerSchemaCommand } from '../commands/schema.js';
|
|
42
|
-
import { registerScreenshotCommand } from '../commands/screenshot.js';
|
|
43
46
|
import { registerSetCommand } from '../commands/set.js';
|
|
44
47
|
import { registerSitemapCommand } from '../commands/sitemap.js';
|
|
45
48
|
import { registerSkillCommand } from '../commands/skill.js';
|
|
@@ -47,16 +50,16 @@ import { registerSnapshotCommand } from '../commands/snapshot.js';
|
|
|
47
50
|
import { registerTypesCommand } from '../commands/types.js';
|
|
48
51
|
import { registerVersionCommand } from '../commands/version.js';
|
|
49
52
|
import { setJsonMode } from '../output/mode.js';
|
|
50
|
-
import { runSetupWizard } from '../setup/wizard.js';
|
|
51
53
|
import { beginTelemetryCommand, recordTelemetryOutcome } from '../telemetry/index.js';
|
|
52
54
|
import { CMS_EDIT_VERSION } from '../version.js';
|
|
53
55
|
const LLM_INTRO = 'Opinionated CLI for editing Contentful draft content (pages, articles, templates, navigation). No publish — all saves create drafts.\n' +
|
|
54
56
|
'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' +
|
|
55
|
-
'Detailed help: cms-edit help <topic> Topics: workflow, create-from-json, taxonomy-from-json, run, fields, fields-page, fields-article, fields-component, fields-collection, fields-taxonomy\n' +
|
|
57
|
+
'Detailed help: cms-edit help <topic> Topics: workflow, create-from-json, taxonomy-from-json, person-from-json, article-tags-from-json, bulk-rtf-replace, run, fields, fields-page, fields-article, fields-component, fields-collection, fields-taxonomy\n' +
|
|
56
58
|
'Single-shot page/article creation: cms-edit help create-from-json\n' +
|
|
57
59
|
'Taxonomy bootstrap: cms-edit help taxonomy-from-json\n' +
|
|
60
|
+
'Author import: cms-edit help person-from-json\n' +
|
|
58
61
|
'Full README: cms-edit --docs. Install skills: cms-edit skill install.\n' +
|
|
59
|
-
'
|
|
62
|
+
'Visual checks: cms-edit preview url <slug> or cms-edit preview showcase --component <type> (use browser MCP to open the URL).';
|
|
60
63
|
export function createCmsEditProgram(hooks = {}) {
|
|
61
64
|
const program = new Command('cms-edit');
|
|
62
65
|
program
|
|
@@ -110,8 +113,12 @@ export function createCmsEditProgram(hooks = {}) {
|
|
|
110
113
|
registerRevertCommand(program);
|
|
111
114
|
const createCmd = registerCreateCommand(program);
|
|
112
115
|
registerTaxonomyCreateCommands(createCmd, program);
|
|
116
|
+
registerPersonCreateCommands(createCmd, program);
|
|
113
117
|
registerCreateFromJsonCommand(createCmd);
|
|
114
118
|
registerTaxonomyFromJsonCommand(createCmd, program);
|
|
119
|
+
registerPersonFromJsonCommand(createCmd, program);
|
|
120
|
+
registerArticleTagsFromJsonCommand(program);
|
|
121
|
+
registerBulkRtfReplaceCommand(program);
|
|
115
122
|
registerEnsureCommand(program);
|
|
116
123
|
registerNavCommand(program);
|
|
117
124
|
registerAssetCommand(program);
|
|
@@ -129,7 +136,6 @@ export function createCmsEditProgram(hooks = {}) {
|
|
|
129
136
|
registerIndexCommand(program);
|
|
130
137
|
registerResolveCommand(program);
|
|
131
138
|
registerPreviewCommand(program);
|
|
132
|
-
registerScreenshotCommand(program);
|
|
133
139
|
registerRunCommand(program);
|
|
134
140
|
registerSitemapCommand(program);
|
|
135
141
|
registerSkillCommand(program);
|
|
@@ -137,12 +143,6 @@ export function createCmsEditProgram(hooks = {}) {
|
|
|
137
143
|
registerEditorPackCommand(program);
|
|
138
144
|
registerHostCommand(program);
|
|
139
145
|
registerHelpCommand(program);
|
|
140
|
-
program
|
|
141
|
-
.command('setup')
|
|
142
|
-
.description('Interactive wizard to configure Claude Desktop with your Contentful credentials')
|
|
143
|
-
.action(async () => {
|
|
144
|
-
await runSetupWizard();
|
|
145
|
-
});
|
|
146
146
|
program.parseAsync = wrapParseAsync(program.parseAsync.bind(program), (err) => {
|
|
147
147
|
recordTelemetryOutcome('error', {
|
|
148
148
|
exitCode: 1,
|
package/dist/cli/program.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"program.js","sourceRoot":"","sources":["../../src/cli/program.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAA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O,CAAC,CAAC;IACnC,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAC7B,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAE7B,OAAO,CAAC,UAAU,GAAG,cAAc,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE;QAC5E,sBAAsB,CAAC,OAAO,EAAE;YAC9B,QAAQ,EAAE,CAAC;YACX,SAAS,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;SACxE,CAAC,CAAC;QACH,KAAK,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,cAAc,CACrB,QAA+B,EAC/B,OAA+B;IAE/B,OAAO,KAAK,EAAE,GAAG,IAAuC,EAAE,EAAE;QAC1D,IAAI,CAAC;YACH,OAAO,MAAM,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;QACjC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,CAAC;YACb,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"article-tags-from-json.d.ts","sourceRoot":"","sources":["../../src/commands/article-tags-from-json.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAGvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYzC,wBAAgB,kCAAkC,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsDzE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** biome-ignore-all lint/suspicious/noConsole: Console output is intentional in CLI */
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import { runArticleTagsFromJson, } from '../contentful/article-tags-from-json.js';
|
|
4
|
+
import { isJsonMode } from '../output/mode.js';
|
|
5
|
+
import { errorMsg, infoMsg, warnMsg } from '../output/print.js';
|
|
6
|
+
export function registerArticleTagsFromJsonCommand(program) {
|
|
7
|
+
program
|
|
8
|
+
.command('article-tags-from-json')
|
|
9
|
+
.description('Set tags on one or more articles from a JSON file.\n' +
|
|
10
|
+
'Resolves tag slugs via the local index (run index sync first).\n' +
|
|
11
|
+
'Continues on per-item errors and reports successes and failures.')
|
|
12
|
+
.option('--file <path>', 'Path to article-tags JSON file (required)')
|
|
13
|
+
.option('--dry-run', 'Validate and preview without saving')
|
|
14
|
+
.action(async (opts) => {
|
|
15
|
+
const parentOpts = program.opts();
|
|
16
|
+
if (!opts.file) {
|
|
17
|
+
errorMsg('--file is required.');
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
let spec;
|
|
21
|
+
try {
|
|
22
|
+
spec = JSON.parse(readFileSync(opts.file, 'utf8'));
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
errorMsg(`Could not read or parse JSON file "${opts.file}".`);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
const batch = await runArticleTagsFromJson({
|
|
29
|
+
items: spec.articles ?? [],
|
|
30
|
+
dryRun: opts.dryRun,
|
|
31
|
+
configPath: parentOpts.config,
|
|
32
|
+
spaceKey: parentOpts.space,
|
|
33
|
+
});
|
|
34
|
+
const { results } = batch;
|
|
35
|
+
const updated = results.filter((r) => r.status === 'updated').length;
|
|
36
|
+
const failed = results.filter((r) => r.status === 'failed');
|
|
37
|
+
if (isJsonMode()) {
|
|
38
|
+
console.log(JSON.stringify({ ok: batch.ok, articles: results }));
|
|
39
|
+
}
|
|
40
|
+
else if (!opts.dryRun) {
|
|
41
|
+
infoMsg(`Updated tags on ${String(updated)} article(s); ${String(results.length - updated - failed.length)} unchanged/skipped.`);
|
|
42
|
+
if (failed.length > 0) {
|
|
43
|
+
warnMsg(`${String(failed.length)} article(s) failed:`);
|
|
44
|
+
for (const row of failed) {
|
|
45
|
+
warnMsg(` ${row.articleSlug}: ${row.message ?? 'unknown error'}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (!batch.ok) {
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=article-tags-from-json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"article-tags-from-json.js","sourceRoot":"","sources":["../../src/commands/article-tags-from-json.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAEL,sBAAsB,GACvB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAMhE,MAAM,UAAU,kCAAkC,CAAC,OAAgB;IACjE,OAAO;SACJ,OAAO,CAAC,wBAAwB,CAAC;SACjC,WAAW,CACV,sDAAsD;QACpD,kEAAkE;QAClE,kEAAkE,CACrE;SACA,MAAM,CAAC,eAAe,EAAE,2CAA2C,CAAC;SACpE,MAAM,CAAC,WAAW,EAAE,qCAAqC,CAAC;SAC1D,MAAM,CAAC,KAAK,EAAE,IAAyC,EAAE,EAAE;QAC1D,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,EAAuC,CAAC;QACvE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACf,QAAQ,CAAC,qBAAqB,CAAC,CAAC;YAChC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,IAAI,IAA0B,CAAC;QAC/B,IAAI,CAAC;YACH,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,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AC,CAAC;gBACvD,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;oBACzB,OAAO,CAAC,KAAK,GAAG,CAAC,WAAW,KAAK,GAAG,CAAC,OAAO,IAAI,eAAe,EAAE,CAAC,CAAC;gBACrE,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;YACd,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** biome-ignore-all lint/suspicious/noConsole: Console output is intentional in CLI */
|
|
2
2
|
import type { Command } from 'commander';
|
|
3
|
-
export declare function
|
|
4
|
-
//# sourceMappingURL=
|
|
3
|
+
export declare function registerBulkRtfReplaceCommand(program: Command): void;
|
|
4
|
+
//# sourceMappingURL=bulk-rtf-replace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bulk-rtf-replace.d.ts","sourceRoot":"","sources":["../../src/commands/bulk-rtf-replace.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAazC,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuIpE"}
|