@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.
- package/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-test.log +153 -93
- package/CHANGELOG.md +6 -0
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +29 -4
- package/dist/commands/mcp.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/mcp-init.test.ts +48 -2
- package/src/commands/mcp.ts +36 -7
package/.turbo/turbo-build.log
CHANGED
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,83 +1,69 @@
|
|
|
1
1
|
|
|
2
|
-
> @prenta/cli@1.
|
|
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
|
[1m[30m[46m RUN [49m[39m[22m [36mv4.1.12 [39m[90m/home/runner/work/prenta/prenta/packages/cli[39m
|
|
7
7
|
|
|
8
|
-
[32mβ[39m src/__tests__/db-restore.test.ts [2m([22m[2m34 tests[22m[2m)[22m[33m
|
|
9
|
-
[33m[2mβ[22m[39m requires --target and never defaults to the env database [33m
|
|
10
|
-
[33m[2mβ[22m[39m warns when --target carries a password on argv and recommends PGPASSWORD instead [33m
|
|
11
|
-
[33m[2mβ[22m[39m OIDC mode (VERCEL_OIDC_TOKEN + BLOB_STORE_ID) lists and restores without passing a token [33m
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
[33m[2mβ[22m[39m
|
|
15
|
-
[33m[2mβ[22m[39m
|
|
16
|
-
[33m[2mβ[22m[39m
|
|
17
|
-
[32mβ[39m src/__tests__/deployment-diagnostics.test.ts [2m([22m[2m23 tests[22m[2m)[22m[
|
|
18
|
-
[32mβ[39m src/__tests__/backup-blob-store.test.ts [2m([22m[2m18 tests[22m[2m)[22m[33m
|
|
19
|
-
[32mβ[39m src/__tests__/backup-pg-tools.test.ts [2m([22m[2m26 tests[22m[2m)[22m[33m
|
|
20
|
-
[32mβ[39m src/__tests__/db-sync.test.ts [2m([22m[2m13 tests[22m[2m)[22m[33m
|
|
21
|
-
[33m[2mβ[22m[39m refreshes an auto-synced schema and adds missing migrations [33m
|
|
22
|
-
[32mβ[39m src/__tests__/chrome.test.ts [2m([22m[2m11 tests[22m[2m)[22m[33m
|
|
8
|
+
[32mβ[39m src/__tests__/db-restore.test.ts [2m([22m[2m34 tests[22m[2m)[22m[33m 6914[2mms[22m[39m
|
|
9
|
+
[33m[2mβ[22m[39m requires --target and never defaults to the env database [33m 402[2mms[22m[39m
|
|
10
|
+
[33m[2mβ[22m[39m warns when --target carries a password on argv and recommends PGPASSWORD instead [33m 367[2mms[22m[39m
|
|
11
|
+
[33m[2mβ[22m[39m OIDC mode (VERCEL_OIDC_TOKEN + BLOB_STORE_ID) lists and restores without passing a token [33m 627[2mms[22m[39m
|
|
12
|
+
[33m[2mβ[22m[39m compares the typed name against the normalized database name and never accepts an empty answer [33m 303[2mms[22m[39m
|
|
13
|
+
[32mβ[39m src/__tests__/db-backup.test.ts [2m([22m[2m27 tests[22m[2m)[22m[33m 4810[2mms[22m[39m
|
|
14
|
+
[33m[2mβ[22m[39m writes the workflow YAML verbatim and exits 0 without touching the database [33m 594[2mms[22m[39m
|
|
15
|
+
[33m[2mβ[22m[39m refuses localhost / 127.0.0.1 unless --allow-local [33m 724[2mms[22m[39m
|
|
16
|
+
[33m[2mβ[22m[39m dumps with the exact argv, encrypts, and writes a verifiable manifest [33m 387[2mms[22m[39m
|
|
17
|
+
[32mβ[39m src/__tests__/deployment-diagnostics.test.ts [2m([22m[2m23 tests[22m[2m)[22m[33m 315[2mms[22m[39m
|
|
18
|
+
[32mβ[39m src/__tests__/backup-blob-store.test.ts [2m([22m[2m18 tests[22m[2m)[22m[33m 1045[2mms[22m[39m
|
|
19
|
+
[32mβ[39m src/__tests__/backup-pg-tools.test.ts [2m([22m[2m26 tests[22m[2m)[22m[33m 502[2mms[22m[39m
|
|
20
|
+
[32mβ[39m src/__tests__/db-sync.test.ts [2m([22m[2m13 tests[22m[2m)[22m[33m 923[2mms[22m[39m
|
|
21
|
+
[33m[2mβ[22m[39m refreshes an auto-synced schema and adds missing migrations [33m 306[2mms[22m[39m
|
|
22
|
+
[32mβ[39m src/__tests__/chrome.test.ts [2m([22m[2m11 tests[22m[2m)[22m[33m 18141[2mms[22m[39m
|
|
23
23
|
[2m[90mβ[39m[22m src/__tests__/integration/backup-roundtrip.int.test.ts [2m([22m[2m1 test[22m[2m | [22m[33m1 skipped[39m[2m)[22m
|
|
24
|
-
[32mβ[39m src/__tests__/backup-manifest.test.ts [2m([22m[2m17 tests[22m[2m)[22m[32m
|
|
24
|
+
[32mβ[39m src/__tests__/backup-manifest.test.ts [2m([22m[2m17 tests[22m[2m)[22m[32m 82[2mms[22m[39m
|
|
25
25
|
- Resolving target versionsβ¦
|
|
26
26
|
β Target version: 9.0.0
|
|
27
|
-
[32mβ[39m src/__tests__/upgrade-workspaces.test.ts [2m([22m[2m12 tests[22m[2m)[22m[33m
|
|
28
|
-
[33m[2mβ[22m[39m passes `upgrade --version <ver>` to upgrade instead of printing the CLI version [33m
|
|
29
|
-
[33m[2mβ[22m[39m prints its own package version for `prenta --version` [33m
|
|
30
|
-
[32mβ[39m src/__tests__/seed.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m
|
|
31
|
-
[32mβ[39m src/__tests__/backup-crypto.test.ts [2m([22m[2m13 tests[22m[2m)[22m[
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
[22m[
|
|
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
|
-
[90mstdout[2m | src/__tests__/db-init.test.ts[2m > [22m[2mdb:init (WS-D D5 β canonical schema, no stale fragment)[2m > [22m[2mcommand[2m > [22m[2mfails clearly when cms-core cannot be located
|
|
43
|
-
[22m[39mβΉ Install it first: `npm install @prenta/core`.
|
|
44
|
-
|
|
45
|
-
- Reading canonical Prenta schema...
|
|
46
|
-
[90mstdout[2m | src/__tests__/db-init.test.ts[2m > [22m[2mdb:init (WS-D D5 β canonical schema, no stale fragment)[2m > [22m[2mcommand[2m > [22m[2mis idempotent without --force
|
|
47
|
-
β Prenta CMS models added to schema.
|
|
48
|
-
- Running prisma generate...
|
|
49
|
-
[22m[39mβ 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
|
-
[32mβ[39m src/__tests__/db-init.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 230[2mms[22m[39m
|
|
55
|
-
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mcreates both editor configs with placeholder key and git-ignores them
|
|
27
|
+
[32mβ[39m src/__tests__/upgrade-workspaces.test.ts [2m([22m[2m12 tests[22m[2m)[22m[33m 3839[2mms[22m[39m
|
|
28
|
+
[33m[2mβ[22m[39m passes `upgrade --version <ver>` to upgrade instead of printing the CLI version [33m 2227[2mms[22m[39m
|
|
29
|
+
[33m[2mβ[22m[39m prints its own package version for `prenta --version` [33m 1426[2mms[22m[39m
|
|
30
|
+
[32mβ[39m src/__tests__/seed.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 85[2mms[22m[39m
|
|
31
|
+
[32mβ[39m src/__tests__/backup-crypto.test.ts [2m([22m[2m13 tests[22m[2m)[22m[32m 260[2mms[22m[39m
|
|
32
|
+
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mcreates Claude Code, Cursor, and VS Code configs with placeholder key and git-ignores them
|
|
33
|
+
[22m[39mβ Created .mcp.json
|
|
34
|
+
|
|
35
|
+
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mcreates Claude Code, Cursor, and VS Code configs with placeholder key and git-ignores them
|
|
56
36
|
[22m[39mβ Created .cursor/mcp.json
|
|
57
37
|
|
|
58
|
-
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mcreates
|
|
38
|
+
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mcreates Claude Code, Cursor, and VS Code configs with placeholder key and git-ignores them
|
|
59
39
|
[22m[39mβ Created .vscode/mcp.json
|
|
60
40
|
|
|
61
|
-
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mcreates
|
|
62
|
-
[22m[39mβ Added to .gitignore: .cursor/mcp.json, .vscode/mcp.json
|
|
41
|
+
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mcreates Claude Code, Cursor, and VS Code configs with placeholder key and git-ignores them
|
|
42
|
+
[22m[39mβ 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
|
|
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
|
-
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mapplies --url and --key to
|
|
50
|
+
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mapplies --url and --key to all three configs
|
|
51
|
+
[22m[39mβ Created .mcp.json
|
|
52
|
+
|
|
53
|
+
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mapplies --url and --key to all three configs
|
|
71
54
|
[22m[39mβ Created .cursor/mcp.json
|
|
72
55
|
|
|
73
|
-
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mapplies --url and --key to
|
|
56
|
+
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mapplies --url and --key to all three configs
|
|
74
57
|
[22m[39mβ Created .vscode/mcp.json
|
|
75
58
|
|
|
76
|
-
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mapplies --url and --key to
|
|
77
|
-
[22m[39mβ Added to .gitignore: .cursor/mcp.json, .vscode/mcp.json
|
|
59
|
+
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mapplies --url and --key to all three configs
|
|
60
|
+
[22m[39mβ 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
|
+
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mmerges into an existing config without clobbering other servers
|
|
66
|
+
[22m[39mβ Updated .mcp.json
|
|
81
67
|
|
|
82
68
|
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mmerges into an existing config without clobbering other servers
|
|
83
69
|
[22m[39mβ Updated .cursor/mcp.json
|
|
@@ -86,14 +72,17 @@ Next steps
|
|
|
86
72
|
[22m[39mβ Created .vscode/mcp.json
|
|
87
73
|
|
|
88
74
|
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mmerges into an existing config without clobbering other servers
|
|
89
|
-
[22m[39mβ Added to .gitignore: .cursor/mcp.json, .vscode/mcp.json
|
|
75
|
+
[22m[39mβ 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
|
|
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
|
+
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mleaves an existing prenta entry alone unless --force is passed
|
|
84
|
+
[22m[39mβ Created .mcp.json
|
|
85
|
+
|
|
97
86
|
[90mstderr[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mleaves an existing prenta entry alone unless --force is passed
|
|
98
87
|
[22m[39mβ .cursor/mcp.json already has an "prenta" server β use --force to replace it.
|
|
99
88
|
|
|
@@ -101,14 +90,17 @@ Next steps
|
|
|
101
90
|
[22m[39mβ Created .vscode/mcp.json
|
|
102
91
|
|
|
103
92
|
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mleaves an existing prenta entry alone unless --force is passed
|
|
104
|
-
[22m[39mβ Added to .gitignore: .cursor/mcp.json, .vscode/mcp.json
|
|
93
|
+
[22m[39mβ 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
|
|
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
|
+
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mleaves an existing prenta entry alone unless --force is passed
|
|
102
|
+
[22m[39mβ Updated .mcp.json
|
|
103
|
+
|
|
112
104
|
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mleaves an existing prenta entry alone unless --force is passed
|
|
113
105
|
[22m[39mβ Updated .cursor/mcp.json
|
|
114
106
|
|
|
@@ -119,24 +111,30 @@ Next steps
|
|
|
119
111
|
[22m[39m
|
|
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
|
|
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
|
-
[
|
|
126
|
-
[22m[39m
|
|
117
|
+
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mfails on invalid JSON without --force, overwrites with --force
|
|
118
|
+
[22m[39mβ Created .mcp.json
|
|
127
119
|
|
|
128
120
|
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mfails on invalid JSON without --force, overwrites with --force
|
|
121
|
+
[90mstderr[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mfails on invalid JSON without --force, overwrites with --force
|
|
122
|
+
[22m[39mβ .cursor/mcp.json contains invalid JSON β fix it or re-run with --force.
|
|
129
123
|
[22m[39mβ Created .vscode/mcp.json
|
|
130
124
|
|
|
125
|
+
|
|
131
126
|
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mfails on invalid JSON without --force, overwrites with --force
|
|
132
|
-
[22m[39mβ Added to .gitignore: .cursor/mcp.json, .vscode/mcp.json
|
|
127
|
+
[22m[39mβ 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
|
|
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
|
+
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mfails on invalid JSON without --force, overwrites with --force
|
|
136
|
+
[22m[39mβ Updated .mcp.json
|
|
137
|
+
|
|
140
138
|
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mfails on invalid JSON without --force, overwrites with --force
|
|
141
139
|
[22m[39mβ Updated .cursor/mcp.json
|
|
142
140
|
|
|
@@ -147,10 +145,46 @@ Next steps
|
|
|
147
145
|
[22m[39m
|
|
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
|
|
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
|
+
[90mstderr[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mrefuses to write a real key into a config git already tracks
|
|
153
|
+
[22m[39mβ .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
|
+
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mrefuses to write a real key into a config git already tracks
|
|
156
|
+
[22m[39mβ Created .cursor/mcp.json
|
|
157
|
+
|
|
158
|
+
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mrefuses to write a real key into a config git already tracks
|
|
159
|
+
[22m[39mβ Created .vscode/mcp.json
|
|
160
|
+
|
|
161
|
+
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mrefuses to write a real key into a config git already tracks
|
|
162
|
+
[22m[39mβ 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
|
+
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mrefuses to write a real key into a config git already tracks
|
|
169
|
+
[22m[39mβ Updated .mcp.json
|
|
170
|
+
|
|
171
|
+
[90mstderr[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mrefuses to write a real key into a config git already tracks
|
|
172
|
+
[22m[39mβ .cursor/mcp.json already has an "prenta" server β use --force to replace it.
|
|
173
|
+
|
|
174
|
+
[90mstderr[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mrefuses to write a real key into a config git already tracks
|
|
175
|
+
[22m[39mβ .vscode/mcp.json already has an "prenta" server β use --force to replace it.
|
|
176
|
+
|
|
177
|
+
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mrefuses to write a real key into a config git already tracks
|
|
178
|
+
[22m[39m
|
|
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
|
+
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mdoes not duplicate gitignore entries on re-runs
|
|
186
|
+
[22m[39mβ Created .mcp.json
|
|
187
|
+
|
|
154
188
|
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mdoes not duplicate gitignore entries on re-runs
|
|
155
189
|
[22m[39mβ Created .cursor/mcp.json
|
|
156
190
|
|
|
@@ -158,14 +192,17 @@ Next steps
|
|
|
158
192
|
[22m[39mβ Created .vscode/mcp.json
|
|
159
193
|
|
|
160
194
|
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mdoes not duplicate gitignore entries on re-runs
|
|
161
|
-
[22m[39mβ Added to .gitignore: .cursor/mcp.json, .vscode/mcp.json
|
|
195
|
+
[22m[39mβ 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
|
|
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
|
+
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mdoes not duplicate gitignore entries on re-runs
|
|
204
|
+
[22m[39mβ Updated .mcp.json
|
|
205
|
+
|
|
169
206
|
[90mstdout[2m | src/__tests__/mcp-init.test.ts[2m > [22m[2mmcp:init[2m > [22m[2mdoes not duplicate gitignore entries on re-runs
|
|
170
207
|
[22m[39mβ Updated .cursor/mcp.json
|
|
171
208
|
|
|
@@ -176,21 +213,44 @@ Next steps
|
|
|
176
213
|
[22m[39m
|
|
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
|
|
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
|
-
[32mβ[39m src/__tests__/mcp-init.test.ts [2m([22m[
|
|
184
|
-
[32mβ[39m src/__tests__/
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
220
|
+
[32mβ[39m src/__tests__/mcp-init.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m 450[2mms[22m[39m
|
|
221
|
+
[32mβ[39m src/__tests__/backup-common.test.ts [2m([22m[2m14 tests[22m[2m)[22m[32m 31[2mms[22m[39m
|
|
222
|
+
- Reading canonical Prenta schema...
|
|
223
|
+
β Prenta CMS models added to schema.
|
|
224
|
+
- Running prisma generate...
|
|
225
|
+
[90mstdout[2m | src/__tests__/db-init.test.ts[2m > [22m[2mdb:init (WS-D D5 β canonical schema, no stale fragment)[2m > [22m[2mcommand[2m > [22m[2minjects canonical models with @@map and no duplicate datasource/generator
|
|
226
|
+
[22m[39mβ Prisma client generated.
|
|
227
|
+
βΉ Run `npx prisma migrate dev --name prenta-cms` to create the migration.
|
|
228
|
+
|
|
229
|
+
[90mstdout[2m | src/__tests__/db-init.test.ts[2m > [22m[2mdb:init (WS-D D5 β canonical schema, no stale fragment)[2m > [22m[2mcommand[2m > [22m[2mfails clearly when cms-core cannot be located
|
|
230
|
+
[22m[39mβΉ 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
|
+
[90mstdout[2m | src/__tests__/db-init.test.ts[2m > [22m[2mdb:init (WS-D D5 β canonical schema, no stale fragment)[2m > [22m[2mcommand[2m > [22m[2mis idempotent without --force
|
|
238
|
+
[22m[39mβ 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
|
+
[32mβ[39m src/__tests__/db-init.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 156[2mms[22m[39m
|
|
244
|
+
[32mβ[39m src/__tests__/seed-sanitize.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 55[2mms[22m[39m
|
|
245
|
+
[32mβ[39m src/__tests__/prisma-client-path.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 77[2mms[22m[39m
|
|
246
|
+
[32mβ[39m src/__tests__/form-seed.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 39[2mms[22m[39m
|
|
247
|
+
[32mβ[39m src/__tests__/import-typescript.test.ts [2m([22m[2m9 tests[22m[2m)[22m[33m 505[2mms[22m[39m
|
|
248
|
+
[33m[2mβ[22m[39m loads a TypeScript file that imports a sibling without appending ?namespace= [33m 435[2mms[22m[39m
|
|
249
|
+
[32mβ[39m src/__tests__/vercel-env-matrix.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 73[2mms[22m[39m
|
|
250
|
+
[32mβ[39m src/__tests__/upgrade.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 20[2mms[22m[39m
|
|
251
|
+
[32mβ[39m src/__tests__/repo-root.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 54[2mms[22m[39m
|
|
252
|
+
[32mβ[39m src/__tests__/load-dotenv.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 37[2mms[22m[39m
|
|
253
|
+
[32mβ[39m src/__tests__/import-typescript-hooks.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 40[2mms[22m[39m
|
|
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
|
[22m[39mβ Prisma client generated.
|
|
199
259
|
βΉ Run `npx prisma migrate dev --name prenta-cms` to create the migration.
|
|
200
260
|
|
|
201
|
-
[32mβ[39m src/__tests__/schema-fragment.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
202
|
-
[32mβ[39m src/__tests__/db-sync-resolver.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
203
|
-
[32mβ[39m src/__tests__/init.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
261
|
+
[32mβ[39m src/__tests__/schema-fragment.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 131[2mms[22m[39m
|
|
262
|
+
[32mβ[39m src/__tests__/db-sync-resolver.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 22[2mms[22m[39m
|
|
263
|
+
[32mβ[39m src/__tests__/init.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 25[2mms[22m[39m
|
|
204
264
|
|
|
205
265
|
[2m Test Files [22m [1m[32m26 passed[39m[22m[2m | [22m[33m1 skipped[39m[90m (27)[39m
|
|
206
|
-
[2m Tests [22m [1m[
|
|
207
|
-
[2m Start at [22m
|
|
208
|
-
[2m Duration [22m
|
|
266
|
+
[2m Tests [22m [1m[32m290 passed[39m[22m[2m | [22m[33m1 skipped[39m[90m (291)[39m
|
|
267
|
+
[2m Start at [22m 01:05:08
|
|
268
|
+
[2m Duration [22m 88.88s[2m (transform 21.13s, setup 0ms, import 18.32s, tests 38.63s, environment 9ms)[22m
|
|
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":"
|
|
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"}
|
package/dist/commands/mcp.js
CHANGED
|
@@ -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
|
|
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.'));
|
package/dist/commands/mcp.js.map
CHANGED
|
@@ -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,CAAA;AAC7D,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAoB3C,MAAM,eAAe,GAAG,8BAA8B,CAAA;AAEtD,6DAA6D;AAC7D,SAAS,WAAW,CAAC,IAAoB;IACvC,OAAO;QACL,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,CAAC,IAAI,EAAE,oBAAoB,CAAC;QAClC,GAAG,EAAE,EAAE,eAAe,EAAE,IAAI,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,CAAC,GAAG,EAAE;KAC7D,CAAA;AACH,CAAC;AAED,+EAA+E;AAC/E,SAAS,WAAW,CAAC,IAAoB;IACvC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC,IAAI,CAAC,EAAE,CAAA;AAChD,CAAC;AAYD;;;GAGG;AACH,KAAK,UAAU,eAAe,CAC5B,IAAY,EACZ,MAAmB,EACnB,KAAc;IAEd,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,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M,GAAG,CAAC,EAAE,CAAC;YACvB,MAAM,CAAC,OAAO,CAAC,wBAAwB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAC9D,CAAC;QAED,OAAO,CAAC,GAAG,EAAE,CAAA;QACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAA;QACrC,IAAI,IAAI,CAAC,GAAG,KAAK,eAAe,EAAE,CAAC;YACjC,OAAO,CAAC,GAAG,CACT,2BAA2B,KAAK,CAAC,IAAI,CAAC,6BAA6B,CAAC,eAAe,CACpF,CAAA;YACD,OAAO,CAAC,GAAG,CACT,gBAAgB,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,4CAA4C,CACxF,CAAA;YACD,OAAO,CAAC,GAAG,CAAC,4EAA4E,CAAC,CAAA;QAC3F,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,4EAA4E,CAAC,CAAA;QAC3F,CAAC;QACD,IAAI,IAAI,CAAC,GAAG,KAAK,uBAAuB,EAAE,CAAC;YACzC,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,GAAG,CAAC,2EAA2E,CAAC,CACvF,CAAA;QACH,CAAC;QAED,IAAI,MAAM;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.
|
|
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.
|
|
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
|
|
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
|
|
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'])
|
package/src/commands/mcp.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
-
*
|
|
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(
|
|
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
|
|
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(
|