create-agentlink 0.3.1 → 0.4.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/dist/index.js CHANGED
@@ -27,7 +27,7 @@ function appendLog(msg) {
27
27
  function initLog() {
28
28
  fs.writeFileSync(LOG_FILE, "");
29
29
  }
30
- function runCommand(cmd, cwd) {
30
+ function runCommand(cmd, cwd, onData) {
31
31
  appendLog(`$ ${cmd}${cwd ? ` (in ${cwd})` : ""}`);
32
32
  return new Promise((resolve, reject) => {
33
33
  const child = spawn("sh", ["-c", cmd], {
@@ -36,8 +36,24 @@ function runCommand(cmd, cwd) {
36
36
  });
37
37
  const stdout = [];
38
38
  const stderr = [];
39
- child.stdout.on("data", (data) => stdout.push(data.toString()));
40
- child.stderr.on("data", (data) => stderr.push(data.toString()));
39
+ child.stdout.on("data", (data) => {
40
+ const text = data.toString();
41
+ stdout.push(text);
42
+ if (onData) {
43
+ for (const line of text.split("\n").filter(Boolean)) {
44
+ onData(line.trim());
45
+ }
46
+ }
47
+ });
48
+ child.stderr.on("data", (data) => {
49
+ const text = data.toString();
50
+ stderr.push(text);
51
+ if (onData) {
52
+ for (const line of text.split("\n").filter(Boolean)) {
53
+ onData(line.trim());
54
+ }
55
+ }
56
+ });
41
57
  child.on("close", (code) => {
42
58
  const out = stdout.join("").trim();
43
59
  const errOut = stderr.join("").trim();
@@ -163,12 +179,6 @@ var CLAUDE_SETTINGS = {
163
179
  repo: "agentlinksh/agent"
164
180
  }
165
181
  }
166
- },
167
- mcpServers: {
168
- supabase: {
169
- type: "http",
170
- url: "http://127.0.0.1:54321/mcp"
171
- }
172
182
  }
173
183
  };
174
184
  var REQUIRED_SKILL = "supabase/agent-skills@supabase-postgres-best-practices";
@@ -218,7 +228,10 @@ async function scaffold(options) {
218
228
  },
219
229
  {
220
230
  title: "Starting Supabase",
221
- task: () => runCommand("supabase start", projectDir)
231
+ task: (_, task) => runCommand("supabase start", projectDir, (line) => {
232
+ task.output = line;
233
+ }),
234
+ rendererOptions: { persistentOutput: false, bottomBar: 1 }
222
235
  },
223
236
  {
224
237
  title: "Configuring Claude Code",
@@ -232,6 +245,13 @@ async function scaffold(options) {
232
245
  await delay(500);
233
246
  }
234
247
  },
248
+ {
249
+ title: "Installing Supabase MCP",
250
+ task: () => runCommand(
251
+ 'claude mcp add --scope project --transport http supabase "http://127.0.0.1:54321/mcp"',
252
+ projectDir
253
+ )
254
+ },
235
255
  {
236
256
  title: "Installing Agent Link plugin",
237
257
  task: () => runCommand("claude plugin install link@agentlink --scope project", projectDir)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-agentlink",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "CLI for scaffolding Supabase apps with AI agents",
5
5
  "bin": {
6
6
  "agentlink": "./dist/index.js"
package/src/scaffold.ts CHANGED
@@ -55,12 +55,6 @@ const CLAUDE_SETTINGS = {
55
55
  },
56
56
  },
57
57
  },
58
- mcpServers: {
59
- supabase: {
60
- type: "http",
61
- url: "http://127.0.0.1:54321/mcp",
62
- },
63
- },
64
58
  };
65
59
 
66
60
  export const REQUIRED_SKILL =
@@ -127,7 +121,11 @@ export async function scaffold(options: ScaffoldOptions): Promise<ScaffoldSummar
127
121
  },
128
122
  {
129
123
  title: "Starting Supabase",
130
- task: () => runCommand("supabase start", projectDir),
124
+ task: (_, task) =>
125
+ runCommand("supabase start", projectDir, (line) => {
126
+ task.output = line;
127
+ }),
128
+ rendererOptions: { persistentOutput: false, bottomBar: 1 },
131
129
  },
132
130
  {
133
131
  title: "Configuring Claude Code",
@@ -141,6 +139,14 @@ export async function scaffold(options: ScaffoldOptions): Promise<ScaffoldSummar
141
139
  await delay(500);
142
140
  },
143
141
  },
142
+ {
143
+ title: "Installing Supabase MCP",
144
+ task: () =>
145
+ runCommand(
146
+ 'claude mcp add --scope project --transport http supabase "http://127.0.0.1:54321/mcp"',
147
+ projectDir,
148
+ ),
149
+ },
144
150
  {
145
151
  title: "Installing Agent Link plugin",
146
152
  task: () =>
package/src/utils.ts CHANGED
@@ -13,7 +13,11 @@ export function initLog() {
13
13
  fs.writeFileSync(LOG_FILE, "");
14
14
  }
15
15
 
16
- export function runCommand(cmd: string, cwd?: string): Promise<string> {
16
+ export function runCommand(
17
+ cmd: string,
18
+ cwd?: string,
19
+ onData?: (line: string) => void,
20
+ ): Promise<string> {
17
21
  appendLog(`$ ${cmd}${cwd ? ` (in ${cwd})` : ""}`);
18
22
  return new Promise((resolve, reject) => {
19
23
  const child = spawn("sh", ["-c", cmd], {
@@ -24,8 +28,24 @@ export function runCommand(cmd: string, cwd?: string): Promise<string> {
24
28
  const stdout: string[] = [];
25
29
  const stderr: string[] = [];
26
30
 
27
- child.stdout.on("data", (data) => stdout.push(data.toString()));
28
- child.stderr.on("data", (data) => stderr.push(data.toString()));
31
+ child.stdout.on("data", (data) => {
32
+ const text = data.toString();
33
+ stdout.push(text);
34
+ if (onData) {
35
+ for (const line of text.split("\n").filter(Boolean)) {
36
+ onData(line.trim());
37
+ }
38
+ }
39
+ });
40
+ child.stderr.on("data", (data) => {
41
+ const text = data.toString();
42
+ stderr.push(text);
43
+ if (onData) {
44
+ for (const line of text.split("\n").filter(Boolean)) {
45
+ onData(line.trim());
46
+ }
47
+ }
48
+ });
29
49
 
30
50
  child.on("close", (code) => {
31
51
  const out = stdout.join("").trim();