@prenta/cli 1.2.1 β†’ 1.3.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.
@@ -1,4 +1,4 @@
1
1
 
2
- > @prenta/cli@1.2.1 build /home/runner/work/prenta/prenta/packages/cli
2
+ > @prenta/cli@1.3.0 build /home/runner/work/prenta/prenta/packages/cli
3
3
  > tsc
4
4
 
@@ -1,83 +1,69 @@
1
1
 
2
- > @prenta/cli@1.2.1 test /home/runner/work/prenta/prenta/packages/cli
2
+ > @prenta/cli@1.3.0 test /home/runner/work/prenta/prenta/packages/cli
3
3
  > vitest run "--no-file-parallelism"
4
4
 
5
5
 
6
6
   RUN  v4.1.12 /home/runner/work/prenta/prenta/packages/cli
7
7
 
8
- βœ“ src/__tests__/db-restore.test.ts (34 tests) 6089ms
9
- βœ“ requires --target and never defaults to the env database  301ms
10
- βœ“ warns when --target carries a password on argv and recommends PGPASSWORD instead  406ms
11
- βœ“ OIDC mode (VERCEL_OIDC_TOKEN + BLOB_STORE_ID) lists and restores without passing a token  445ms
12
- βœ“ src/__tests__/db-backup.test.ts (27 tests) 5183ms
13
- βœ“ writes the workflow YAML verbatim and exits 0 without touching the database  384ms
14
- βœ“ refuses localhost / 127.0.0.1 unless --allow-local  364ms
15
- βœ“ dumps with the exact argv, encrypts, and writes a verifiable manifest  340ms
16
- βœ“ uploads manifest then dump under the prefix, then prunes expired pairs  372ms
17
- βœ“ src/__tests__/deployment-diagnostics.test.ts (23 tests) 286ms
18
- βœ“ src/__tests__/backup-blob-store.test.ts (18 tests) 1130ms
19
- βœ“ src/__tests__/backup-pg-tools.test.ts (26 tests) 469ms
20
- βœ“ src/__tests__/db-sync.test.ts (13 tests) 1002ms
21
- βœ“ refreshes an auto-synced schema and adds missing migrations  313ms
22
- βœ“ src/__tests__/chrome.test.ts (11 tests) 20012ms
8
+ βœ“ src/__tests__/db-restore.test.ts (34 tests) 6914ms
9
+ βœ“ requires --target and never defaults to the env database  402ms
10
+ βœ“ warns when --target carries a password on argv and recommends PGPASSWORD instead  367ms
11
+ βœ“ OIDC mode (VERCEL_OIDC_TOKEN + BLOB_STORE_ID) lists and restores without passing a token  627ms
12
+ βœ“ compares the typed name against the normalized database name and never accepts an empty answer  303ms
13
+ βœ“ src/__tests__/db-backup.test.ts (27 tests) 4810ms
14
+ βœ“ writes the workflow YAML verbatim and exits 0 without touching the database  594ms
15
+ βœ“ refuses localhost / 127.0.0.1 unless --allow-local  724ms
16
+ βœ“ dumps with the exact argv, encrypts, and writes a verifiable manifest  387ms
17
+ βœ“ src/__tests__/deployment-diagnostics.test.ts (23 tests) 315ms
18
+ βœ“ src/__tests__/backup-blob-store.test.ts (18 tests) 1045ms
19
+ βœ“ src/__tests__/backup-pg-tools.test.ts (26 tests) 502ms
20
+ βœ“ src/__tests__/db-sync.test.ts (13 tests) 923ms
21
+ βœ“ refreshes an auto-synced schema and adds missing migrations  306ms
22
+ βœ“ src/__tests__/chrome.test.ts (11 tests) 18141ms
23
23
  ↓ src/__tests__/integration/backup-roundtrip.int.test.ts (1 test | 1 skipped)
24
- βœ“ src/__tests__/backup-manifest.test.ts (17 tests) 127ms
24
+ βœ“ src/__tests__/backup-manifest.test.ts (17 tests) 82ms
25
25
  - Resolving target versions…
26
26
  βœ” Target version: 9.0.0
27
- βœ“ src/__tests__/upgrade-workspaces.test.ts (12 tests) 3614ms
28
- βœ“ passes `upgrade --version <ver>` to upgrade instead of printing the CLI version  1988ms
29
- βœ“ prints its own package version for `prenta --version`  1399ms
30
- βœ“ src/__tests__/seed.test.ts (10 tests) 180ms
31
- βœ“ src/__tests__/backup-crypto.test.ts (13 tests) 329ms
32
- βœ“ src/__tests__/backup-common.test.ts (14 tests) 52ms
33
- - Reading canonical Prenta schema...
34
- stdout | src/__tests__/db-init.test.ts > db:init (WS-D D5 β€” canonical schema, no stale fragment) > command > injects canonical models with @@map and no duplicate datasource/generator
35
- βœ” Prisma client generated.
36
- β„Ή Run `npx prisma migrate dev --name prenta-cms` to create the migration.
37
-
38
- βœ” Prenta CMS models added to schema.
39
- - Running prisma generate...
40
- - Reading canonical Prenta schema...
41
- βœ– Could not locate @prenta/core.
42
- stdout | src/__tests__/db-init.test.ts > db:init (WS-D D5 β€” canonical schema, no stale fragment) > command > fails clearly when cms-core cannot be located
43
- β„Ή Install it first: `npm install @prenta/core`.
44
-
45
- - Reading canonical Prenta schema...
46
- stdout | src/__tests__/db-init.test.ts > db:init (WS-D D5 β€” canonical schema, no stale fragment) > command > is idempotent without --force
47
- βœ” Prenta CMS models added to schema.
48
- - Running prisma generate...
49
- βœ” Prisma client generated.
50
- β„Ή Run `npx prisma migrate dev --name prenta-cms` to create the migration.
51
-
52
- - Reading canonical Prenta schema...
53
- β„Ή Prenta CMS models already present in schema. Use --force to overwrite.
54
- βœ“ src/__tests__/db-init.test.ts (4 tests) 230ms
55
- stdout | src/__tests__/mcp-init.test.ts > mcp:init > creates both editor configs with placeholder key and git-ignores them
27
+ βœ“ src/__tests__/upgrade-workspaces.test.ts (12 tests) 3839ms
28
+ βœ“ passes `upgrade --version <ver>` to upgrade instead of printing the CLI version  2227ms
29
+ βœ“ prints its own package version for `prenta --version`  1426ms
30
+ βœ“ src/__tests__/seed.test.ts (10 tests) 85ms
31
+ βœ“ src/__tests__/backup-crypto.test.ts (13 tests) 260ms
32
+ stdout | src/__tests__/mcp-init.test.ts > mcp:init > creates Claude Code, Cursor, and VS Code configs with placeholder key and git-ignores them
33
+ βœ” Created .mcp.json
34
+
35
+ stdout | src/__tests__/mcp-init.test.ts > mcp:init > creates Claude Code, Cursor, and VS Code configs with placeholder key and git-ignores them
56
36
  βœ” Created .cursor/mcp.json
57
37
 
58
- stdout | src/__tests__/mcp-init.test.ts > mcp:init > creates both editor configs with placeholder key and git-ignores them
38
+ stdout | src/__tests__/mcp-init.test.ts > mcp:init > creates Claude Code, Cursor, and VS Code configs with placeholder key and git-ignores them
59
39
  βœ” Created .vscode/mcp.json
60
40
 
61
- stdout | src/__tests__/mcp-init.test.ts > mcp:init > creates both editor configs with placeholder key and git-ignores them
62
- βœ” Added to .gitignore: .cursor/mcp.json, .vscode/mcp.json
41
+ stdout | src/__tests__/mcp-init.test.ts > mcp:init > creates Claude Code, Cursor, and VS Code configs with placeholder key and git-ignores them
42
+ βœ” Added to .gitignore: .mcp.json, .cursor/mcp.json, .vscode/mcp.json
63
43
 
64
44
  Next steps
65
45
  1. Mint an API key in Admin β†’ Settings β†’ API Keys (act_sk_...)
66
- 2. Replace act_sk_REPLACE_WITH_YOUR_KEY in both config files with the real key
67
- 3. Restart Cursor / VS Code so the MCP server is picked up
46
+ 2. Replace act_sk_REPLACE_WITH_YOUR_KEY in the MCP config files with the real key
47
+ 3. Restart Claude Code / Cursor / VS Code so the MCP server is picked up
68
48
  Tip: pass --url https://your-site.com to target a deployed CMS instead.
69
49
 
70
- stdout | src/__tests__/mcp-init.test.ts > mcp:init > applies --url and --key to both configs
50
+ stdout | src/__tests__/mcp-init.test.ts > mcp:init > applies --url and --key to all three configs
51
+ βœ” Created .mcp.json
52
+
53
+ stdout | src/__tests__/mcp-init.test.ts > mcp:init > applies --url and --key to all three configs
71
54
  βœ” Created .cursor/mcp.json
72
55
 
73
- stdout | src/__tests__/mcp-init.test.ts > mcp:init > applies --url and --key to both configs
56
+ stdout | src/__tests__/mcp-init.test.ts > mcp:init > applies --url and --key to all three configs
74
57
  βœ” Created .vscode/mcp.json
75
58
 
76
- stdout | src/__tests__/mcp-init.test.ts > mcp:init > applies --url and --key to both configs
77
- βœ” Added to .gitignore: .cursor/mcp.json, .vscode/mcp.json
59
+ stdout | src/__tests__/mcp-init.test.ts > mcp:init > applies --url and --key to all three configs
60
+ βœ” Added to .gitignore: .mcp.json, .cursor/mcp.json, .vscode/mcp.json
78
61
 
79
62
  Next steps
80
- 1. Restart Cursor / VS Code so the MCP server is picked up
63
+ 1. Restart Claude Code / Cursor / VS Code so the MCP server is picked up
64
+
65
+ stdout | src/__tests__/mcp-init.test.ts > mcp:init > merges into an existing config without clobbering other servers
66
+ βœ” Updated .mcp.json
81
67
 
82
68
  stdout | src/__tests__/mcp-init.test.ts > mcp:init > merges into an existing config without clobbering other servers
83
69
  βœ” Updated .cursor/mcp.json
@@ -86,14 +72,17 @@ Next steps
86
72
  βœ” Created .vscode/mcp.json
87
73
 
88
74
  stdout | src/__tests__/mcp-init.test.ts > mcp:init > merges into an existing config without clobbering other servers
89
- βœ” Added to .gitignore: .cursor/mcp.json, .vscode/mcp.json
75
+ βœ” Added to .gitignore: .mcp.json, .cursor/mcp.json, .vscode/mcp.json
90
76
 
91
77
  Next steps
92
78
  1. Mint an API key in Admin β†’ Settings β†’ API Keys (act_sk_...)
93
- 2. Replace act_sk_REPLACE_WITH_YOUR_KEY in both config files with the real key
94
- 3. Restart Cursor / VS Code so the MCP server is picked up
79
+ 2. Replace act_sk_REPLACE_WITH_YOUR_KEY in the MCP config files with the real key
80
+ 3. Restart Claude Code / Cursor / VS Code so the MCP server is picked up
95
81
  Tip: pass --url https://your-site.com to target a deployed CMS instead.
96
82
 
83
+ stdout | src/__tests__/mcp-init.test.ts > mcp:init > leaves an existing prenta entry alone unless --force is passed
84
+ βœ” Created .mcp.json
85
+
97
86
  stderr | src/__tests__/mcp-init.test.ts > mcp:init > leaves an existing prenta entry alone unless --force is passed
98
87
  ⚠ .cursor/mcp.json already has an "prenta" server β€” use --force to replace it.
99
88
 
@@ -101,14 +90,17 @@ Next steps
101
90
  βœ” Created .vscode/mcp.json
102
91
 
103
92
  stdout | src/__tests__/mcp-init.test.ts > mcp:init > leaves an existing prenta entry alone unless --force is passed
104
- βœ” Added to .gitignore: .cursor/mcp.json, .vscode/mcp.json
93
+ βœ” Added to .gitignore: .mcp.json, .cursor/mcp.json, .vscode/mcp.json
105
94
 
106
95
  Next steps
107
96
  1. Mint an API key in Admin β†’ Settings β†’ API Keys (act_sk_...)
108
- 2. Replace act_sk_REPLACE_WITH_YOUR_KEY in both config files with the real key
109
- 3. Restart Cursor / VS Code so the MCP server is picked up
97
+ 2. Replace act_sk_REPLACE_WITH_YOUR_KEY in the MCP config files with the real key
98
+ 3. Restart Claude Code / Cursor / VS Code so the MCP server is picked up
110
99
  Tip: pass --url https://your-site.com to target a deployed CMS instead.
111
100
 
101
+ stdout | src/__tests__/mcp-init.test.ts > mcp:init > leaves an existing prenta entry alone unless --force is passed
102
+ βœ” Updated .mcp.json
103
+
112
104
  stdout | src/__tests__/mcp-init.test.ts > mcp:init > leaves an existing prenta entry alone unless --force is passed
113
105
  βœ” Updated .cursor/mcp.json
114
106
 
@@ -119,24 +111,30 @@ Next steps
119
111
  
120
112
  Next steps
121
113
  1. Mint an API key in Admin β†’ Settings β†’ API Keys (act_sk_...)
122
- 2. Replace act_sk_REPLACE_WITH_YOUR_KEY in both config files with the real key
123
- 3. Restart Cursor / VS Code so the MCP server is picked up
114
+ 2. Replace act_sk_REPLACE_WITH_YOUR_KEY in the MCP config files with the real key
115
+ 3. Restart Claude Code / Cursor / VS Code so the MCP server is picked up
124
116
 
125
- stderr | src/__tests__/mcp-init.test.ts > mcp:init > fails on invalid JSON without --force, overwrites with --force
126
- βœ– .cursor/mcp.json contains invalid JSON β€” fix it or re-run with --force.
117
+ stdout | src/__tests__/mcp-init.test.ts > mcp:init > fails on invalid JSON without --force, overwrites with --force
118
+ βœ” Created .mcp.json
127
119
 
128
120
  stdout | src/__tests__/mcp-init.test.ts > mcp:init > fails on invalid JSON without --force, overwrites with --force
121
+ stderr | src/__tests__/mcp-init.test.ts > mcp:init > fails on invalid JSON without --force, overwrites with --force
122
+ βœ– .cursor/mcp.json contains invalid JSON β€” fix it or re-run with --force.
129
123
  βœ” Created .vscode/mcp.json
130
124
 
125
+
131
126
  stdout | src/__tests__/mcp-init.test.ts > mcp:init > fails on invalid JSON without --force, overwrites with --force
132
- βœ” Added to .gitignore: .cursor/mcp.json, .vscode/mcp.json
127
+ βœ” Added to .gitignore: .mcp.json, .cursor/mcp.json, .vscode/mcp.json
133
128
 
134
129
  Next steps
135
130
  1. Mint an API key in Admin β†’ Settings β†’ API Keys (act_sk_...)
136
- 2. Replace act_sk_REPLACE_WITH_YOUR_KEY in both config files with the real key
137
- 3. Restart Cursor / VS Code so the MCP server is picked up
131
+ 2. Replace act_sk_REPLACE_WITH_YOUR_KEY in the MCP config files with the real key
132
+ 3. Restart Claude Code / Cursor / VS Code so the MCP server is picked up
138
133
  Tip: pass --url https://your-site.com to target a deployed CMS instead.
139
134
 
135
+ stdout | src/__tests__/mcp-init.test.ts > mcp:init > fails on invalid JSON without --force, overwrites with --force
136
+ βœ” Updated .mcp.json
137
+
140
138
  stdout | src/__tests__/mcp-init.test.ts > mcp:init > fails on invalid JSON without --force, overwrites with --force
141
139
  βœ” Updated .cursor/mcp.json
142
140
 
@@ -147,10 +145,46 @@ Next steps
147
145
  
148
146
  Next steps
149
147
  1. Mint an API key in Admin β†’ Settings β†’ API Keys (act_sk_...)
150
- 2. Replace act_sk_REPLACE_WITH_YOUR_KEY in both config files with the real key
151
- 3. Restart Cursor / VS Code so the MCP server is picked up
148
+ 2. Replace act_sk_REPLACE_WITH_YOUR_KEY in the MCP config files with the real key
149
+ 3. Restart Claude Code / Cursor / VS Code so the MCP server is picked up
152
150
  Tip: pass --url https://your-site.com to target a deployed CMS instead.
153
151
 
152
+ stderr | src/__tests__/mcp-init.test.ts > mcp:init > refuses to write a real key into a config git already tracks
153
+ βœ– .mcp.json is tracked by git, so the key was not written to it. Run "git rm --cached .mcp.json" and commit, then re-run this command.
154
+
155
+ stdout | src/__tests__/mcp-init.test.ts > mcp:init > refuses to write a real key into a config git already tracks
156
+ βœ” Created .cursor/mcp.json
157
+
158
+ stdout | src/__tests__/mcp-init.test.ts > mcp:init > refuses to write a real key into a config git already tracks
159
+ βœ” Created .vscode/mcp.json
160
+
161
+ stdout | src/__tests__/mcp-init.test.ts > mcp:init > refuses to write a real key into a config git already tracks
162
+ βœ” Added to .gitignore: .mcp.json, .cursor/mcp.json, .vscode/mcp.json
163
+
164
+ Next steps
165
+ 1. Restart Claude Code / Cursor / VS Code so the MCP server is picked up
166
+ Tip: pass --url https://your-site.com to target a deployed CMS instead.
167
+
168
+ stdout | src/__tests__/mcp-init.test.ts > mcp:init > refuses to write a real key into a config git already tracks
169
+ βœ” Updated .mcp.json
170
+
171
+ stderr | src/__tests__/mcp-init.test.ts > mcp:init > refuses to write a real key into a config git already tracks
172
+ ⚠ .cursor/mcp.json already has an "prenta" server β€” use --force to replace it.
173
+
174
+ stderr | src/__tests__/mcp-init.test.ts > mcp:init > refuses to write a real key into a config git already tracks
175
+ ⚠ .vscode/mcp.json already has an "prenta" server β€” use --force to replace it.
176
+
177
+ stdout | src/__tests__/mcp-init.test.ts > mcp:init > refuses to write a real key into a config git already tracks
178
+ 
179
+ Next steps
180
+ 1. Mint an API key in Admin β†’ Settings β†’ API Keys (act_sk_...)
181
+ 2. Replace act_sk_REPLACE_WITH_YOUR_KEY in the MCP config files with the real key
182
+ 3. Restart Claude Code / Cursor / VS Code so the MCP server is picked up
183
+ Tip: pass --url https://your-site.com to target a deployed CMS instead.
184
+
185
+ stdout | src/__tests__/mcp-init.test.ts > mcp:init > does not duplicate gitignore entries on re-runs
186
+ βœ” Created .mcp.json
187
+
154
188
  stdout | src/__tests__/mcp-init.test.ts > mcp:init > does not duplicate gitignore entries on re-runs
155
189
  βœ” Created .cursor/mcp.json
156
190
 
@@ -158,14 +192,17 @@ Next steps
158
192
  βœ” Created .vscode/mcp.json
159
193
 
160
194
  stdout | src/__tests__/mcp-init.test.ts > mcp:init > does not duplicate gitignore entries on re-runs
161
- βœ” Added to .gitignore: .cursor/mcp.json, .vscode/mcp.json
195
+ βœ” Added to .gitignore: .mcp.json, .cursor/mcp.json, .vscode/mcp.json
162
196
 
163
197
  Next steps
164
198
  1. Mint an API key in Admin β†’ Settings β†’ API Keys (act_sk_...)
165
- 2. Replace act_sk_REPLACE_WITH_YOUR_KEY in both config files with the real key
166
- 3. Restart Cursor / VS Code so the MCP server is picked up
199
+ 2. Replace act_sk_REPLACE_WITH_YOUR_KEY in the MCP config files with the real key
200
+ 3. Restart Claude Code / Cursor / VS Code so the MCP server is picked up
167
201
  Tip: pass --url https://your-site.com to target a deployed CMS instead.
168
202
 
203
+ stdout | src/__tests__/mcp-init.test.ts > mcp:init > does not duplicate gitignore entries on re-runs
204
+ βœ” Updated .mcp.json
205
+
169
206
  stdout | src/__tests__/mcp-init.test.ts > mcp:init > does not duplicate gitignore entries on re-runs
170
207
  βœ” Updated .cursor/mcp.json
171
208
 
@@ -176,21 +213,44 @@ Next steps
176
213
  
177
214
  Next steps
178
215
  1. Mint an API key in Admin β†’ Settings β†’ API Keys (act_sk_...)
179
- 2. Replace act_sk_REPLACE_WITH_YOUR_KEY in both config files with the real key
180
- 3. Restart Cursor / VS Code so the MCP server is picked up
216
+ 2. Replace act_sk_REPLACE_WITH_YOUR_KEY in the MCP config files with the real key
217
+ 3. Restart Claude Code / Cursor / VS Code so the MCP server is picked up
181
218
  Tip: pass --url https://your-site.com to target a deployed CMS instead.
182
219
 
183
- βœ“ src/__tests__/mcp-init.test.ts (6 tests) 292ms
184
- βœ“ src/__tests__/seed-sanitize.test.ts (9 tests) 59ms
185
- βœ“ src/__tests__/prisma-client-path.test.ts (8 tests) 70ms
186
- βœ“ src/__tests__/form-seed.test.ts (10 tests) 41ms
187
- βœ“ src/__tests__/import-typescript.test.ts (9 tests) 413ms
188
- βœ“ loads a TypeScript file that imports a sibling without appending ?namespace=  366ms
189
- βœ“ src/__tests__/vercel-env-matrix.test.ts (6 tests) 61ms
190
- βœ“ src/__tests__/upgrade.test.ts (3 tests) 25ms
191
- βœ“ src/__tests__/repo-root.test.ts (4 tests) 40ms
192
- βœ“ src/__tests__/load-dotenv.test.ts (3 tests) 42ms
193
- βœ“ src/__tests__/import-typescript-hooks.test.ts (2 tests) 73ms
220
+ βœ“ src/__tests__/mcp-init.test.ts (7 tests) 450ms
221
+ βœ“ src/__tests__/backup-common.test.ts (14 tests) 31ms
222
+ - Reading canonical Prenta schema...
223
+ βœ” Prenta CMS models added to schema.
224
+ - Running prisma generate...
225
+ stdout | src/__tests__/db-init.test.ts > db:init (WS-D D5 β€” canonical schema, no stale fragment) > command > injects canonical models with @@map and no duplicate datasource/generator
226
+ βœ” Prisma client generated.
227
+ β„Ή Run `npx prisma migrate dev --name prenta-cms` to create the migration.
228
+
229
+ stdout | src/__tests__/db-init.test.ts > db:init (WS-D D5 β€” canonical schema, no stale fragment) > command > fails clearly when cms-core cannot be located
230
+ β„Ή Install it first: `npm install @prenta/core`.
231
+
232
+ - Reading canonical Prenta schema...
233
+ βœ– Could not locate @prenta/core.
234
+ - Reading canonical Prenta schema...
235
+ βœ” Prenta CMS models added to schema.
236
+ - Running prisma generate...
237
+ stdout | src/__tests__/db-init.test.ts > db:init (WS-D D5 β€” canonical schema, no stale fragment) > command > is idempotent without --force
238
+ βœ” Prisma client generated.
239
+ β„Ή Run `npx prisma migrate dev --name prenta-cms` to create the migration.
240
+
241
+ - Reading canonical Prenta schema...
242
+ β„Ή Prenta CMS models already present in schema. Use --force to overwrite.
243
+ βœ“ src/__tests__/db-init.test.ts (4 tests) 156ms
244
+ βœ“ src/__tests__/seed-sanitize.test.ts (9 tests) 55ms
245
+ βœ“ src/__tests__/prisma-client-path.test.ts (8 tests) 77ms
246
+ βœ“ src/__tests__/form-seed.test.ts (10 tests) 39ms
247
+ βœ“ src/__tests__/import-typescript.test.ts (9 tests) 505ms
248
+ βœ“ loads a TypeScript file that imports a sibling without appending ?namespace=  435ms
249
+ βœ“ src/__tests__/vercel-env-matrix.test.ts (6 tests) 73ms
250
+ βœ“ src/__tests__/upgrade.test.ts (3 tests) 20ms
251
+ βœ“ src/__tests__/repo-root.test.ts (4 tests) 54ms
252
+ βœ“ src/__tests__/load-dotenv.test.ts (3 tests) 37ms
253
+ βœ“ src/__tests__/import-typescript-hooks.test.ts (2 tests) 40ms
194
254
  - Reading canonical Prenta schema...
195
255
  βœ” Prenta CMS models added to schema.
196
256
  - Running prisma generate...
@@ -198,12 +258,12 @@ Next steps
198
258
  βœ” Prisma client generated.
199
259
  β„Ή Run `npx prisma migrate dev --name prenta-cms` to create the migration.
200
260
 
201
- βœ“ src/__tests__/schema-fragment.test.ts (1 test) 120ms
202
- βœ“ src/__tests__/db-sync-resolver.test.ts (4 tests) 17ms
203
- βœ“ src/__tests__/init.test.ts (2 tests) 37ms
261
+ βœ“ src/__tests__/schema-fragment.test.ts (1 test) 131ms
262
+ βœ“ src/__tests__/db-sync-resolver.test.ts (4 tests) 22ms
263
+ βœ“ src/__tests__/init.test.ts (2 tests) 25ms
204
264
 
205
265
   Test Files  26 passed | 1 skipped (27)
206
-  Tests  289 passed | 1 skipped (290)
207
-  Start at  15:16:08
208
-  Duration  89.80s (transform 22.48s, setup 0ms, import 18.64s, tests 39.99s, environment 22ms)
266
+  Tests  290 passed | 1 skipped (291)
267
+  Start at  01:05:08
268
+  Duration  88.88s (transform 21.13s, setup 0ms, import 18.32s, tests 38.63s, environment 9ms)
209
269
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @actuate-media/cli
2
2
 
3
+ ## 1.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 68195b4: Emit agent-ready `AGENTS.md`, `CLAUDE.md`, `.mcp.json`, and multi-agent section skills across all `create-prenta` project shapes (`astro-split`, `next`, and `astro-site`), and teach `prenta mcp:init` to write and git-ignore `.mcp.json` for Claude Code alongside `.cursor/mcp.json` and `.vscode/mcp.json`.
8
+
3
9
  ## 1.2.1
4
10
 
5
11
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAuHnC,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0DzD"}
1
+ {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAwInC,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqEzD"}
@@ -1,3 +1,4 @@
1
+ import { execFileSync } from 'node:child_process';
1
2
  import { existsSync } from 'node:fs';
2
3
  import { mkdir, readFile, writeFile } from 'node:fs/promises';
3
4
  import path from 'node:path';
@@ -16,6 +17,23 @@ function cursorEntry(opts) {
16
17
  function vscodeEntry(opts) {
17
18
  return { type: 'stdio', ...cursorEntry(opts) };
18
19
  }
20
+ /**
21
+ * True when git already tracks `relPath`. Adding a tracked file to
22
+ * `.gitignore` does not untrack it, so a key written there would still be
23
+ * committed. Outside a git repository (or without git) nothing is tracked.
24
+ */
25
+ function isTrackedByGit(root, relPath) {
26
+ try {
27
+ execFileSync('git', ['ls-files', '--error-unmatch', '--', relPath], {
28
+ cwd: root,
29
+ stdio: 'ignore',
30
+ });
31
+ return true;
32
+ }
33
+ catch {
34
+ return false;
35
+ }
36
+ }
19
37
  /**
20
38
  * Create or merge one editor config. Existing files keep every other server
21
39
  * entry; an existing `prenta` entry is only replaced with `--force`.
@@ -79,7 +97,7 @@ async function ensureGitignored(root, relPaths) {
79
97
  export function registerMcpCommand(program) {
80
98
  program
81
99
  .command('mcp:init')
82
- .description('Write .cursor/mcp.json + .vscode/mcp.json wiring the Prenta MCP server')
100
+ .description('Write .mcp.json + .cursor/mcp.json + .vscode/mcp.json wiring the Prenta MCP server')
83
101
  .option('--url <baseUrl>', 'Base URL of the running CMS', 'http://localhost:3000')
84
102
  .option('--key <apiKey>', 'Prenta API key (act_sk_...)', PLACEHOLDER_KEY)
85
103
  .option('--force', 'Replace an existing "prenta" server entry (or unparseable config)')
@@ -89,11 +107,18 @@ export function registerMcpCommand(program) {
89
107
  logger.warn('The provided --key does not look like an Prenta API key (expected act_sk_ prefix).');
90
108
  }
91
109
  const targets = [
110
+ { relPath: '.mcp.json', rootKey: 'mcpServers', entry: cursorEntry(opts) },
92
111
  { relPath: '.cursor/mcp.json', rootKey: 'mcpServers', entry: cursorEntry(opts) },
93
112
  { relPath: '.vscode/mcp.json', rootKey: 'servers', entry: vscodeEntry(opts) },
94
113
  ];
95
114
  let failed = false;
96
115
  for (const target of targets) {
116
+ if (opts.key !== PLACEHOLDER_KEY && isTrackedByGit(root, target.relPath)) {
117
+ logger.error(`${target.relPath} is tracked by git, so the key was not written to it. ` +
118
+ `Run "git rm --cached ${target.relPath}" and commit, then re-run this command.`);
119
+ failed = true;
120
+ continue;
121
+ }
97
122
  const result = await mergeConfigFile(root, target, Boolean(opts.force));
98
123
  if (result === 'created')
99
124
  logger.success(`Created ${target.relPath}`);
@@ -110,11 +135,11 @@ export function registerMcpCommand(program) {
110
135
  console.log(chalk.bold('Next steps'));
111
136
  if (opts.key === PLACEHOLDER_KEY) {
112
137
  console.log(` 1. Mint an API key in ${chalk.cyan('Admin β†’ Settings β†’ API Keys')} (act_sk_...)`);
113
- console.log(` 2. Replace ${chalk.cyan(PLACEHOLDER_KEY)} in both config files with the real key`);
114
- console.log(' 3. Restart Cursor / VS Code so the MCP server is picked up');
138
+ console.log(` 2. Replace ${chalk.cyan(PLACEHOLDER_KEY)} in the MCP config files with the real key`);
139
+ console.log(' 3. Restart Claude Code / Cursor / VS Code so the MCP server is picked up');
115
140
  }
116
141
  else {
117
- console.log(' 1. Restart Cursor / VS Code so the MCP server is picked up');
142
+ console.log(' 1. Restart Claude Code / Cursor / VS Code so the MCP server is picked up');
118
143
  }
119
144
  if (opts.url === 'http://localhost:3000') {
120
145
  console.log(chalk.dim(' Tip: pass --url https://your-site.com to target a deployed CMS instead.'));
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CA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M;YAAE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAA;IAClC,CAAC,CAAC,CAAA;AACN,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prenta/cli",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "license": "MIT",
5
5
  "description": "CLI for Prenta CMS β€” migrations, codegen, imports, exports, and upgrades",
6
6
  "repository": {
@@ -36,7 +36,7 @@
36
36
  "@vercel/blob": "^2.3.1",
37
37
  "typescript": "^5.7.0",
38
38
  "vitest": "^4.1.12",
39
- "@prenta/core": "8.21.0"
39
+ "@prenta/core": "8.21.3"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "tsc",
@@ -1,3 +1,4 @@
1
+ import { execFileSync } from 'node:child_process'
1
2
  import { mkdtemp, mkdir, readFile, rm, writeFile } from 'node:fs/promises'
2
3
  import { tmpdir } from 'node:os'
3
4
  import path from 'node:path'
@@ -40,10 +41,16 @@ afterEach(async () => {
40
41
  })
41
42
 
42
43
  describe('mcp:init', () => {
43
- it('creates both editor configs with placeholder key and git-ignores them', async () => {
44
+ it('creates Claude Code, Cursor, and VS Code configs with placeholder key and git-ignores them', async () => {
44
45
  await writeFile(path.join(projectDir, '.gitignore'), 'node_modules\n', 'utf8')
45
46
  await run()
46
47
 
48
+ const claude = await readJson('.mcp.json')
49
+ expect(claude.mcpServers.prenta.command).toBe('npx')
50
+ expect(claude.mcpServers.prenta.args).toEqual(['-y', '@prenta/mcp-server'])
51
+ expect(claude.mcpServers.prenta.env.PRENTA_BASE_URL).toBe('http://localhost:3000')
52
+ expect(claude.mcpServers.prenta.env.PRENTA_API_KEY).toBe('act_sk_REPLACE_WITH_YOUR_KEY')
53
+
47
54
  const cursor = await readJson('.cursor/mcp.json')
48
55
  expect(cursor.mcpServers.prenta.command).toBe('npx')
49
56
  expect(cursor.mcpServers.prenta.args).toEqual(['-y', '@prenta/mcp-server'])
@@ -55,13 +62,19 @@ describe('mcp:init', () => {
55
62
 
56
63
  const gitignore = await readFile(path.join(projectDir, '.gitignore'), 'utf8')
57
64
  expect(gitignore).toContain('node_modules')
65
+ expect(gitignore).toContain('.mcp.json')
58
66
  expect(gitignore).toContain('.cursor/mcp.json')
59
67
  expect(gitignore).toContain('.vscode/mcp.json')
60
68
  })
61
69
 
62
- it('applies --url and --key to both configs', async () => {
70
+ it('applies --url and --key to all three configs', async () => {
63
71
  await run(['--url', 'https://example.com', '--key', 'act_sk_real123'])
64
72
 
73
+ const claude = await readJson('.mcp.json')
74
+ expect(claude.mcpServers.prenta.env).toEqual({
75
+ PRENTA_BASE_URL: 'https://example.com',
76
+ PRENTA_API_KEY: 'act_sk_real123',
77
+ })
65
78
  const cursor = await readJson('.cursor/mcp.json')
66
79
  expect(cursor.mcpServers.prenta.env).toEqual({
67
80
  PRENTA_BASE_URL: 'https://example.com',
@@ -73,6 +86,11 @@ describe('mcp:init', () => {
73
86
 
74
87
  it('merges into an existing config without clobbering other servers', async () => {
75
88
  await mkdir(path.join(projectDir, '.cursor'), { recursive: true })
89
+ await writeFile(
90
+ path.join(projectDir, '.mcp.json'),
91
+ JSON.stringify({ mcpServers: { github: { command: 'github-mcp' } } }),
92
+ 'utf8',
93
+ )
76
94
  await writeFile(
77
95
  path.join(projectDir, '.cursor', 'mcp.json'),
78
96
  JSON.stringify({ mcpServers: { sentry: { command: 'sentry-mcp' } } }),
@@ -80,6 +98,10 @@ describe('mcp:init', () => {
80
98
  )
81
99
  await run()
82
100
 
101
+ const claude = await readJson('.mcp.json')
102
+ expect(claude.mcpServers.github).toEqual({ command: 'github-mcp' })
103
+ expect(claude.mcpServers.prenta).toBeDefined()
104
+
83
105
  const cursor = await readJson('.cursor/mcp.json')
84
106
  expect(cursor.mcpServers.sentry).toEqual({ command: 'sentry-mcp' })
85
107
  expect(cursor.mcpServers.prenta).toBeDefined()
@@ -115,6 +137,30 @@ describe('mcp:init', () => {
115
137
  expect(cursor.mcpServers.prenta).toBeDefined()
116
138
  })
117
139
 
140
+ it('refuses to write a real key into a config git already tracks', async () => {
141
+ const git = (...args: string[]) =>
142
+ execFileSync('git', args, { cwd: projectDir, stdio: 'ignore' })
143
+ git('init', '-q')
144
+ const shared = { mcpServers: { other: { command: 'other-server' } } }
145
+ await writeFile(path.join(projectDir, '.mcp.json'), JSON.stringify(shared), 'utf8')
146
+ git('add', '.mcp.json')
147
+
148
+ await run(['--key', 'act_sk_realkey123'])
149
+ expect(process.exitCode).toBe(1)
150
+ process.exitCode = 0
151
+
152
+ // The tracked file is untouched; the untracked editor configs get the key.
153
+ expect(await readJson('.mcp.json')).toEqual(shared)
154
+ const cursor = await readJson('.cursor/mcp.json')
155
+ expect(cursor.mcpServers.prenta.env.PRENTA_API_KEY).toBe('act_sk_realkey123')
156
+
157
+ // The placeholder is not a secret, so a tracked file can still be wired up.
158
+ await run()
159
+ const claude = await readJson('.mcp.json')
160
+ expect(claude.mcpServers.other).toEqual({ command: 'other-server' })
161
+ expect(claude.mcpServers.prenta.env.PRENTA_API_KEY).toBe('act_sk_REPLACE_WITH_YOUR_KEY')
162
+ })
163
+
118
164
  it('does not duplicate gitignore entries on re-runs', async () => {
119
165
  await run()
120
166
  await run(['--force'])
@@ -1,3 +1,4 @@
1
+ import { execFileSync } from 'node:child_process'
1
2
  import { existsSync } from 'node:fs'
2
3
  import { mkdir, readFile, writeFile } from 'node:fs/promises'
3
4
  import path from 'node:path'
@@ -9,11 +10,11 @@ import { logger } from '../utils/logger.js'
9
10
  * `prenta mcp:init` β€” retrofit the Prenta MCP server config onto an
10
11
  * existing project.
11
12
  *
12
- * New scaffolds (`npm create prenta`) emit `.cursor/mcp.json` and
13
+ * New scaffolds (`npm create prenta`) emit `.mcp.json`, `.cursor/mcp.json`, and
13
14
  * `.vscode/mcp.json` automatically; projects created before that feature (or
14
- * set up by hand) have no easy path. This command writes both editor configs,
15
+ * set up by hand) have no easy path. This command writes all three configs,
15
16
  * merging into existing files so other MCP servers are preserved, and ensures
16
- * both paths are git-ignored (a real `act_sk_...` key pasted into them must
17
+ * all paths are git-ignored (a real `act_sk_...` key pasted into them must
17
18
  * never be committed).
18
19
  */
19
20
 
@@ -49,6 +50,23 @@ interface MergeTarget {
49
50
 
50
51
  type MergeResult = 'created' | 'updated' | 'skipped' | 'error'
51
52
 
53
+ /**
54
+ * True when git already tracks `relPath`. Adding a tracked file to
55
+ * `.gitignore` does not untrack it, so a key written there would still be
56
+ * committed. Outside a git repository (or without git) nothing is tracked.
57
+ */
58
+ function isTrackedByGit(root: string, relPath: string): boolean {
59
+ try {
60
+ execFileSync('git', ['ls-files', '--error-unmatch', '--', relPath], {
61
+ cwd: root,
62
+ stdio: 'ignore',
63
+ })
64
+ return true
65
+ } catch {
66
+ return false
67
+ }
68
+ }
69
+
52
70
  /**
53
71
  * Create or merge one editor config. Existing files keep every other server
54
72
  * entry; an existing `prenta` entry is only replaced with `--force`.
@@ -123,7 +141,9 @@ async function ensureGitignored(root: string, relPaths: string[]): Promise<strin
123
141
  export function registerMcpCommand(program: Command): void {
124
142
  program
125
143
  .command('mcp:init')
126
- .description('Write .cursor/mcp.json + .vscode/mcp.json wiring the Prenta MCP server')
144
+ .description(
145
+ 'Write .mcp.json + .cursor/mcp.json + .vscode/mcp.json wiring the Prenta MCP server',
146
+ )
127
147
  .option('--url <baseUrl>', 'Base URL of the running CMS', 'http://localhost:3000')
128
148
  .option('--key <apiKey>', 'Prenta API key (act_sk_...)', PLACEHOLDER_KEY)
129
149
  .option('--force', 'Replace an existing "prenta" server entry (or unparseable config)')
@@ -137,12 +157,21 @@ export function registerMcpCommand(program: Command): void {
137
157
  }
138
158
 
139
159
  const targets: MergeTarget[] = [
160
+ { relPath: '.mcp.json', rootKey: 'mcpServers', entry: cursorEntry(opts) },
140
161
  { relPath: '.cursor/mcp.json', rootKey: 'mcpServers', entry: cursorEntry(opts) },
141
162
  { relPath: '.vscode/mcp.json', rootKey: 'servers', entry: vscodeEntry(opts) },
142
163
  ]
143
164
 
144
165
  let failed = false
145
166
  for (const target of targets) {
167
+ if (opts.key !== PLACEHOLDER_KEY && isTrackedByGit(root, target.relPath)) {
168
+ logger.error(
169
+ `${target.relPath} is tracked by git, so the key was not written to it. ` +
170
+ `Run "git rm --cached ${target.relPath}" and commit, then re-run this command.`,
171
+ )
172
+ failed = true
173
+ continue
174
+ }
146
175
  const result = await mergeConfigFile(root, target, Boolean(opts.force))
147
176
  if (result === 'created') logger.success(`Created ${target.relPath}`)
148
177
  else if (result === 'updated') logger.success(`Updated ${target.relPath}`)
@@ -164,11 +193,11 @@ export function registerMcpCommand(program: Command): void {
164
193
  ` 1. Mint an API key in ${chalk.cyan('Admin β†’ Settings β†’ API Keys')} (act_sk_...)`,
165
194
  )
166
195
  console.log(
167
- ` 2. Replace ${chalk.cyan(PLACEHOLDER_KEY)} in both config files with the real key`,
196
+ ` 2. Replace ${chalk.cyan(PLACEHOLDER_KEY)} in the MCP config files with the real key`,
168
197
  )
169
- console.log(' 3. Restart Cursor / VS Code so the MCP server is picked up')
198
+ console.log(' 3. Restart Claude Code / Cursor / VS Code so the MCP server is picked up')
170
199
  } else {
171
- console.log(' 1. Restart Cursor / VS Code so the MCP server is picked up')
200
+ console.log(' 1. Restart Claude Code / Cursor / VS Code so the MCP server is picked up')
172
201
  }
173
202
  if (opts.url === 'http://localhost:3000') {
174
203
  console.log(