@toolr/seedr 0.1.71 → 0.1.73
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/{chunk-DI5Z3O3G.js → chunk-OYOVC7VN.js} +188 -69
- package/dist/cli.js +252 -346
- package/dist/index.d.ts +20 -20
- package/dist/index.js +15 -15
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
ALL_AGENTS,
|
|
4
|
+
CODING_AGENTS,
|
|
5
|
+
brand,
|
|
6
|
+
cancelled,
|
|
7
|
+
confirm,
|
|
5
8
|
ensureDir,
|
|
9
|
+
error,
|
|
6
10
|
exists,
|
|
7
11
|
fetchItemToDestination,
|
|
12
|
+
getAgentPath,
|
|
8
13
|
getAgentsPath,
|
|
9
14
|
getContentPath,
|
|
10
15
|
getInstalledSkills,
|
|
@@ -13,124 +18,34 @@ import {
|
|
|
13
18
|
getItemSourcePath,
|
|
14
19
|
getMcpPath,
|
|
15
20
|
getSettingsPath,
|
|
16
|
-
|
|
21
|
+
info,
|
|
17
22
|
installDirectory,
|
|
18
23
|
installFile,
|
|
24
|
+
intro,
|
|
19
25
|
listItems,
|
|
20
|
-
|
|
26
|
+
outro,
|
|
27
|
+
p,
|
|
28
|
+
parseAgentsArg,
|
|
29
|
+
printLogo,
|
|
21
30
|
removeFile,
|
|
22
31
|
searchItems,
|
|
32
|
+
selectAgents,
|
|
33
|
+
selectMethod,
|
|
34
|
+
selectScope,
|
|
35
|
+
selectSkill,
|
|
23
36
|
skillHandler,
|
|
37
|
+
step,
|
|
38
|
+
success,
|
|
39
|
+
warn,
|
|
24
40
|
writeTextFile
|
|
25
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-OYOVC7VN.js";
|
|
26
42
|
|
|
27
43
|
// src/cli.ts
|
|
28
44
|
import { Command as Command5 } from "commander";
|
|
29
|
-
import chalk12 from "chalk";
|
|
30
45
|
|
|
31
46
|
// src/commands/add.ts
|
|
32
47
|
import { Command } from "commander";
|
|
33
|
-
import
|
|
34
|
-
|
|
35
|
-
// src/utils/ui.ts
|
|
36
|
-
import * as p from "@clack/prompts";
|
|
37
|
-
import chalk from "chalk";
|
|
38
|
-
var LOGO = `
|
|
39
|
-
\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557
|
|
40
|
-
\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557
|
|
41
|
-
\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D
|
|
42
|
-
\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557
|
|
43
|
-
\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551
|
|
44
|
-
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D`;
|
|
45
|
-
var URLS = {
|
|
46
|
-
toolr: "https://toolr.dev",
|
|
47
|
-
seedr: "https://seedr.toolr.dev"
|
|
48
|
-
};
|
|
49
|
-
function printLogo() {
|
|
50
|
-
console.log(chalk.cyan(LOGO));
|
|
51
|
-
console.log(chalk.gray(` ${URLS.seedr} \xB7 ${URLS.toolr}`));
|
|
52
|
-
console.log();
|
|
53
|
-
}
|
|
54
|
-
async function selectSkill(items) {
|
|
55
|
-
const result = await p.select({
|
|
56
|
-
message: "Select a skill to install",
|
|
57
|
-
options: items.map((item) => ({
|
|
58
|
-
label: item.name,
|
|
59
|
-
value: item,
|
|
60
|
-
hint: item.description
|
|
61
|
-
}))
|
|
62
|
-
});
|
|
63
|
-
return result;
|
|
64
|
-
}
|
|
65
|
-
async function selectTools(compatible) {
|
|
66
|
-
const allOption = await p.select({
|
|
67
|
-
message: "Which AI tools do you want to install for?",
|
|
68
|
-
options: [
|
|
69
|
-
{ label: `All (${compatible.length} agents)`, value: "all" },
|
|
70
|
-
{ label: "Select specific tools...", value: "select" }
|
|
71
|
-
]
|
|
72
|
-
});
|
|
73
|
-
if (p.isCancel(allOption)) return allOption;
|
|
74
|
-
if (allOption === "all") return compatible;
|
|
75
|
-
const result = await p.multiselect({
|
|
76
|
-
message: "Select tools",
|
|
77
|
-
options: compatible.map((tool) => ({
|
|
78
|
-
label: AI_TOOLS[tool].name,
|
|
79
|
-
value: tool,
|
|
80
|
-
hint: AI_TOOLS[tool].projectRoot
|
|
81
|
-
})),
|
|
82
|
-
initialValues: ["claude"],
|
|
83
|
-
required: true
|
|
84
|
-
});
|
|
85
|
-
return result;
|
|
86
|
-
}
|
|
87
|
-
async function selectScope(includeLocal = false) {
|
|
88
|
-
const options = [
|
|
89
|
-
{ label: "Project", value: "project", hint: includeLocal ? "current directory, settings.json" : "current directory" },
|
|
90
|
-
{ label: "User", value: "user", hint: "home directory" },
|
|
91
|
-
...includeLocal ? [{ label: "Local", value: "local", hint: "current directory, settings.local.json" }] : []
|
|
92
|
-
];
|
|
93
|
-
const result = await p.select({ message: "Installation scope", options });
|
|
94
|
-
return result;
|
|
95
|
-
}
|
|
96
|
-
async function selectMethod(symlinkPath) {
|
|
97
|
-
const result = await p.select({
|
|
98
|
-
message: "Installation method",
|
|
99
|
-
options: [
|
|
100
|
-
{ label: "Symlink", value: "symlink", hint: `shared at ${symlinkPath}` },
|
|
101
|
-
{ label: "Copy", value: "copy", hint: "standalone copy per tool" }
|
|
102
|
-
]
|
|
103
|
-
});
|
|
104
|
-
return result;
|
|
105
|
-
}
|
|
106
|
-
async function confirm2(message) {
|
|
107
|
-
return p.confirm({ message });
|
|
108
|
-
}
|
|
109
|
-
function cancelled() {
|
|
110
|
-
p.cancel("Operation cancelled");
|
|
111
|
-
process.exit(0);
|
|
112
|
-
}
|
|
113
|
-
function intro2(message) {
|
|
114
|
-
p.intro(chalk.bgCyan.black(` ${message} `));
|
|
115
|
-
}
|
|
116
|
-
function outro2(message) {
|
|
117
|
-
p.outro(chalk.green(message));
|
|
118
|
-
}
|
|
119
|
-
function step(message) {
|
|
120
|
-
p.log.step(message);
|
|
121
|
-
}
|
|
122
|
-
function info(message) {
|
|
123
|
-
p.log.info(message);
|
|
124
|
-
}
|
|
125
|
-
function success(message) {
|
|
126
|
-
p.log.success(message);
|
|
127
|
-
}
|
|
128
|
-
function warn(message) {
|
|
129
|
-
p.log.warn(message);
|
|
130
|
-
}
|
|
131
|
-
function error(message) {
|
|
132
|
-
p.log.error(message);
|
|
133
|
-
}
|
|
48
|
+
import chalk7 from "chalk";
|
|
134
49
|
|
|
135
50
|
// src/handlers/registry.ts
|
|
136
51
|
var handlers = /* @__PURE__ */ new Map();
|
|
@@ -142,10 +57,10 @@ function getHandler(type) {
|
|
|
142
57
|
}
|
|
143
58
|
|
|
144
59
|
// src/utils/errors.ts
|
|
145
|
-
import
|
|
60
|
+
import chalk from "chalk";
|
|
146
61
|
function handleCommandError(error2) {
|
|
147
62
|
console.error(
|
|
148
|
-
|
|
63
|
+
chalk.red(`Error: ${error2 instanceof Error ? error2.message : "Unknown error"}`)
|
|
149
64
|
);
|
|
150
65
|
process.exit(1);
|
|
151
66
|
}
|
|
@@ -162,9 +77,9 @@ function trackInstalls(slug, type, results, scope) {
|
|
|
162
77
|
body: JSON.stringify({
|
|
163
78
|
slug,
|
|
164
79
|
type,
|
|
165
|
-
|
|
80
|
+
agent: result.agent,
|
|
166
81
|
scope,
|
|
167
|
-
version: "0.1.
|
|
82
|
+
version: "0.1.73"
|
|
168
83
|
}),
|
|
169
84
|
signal: AbortSignal.timeout(4e3)
|
|
170
85
|
}).catch(() => {
|
|
@@ -173,7 +88,7 @@ function trackInstalls(slug, type, results, scope) {
|
|
|
173
88
|
}
|
|
174
89
|
|
|
175
90
|
// src/config/compatibility.ts
|
|
176
|
-
var
|
|
91
|
+
var AGENT_COMPATIBILITY = {
|
|
177
92
|
skill: ["claude", "copilot", "gemini", "codex", "opencode"],
|
|
178
93
|
command: ["claude"],
|
|
179
94
|
agent: ["claude"],
|
|
@@ -182,24 +97,24 @@ var TOOL_COMPATIBILITY = {
|
|
|
182
97
|
settings: ["claude"],
|
|
183
98
|
mcp: ["claude", "copilot", "gemini", "codex", "opencode"]
|
|
184
99
|
};
|
|
185
|
-
function
|
|
186
|
-
const compatible =
|
|
187
|
-
return
|
|
100
|
+
function filterCompatibleAgents(type, agents) {
|
|
101
|
+
const compatible = AGENT_COMPATIBILITY[type];
|
|
102
|
+
return agents.filter((a) => compatible.includes(a));
|
|
188
103
|
}
|
|
189
104
|
|
|
190
105
|
// src/handlers/agent.ts
|
|
191
106
|
import { join } from "path";
|
|
192
107
|
import { readdir } from "fs/promises";
|
|
193
|
-
import
|
|
108
|
+
import chalk2 from "chalk";
|
|
194
109
|
import ora from "ora";
|
|
195
|
-
async function
|
|
110
|
+
async function installAgentForCodingAgent(item, agent, scope, method, cwd) {
|
|
196
111
|
const spinner = ora(
|
|
197
|
-
`Installing ${item.name} for ${
|
|
112
|
+
`Installing ${item.name} for ${CODING_AGENTS[agent].name}...`
|
|
198
113
|
).start();
|
|
199
114
|
try {
|
|
200
|
-
const destDir = getContentPath(
|
|
115
|
+
const destDir = getContentPath(agent, "agent", scope, cwd);
|
|
201
116
|
if (!destDir) {
|
|
202
|
-
throw new Error(`${
|
|
117
|
+
throw new Error(`${CODING_AGENTS[agent].name} does not support agents`);
|
|
203
118
|
}
|
|
204
119
|
const destPath = join(destDir, `${item.slug}.md`);
|
|
205
120
|
const sourcePath = getItemSourcePath(item);
|
|
@@ -218,27 +133,27 @@ async function installAgentForTool(item, tool, scope, method, cwd) {
|
|
|
218
133
|
await writeTextFile(destPath, content);
|
|
219
134
|
}
|
|
220
135
|
spinner.succeed(
|
|
221
|
-
|
|
136
|
+
brand(`Installed ${item.name} for ${CODING_AGENTS[agent].name}`)
|
|
222
137
|
);
|
|
223
|
-
return {
|
|
138
|
+
return { agent, success: true, path: destPath };
|
|
224
139
|
} catch (error2) {
|
|
225
140
|
const errorMsg = error2 instanceof Error ? error2.message : "Unknown error";
|
|
226
141
|
spinner.fail(
|
|
227
|
-
|
|
142
|
+
chalk2.red(`Failed to install for ${CODING_AGENTS[agent].name}: ${errorMsg}`)
|
|
228
143
|
);
|
|
229
|
-
return {
|
|
144
|
+
return { agent, success: false, path: "", error: errorMsg };
|
|
230
145
|
}
|
|
231
146
|
}
|
|
232
|
-
async function installAgent(item,
|
|
147
|
+
async function installAgent(item, agents, scope, method, cwd = process.cwd()) {
|
|
233
148
|
const results = [];
|
|
234
|
-
for (const
|
|
235
|
-
const result = await
|
|
149
|
+
for (const agent of agents) {
|
|
150
|
+
const result = await installAgentForCodingAgent(item, agent, scope, method, cwd);
|
|
236
151
|
results.push(result);
|
|
237
152
|
}
|
|
238
153
|
return results;
|
|
239
154
|
}
|
|
240
|
-
async function uninstallAgent(slug,
|
|
241
|
-
const destDir = getContentPath(
|
|
155
|
+
async function uninstallAgent(slug, agent, scope, cwd = process.cwd()) {
|
|
156
|
+
const destDir = getContentPath(agent, "agent", scope, cwd);
|
|
242
157
|
if (!destDir) return false;
|
|
243
158
|
const destPath = join(destDir, `${slug}.md`);
|
|
244
159
|
if (!await exists(destPath)) {
|
|
@@ -246,8 +161,8 @@ async function uninstallAgent(slug, tool, scope, cwd = process.cwd()) {
|
|
|
246
161
|
}
|
|
247
162
|
return removeFile(destPath);
|
|
248
163
|
}
|
|
249
|
-
async function getInstalledAgents(
|
|
250
|
-
const destDir = getContentPath(
|
|
164
|
+
async function getInstalledAgents(agent, scope, cwd = process.cwd()) {
|
|
165
|
+
const destDir = getContentPath(agent, "agent", scope, cwd);
|
|
251
166
|
if (!destDir || !await exists(destDir)) {
|
|
252
167
|
return [];
|
|
253
168
|
}
|
|
@@ -256,14 +171,14 @@ async function getInstalledAgents(tool, scope, cwd = process.cwd()) {
|
|
|
256
171
|
}
|
|
257
172
|
var agentHandler = {
|
|
258
173
|
type: "agent",
|
|
259
|
-
async install(item,
|
|
260
|
-
return installAgent(item,
|
|
174
|
+
async install(item, agents, scope, method, cwd) {
|
|
175
|
+
return installAgent(item, agents, scope, method, cwd);
|
|
261
176
|
},
|
|
262
|
-
async uninstall(slug,
|
|
263
|
-
return uninstallAgent(slug,
|
|
177
|
+
async uninstall(slug, agent, scope, cwd) {
|
|
178
|
+
return uninstallAgent(slug, agent, scope, cwd);
|
|
264
179
|
},
|
|
265
|
-
async listInstalled(
|
|
266
|
-
return getInstalledAgents(
|
|
180
|
+
async listInstalled(agent, scope, cwd) {
|
|
181
|
+
return getInstalledAgents(agent, scope, cwd);
|
|
267
182
|
}
|
|
268
183
|
};
|
|
269
184
|
|
|
@@ -271,7 +186,7 @@ var agentHandler = {
|
|
|
271
186
|
import { join as join2, basename } from "path";
|
|
272
187
|
import { homedir } from "os";
|
|
273
188
|
import { mkdir, copyFile, chmod, rm } from "fs/promises";
|
|
274
|
-
import
|
|
189
|
+
import chalk3 from "chalk";
|
|
275
190
|
import ora2 from "ora";
|
|
276
191
|
|
|
277
192
|
// src/utils/json.ts
|
|
@@ -338,12 +253,12 @@ function findScriptFile(item) {
|
|
|
338
253
|
}
|
|
339
254
|
return null;
|
|
340
255
|
}
|
|
341
|
-
async function
|
|
256
|
+
async function installHookForAgent(item, agent, scope, _method, cwd) {
|
|
342
257
|
const spinner = ora2(
|
|
343
|
-
`Installing ${item.name} for ${
|
|
258
|
+
`Installing ${item.name} for ${CODING_AGENTS[agent].name}...`
|
|
344
259
|
).start();
|
|
345
260
|
try {
|
|
346
|
-
if (
|
|
261
|
+
if (agent !== "claude") {
|
|
347
262
|
throw new Error("Hooks are only supported for Claude Code");
|
|
348
263
|
}
|
|
349
264
|
const triggers = item.contents?.triggers;
|
|
@@ -401,27 +316,27 @@ async function installHookForTool(item, tool, scope, _method, cwd) {
|
|
|
401
316
|
}
|
|
402
317
|
await writeJson(settingsPath, settings);
|
|
403
318
|
spinner.succeed(
|
|
404
|
-
|
|
319
|
+
brand(`Installed ${item.name} for ${CODING_AGENTS[agent].name}`)
|
|
405
320
|
);
|
|
406
|
-
return {
|
|
321
|
+
return { agent, success: true, path: destScriptPath };
|
|
407
322
|
} catch (error2) {
|
|
408
323
|
const errorMsg = error2 instanceof Error ? error2.message : "Unknown error";
|
|
409
324
|
spinner.fail(
|
|
410
|
-
|
|
325
|
+
chalk3.red(`Failed to install for ${CODING_AGENTS[agent].name}: ${errorMsg}`)
|
|
411
326
|
);
|
|
412
|
-
return {
|
|
327
|
+
return { agent, success: false, path: "", error: errorMsg };
|
|
413
328
|
}
|
|
414
329
|
}
|
|
415
|
-
async function installHook(item,
|
|
330
|
+
async function installHook(item, agents, scope, method, cwd = process.cwd()) {
|
|
416
331
|
const results = [];
|
|
417
|
-
for (const
|
|
418
|
-
const result = await
|
|
332
|
+
for (const agent of agents) {
|
|
333
|
+
const result = await installHookForAgent(item, agent, scope, method, cwd);
|
|
419
334
|
results.push(result);
|
|
420
335
|
}
|
|
421
336
|
return results;
|
|
422
337
|
}
|
|
423
|
-
async function uninstallHook(slug,
|
|
424
|
-
if (
|
|
338
|
+
async function uninstallHook(slug, agent, scope, cwd = process.cwd()) {
|
|
339
|
+
if (agent !== "claude") return false;
|
|
425
340
|
const settingsPath = getSettingsPath(scope, cwd);
|
|
426
341
|
if (!await exists(settingsPath)) return false;
|
|
427
342
|
const item = await getItem(slug, "hook");
|
|
@@ -469,8 +384,8 @@ async function uninstallHook(slug, tool, scope, cwd = process.cwd()) {
|
|
|
469
384
|
}
|
|
470
385
|
return removed;
|
|
471
386
|
}
|
|
472
|
-
async function getInstalledHooks(
|
|
473
|
-
if (
|
|
387
|
+
async function getInstalledHooks(agent, scope, cwd = process.cwd()) {
|
|
388
|
+
if (agent !== "claude") return [];
|
|
474
389
|
const settingsPath = getSettingsPath(scope, cwd);
|
|
475
390
|
if (!await exists(settingsPath)) return [];
|
|
476
391
|
const settings = await readJson(settingsPath);
|
|
@@ -488,19 +403,19 @@ async function getInstalledHooks(tool, scope, cwd = process.cwd()) {
|
|
|
488
403
|
}
|
|
489
404
|
var hookHandler = {
|
|
490
405
|
type: "hook",
|
|
491
|
-
async install(item,
|
|
492
|
-
return installHook(item,
|
|
406
|
+
async install(item, agents, scope, method, cwd) {
|
|
407
|
+
return installHook(item, agents, scope, method, cwd);
|
|
493
408
|
},
|
|
494
|
-
async uninstall(slug,
|
|
495
|
-
return uninstallHook(slug,
|
|
409
|
+
async uninstall(slug, agent, scope, cwd) {
|
|
410
|
+
return uninstallHook(slug, agent, scope, cwd);
|
|
496
411
|
},
|
|
497
|
-
async listInstalled(
|
|
498
|
-
return getInstalledHooks(
|
|
412
|
+
async listInstalled(agent, scope, cwd) {
|
|
413
|
+
return getInstalledHooks(agent, scope, cwd);
|
|
499
414
|
}
|
|
500
415
|
};
|
|
501
416
|
|
|
502
417
|
// src/handlers/mcp.ts
|
|
503
|
-
import
|
|
418
|
+
import chalk4 from "chalk";
|
|
504
419
|
import ora3 from "ora";
|
|
505
420
|
function parseMcpDefinition(content) {
|
|
506
421
|
try {
|
|
@@ -509,9 +424,9 @@ function parseMcpDefinition(content) {
|
|
|
509
424
|
throw new Error("Invalid MCP definition: must be valid JSON");
|
|
510
425
|
}
|
|
511
426
|
}
|
|
512
|
-
async function
|
|
427
|
+
async function installMcpForAgent(item, agent, scope, _method, cwd) {
|
|
513
428
|
const spinner = ora3(
|
|
514
|
-
`Installing ${item.name} for ${
|
|
429
|
+
`Installing ${item.name} for ${CODING_AGENTS[agent].name}...`
|
|
515
430
|
).start();
|
|
516
431
|
try {
|
|
517
432
|
const content = await getItemContent(item);
|
|
@@ -522,26 +437,26 @@ async function installMcpForTool(item, tool, scope, _method, cwd) {
|
|
|
522
437
|
config.mcpServers[mcpDef.name] = mcpDef.config;
|
|
523
438
|
await writeJson(configPath, config);
|
|
524
439
|
spinner.succeed(
|
|
525
|
-
|
|
440
|
+
brand(`Installed ${item.name} for ${CODING_AGENTS[agent].name}`)
|
|
526
441
|
);
|
|
527
|
-
return {
|
|
442
|
+
return { agent, success: true, path: configPath };
|
|
528
443
|
} catch (error2) {
|
|
529
444
|
const errorMsg = error2 instanceof Error ? error2.message : "Unknown error";
|
|
530
445
|
spinner.fail(
|
|
531
|
-
|
|
446
|
+
chalk4.red(`Failed to install for ${CODING_AGENTS[agent].name}: ${errorMsg}`)
|
|
532
447
|
);
|
|
533
|
-
return {
|
|
448
|
+
return { agent, success: false, path: "", error: errorMsg };
|
|
534
449
|
}
|
|
535
450
|
}
|
|
536
|
-
async function installMcp(item,
|
|
451
|
+
async function installMcp(item, agents, scope, method, cwd = process.cwd()) {
|
|
537
452
|
const results = [];
|
|
538
|
-
for (const
|
|
539
|
-
const result = await
|
|
453
|
+
for (const agent of agents) {
|
|
454
|
+
const result = await installMcpForAgent(item, agent, scope, method, cwd);
|
|
540
455
|
results.push(result);
|
|
541
456
|
}
|
|
542
457
|
return results;
|
|
543
458
|
}
|
|
544
|
-
async function uninstallMcp(slug,
|
|
459
|
+
async function uninstallMcp(slug, _agent, scope, cwd = process.cwd()) {
|
|
545
460
|
const configPath = getMcpPath(scope, cwd);
|
|
546
461
|
if (!await exists(configPath)) return false;
|
|
547
462
|
const config = await readJson(configPath);
|
|
@@ -552,7 +467,7 @@ async function uninstallMcp(slug, _tool, scope, cwd = process.cwd()) {
|
|
|
552
467
|
await writeJson(configPath, config);
|
|
553
468
|
return true;
|
|
554
469
|
}
|
|
555
|
-
async function getInstalledMcpServers(
|
|
470
|
+
async function getInstalledMcpServers(_agent, scope, cwd = process.cwd()) {
|
|
556
471
|
const configPath = getMcpPath(scope, cwd);
|
|
557
472
|
if (!await exists(configPath)) return [];
|
|
558
473
|
const config = await readJson(configPath);
|
|
@@ -560,19 +475,19 @@ async function getInstalledMcpServers(_tool, scope, cwd = process.cwd()) {
|
|
|
560
475
|
}
|
|
561
476
|
var mcpHandler = {
|
|
562
477
|
type: "mcp",
|
|
563
|
-
async install(item,
|
|
564
|
-
return installMcp(item,
|
|
478
|
+
async install(item, agents, scope, method, cwd) {
|
|
479
|
+
return installMcp(item, agents, scope, method, cwd);
|
|
565
480
|
},
|
|
566
|
-
async uninstall(slug,
|
|
567
|
-
return uninstallMcp(slug,
|
|
481
|
+
async uninstall(slug, agent, scope, cwd) {
|
|
482
|
+
return uninstallMcp(slug, agent, scope, cwd);
|
|
568
483
|
},
|
|
569
|
-
async listInstalled(
|
|
570
|
-
return getInstalledMcpServers(
|
|
484
|
+
async listInstalled(agent, scope, cwd) {
|
|
485
|
+
return getInstalledMcpServers(agent, scope, cwd);
|
|
571
486
|
}
|
|
572
487
|
};
|
|
573
488
|
|
|
574
489
|
// src/handlers/settings.ts
|
|
575
|
-
import
|
|
490
|
+
import chalk5 from "chalk";
|
|
576
491
|
import ora4 from "ora";
|
|
577
492
|
function parseSettings(content) {
|
|
578
493
|
try {
|
|
@@ -581,12 +496,12 @@ function parseSettings(content) {
|
|
|
581
496
|
throw new Error("Invalid settings: must be valid JSON");
|
|
582
497
|
}
|
|
583
498
|
}
|
|
584
|
-
async function
|
|
499
|
+
async function installSettingsForAgent(item, agent, scope, _method, cwd) {
|
|
585
500
|
const spinner = ora4(
|
|
586
|
-
`Installing ${item.name} for ${
|
|
501
|
+
`Installing ${item.name} for ${CODING_AGENTS[agent].name}...`
|
|
587
502
|
).start();
|
|
588
503
|
try {
|
|
589
|
-
if (
|
|
504
|
+
if (agent !== "claude") {
|
|
590
505
|
throw new Error("Settings are only supported for Claude Code");
|
|
591
506
|
}
|
|
592
507
|
const content = await getItemContent(item);
|
|
@@ -596,21 +511,21 @@ async function installSettingsForTool(item, tool, scope, _method, cwd) {
|
|
|
596
511
|
const merged = deepMerge(existingSettings, newSettings);
|
|
597
512
|
await writeJson(settingsPath, merged);
|
|
598
513
|
spinner.succeed(
|
|
599
|
-
|
|
514
|
+
brand(`Installed ${item.name} for ${CODING_AGENTS[agent].name}`)
|
|
600
515
|
);
|
|
601
|
-
return {
|
|
516
|
+
return { agent, success: true, path: settingsPath };
|
|
602
517
|
} catch (error2) {
|
|
603
518
|
const errorMsg = error2 instanceof Error ? error2.message : "Unknown error";
|
|
604
519
|
spinner.fail(
|
|
605
|
-
|
|
520
|
+
chalk5.red(`Failed to install for ${CODING_AGENTS[agent].name}: ${errorMsg}`)
|
|
606
521
|
);
|
|
607
|
-
return {
|
|
522
|
+
return { agent, success: false, path: "", error: errorMsg };
|
|
608
523
|
}
|
|
609
524
|
}
|
|
610
|
-
async function installSettings(item,
|
|
525
|
+
async function installSettings(item, agents, scope, method, cwd = process.cwd()) {
|
|
611
526
|
const results = [];
|
|
612
|
-
for (const
|
|
613
|
-
const result = await
|
|
527
|
+
for (const agent of agents) {
|
|
528
|
+
const result = await installSettingsForAgent(item, agent, scope, method, cwd);
|
|
614
529
|
results.push(result);
|
|
615
530
|
}
|
|
616
531
|
return results;
|
|
@@ -642,8 +557,8 @@ function deepUnmerge(target, source) {
|
|
|
642
557
|
}
|
|
643
558
|
return { result, changed };
|
|
644
559
|
}
|
|
645
|
-
async function uninstallSettings(slug,
|
|
646
|
-
if (
|
|
560
|
+
async function uninstallSettings(slug, agent, scope, cwd = process.cwd()) {
|
|
561
|
+
if (agent !== "claude") return false;
|
|
647
562
|
const item = await getItem(slug, "settings");
|
|
648
563
|
if (!item) return false;
|
|
649
564
|
let content;
|
|
@@ -662,22 +577,22 @@ async function uninstallSettings(slug, tool, scope, cwd = process.cwd()) {
|
|
|
662
577
|
}
|
|
663
578
|
return changed;
|
|
664
579
|
}
|
|
665
|
-
async function getInstalledSettings(
|
|
666
|
-
if (
|
|
580
|
+
async function getInstalledSettings(agent, scope, cwd = process.cwd()) {
|
|
581
|
+
if (agent !== "claude") return [];
|
|
667
582
|
const settingsPath = getSettingsPath(scope, cwd);
|
|
668
583
|
if (!await exists(settingsPath)) return [];
|
|
669
584
|
return [];
|
|
670
585
|
}
|
|
671
586
|
var settingsHandler = {
|
|
672
587
|
type: "settings",
|
|
673
|
-
async install(item,
|
|
674
|
-
return installSettings(item,
|
|
588
|
+
async install(item, agents, scope, method, cwd) {
|
|
589
|
+
return installSettings(item, agents, scope, method, cwd);
|
|
675
590
|
},
|
|
676
|
-
async uninstall(slug,
|
|
677
|
-
return uninstallSettings(slug,
|
|
591
|
+
async uninstall(slug, agent, scope, cwd) {
|
|
592
|
+
return uninstallSettings(slug, agent, scope, cwd);
|
|
678
593
|
},
|
|
679
|
-
async listInstalled(
|
|
680
|
-
return getInstalledSettings(
|
|
594
|
+
async listInstalled(agent, scope, cwd) {
|
|
595
|
+
return getInstalledSettings(agent, scope, cwd);
|
|
681
596
|
}
|
|
682
597
|
};
|
|
683
598
|
|
|
@@ -687,7 +602,7 @@ import { join as join3 } from "path";
|
|
|
687
602
|
import { mkdir as mkdir2, rm as rm2 } from "fs/promises";
|
|
688
603
|
import { execFile } from "child_process";
|
|
689
604
|
import { promisify } from "util";
|
|
690
|
-
import
|
|
605
|
+
import chalk6 from "chalk";
|
|
691
606
|
import ora5 from "ora";
|
|
692
607
|
var home = homedir2();
|
|
693
608
|
var PLUGINS_CACHE_DIR = join3(home, ".claude/plugins/cache");
|
|
@@ -728,12 +643,12 @@ async function ensureMarketplaceRegistered(marketplace, item) {
|
|
|
728
643
|
};
|
|
729
644
|
await writeJson(KNOWN_MARKETPLACES_PATH, known);
|
|
730
645
|
}
|
|
731
|
-
async function
|
|
646
|
+
async function installPluginForAgent(item, agent, scope, method, cwd) {
|
|
732
647
|
const spinner = ora5(
|
|
733
|
-
`Installing ${item.name} for ${
|
|
648
|
+
`Installing ${item.name} for ${CODING_AGENTS[agent].name}...`
|
|
734
649
|
).start();
|
|
735
650
|
try {
|
|
736
|
-
if (
|
|
651
|
+
if (agent !== "claude") {
|
|
737
652
|
throw new Error("Plugins are only supported for Claude Code");
|
|
738
653
|
}
|
|
739
654
|
const tmpPath = join3(PLUGINS_CACHE_DIR, ".tmp", item.slug);
|
|
@@ -779,27 +694,27 @@ async function installPluginForTool(item, tool, scope, method, cwd) {
|
|
|
779
694
|
settings.enabledPlugins[pluginId] = true;
|
|
780
695
|
await writeJson(settingsPath, settings);
|
|
781
696
|
spinner.succeed(
|
|
782
|
-
|
|
697
|
+
brand(`Installed ${item.name} for ${CODING_AGENTS[agent].name}`)
|
|
783
698
|
);
|
|
784
|
-
return {
|
|
699
|
+
return { agent, success: true, path: cachePath };
|
|
785
700
|
} catch (error2) {
|
|
786
701
|
const errorMsg = error2 instanceof Error ? error2.message : "Unknown error";
|
|
787
702
|
spinner.fail(
|
|
788
|
-
|
|
703
|
+
chalk6.red(`Failed to install for ${CODING_AGENTS[agent].name}: ${errorMsg}`)
|
|
789
704
|
);
|
|
790
|
-
return {
|
|
705
|
+
return { agent, success: false, path: "", error: errorMsg };
|
|
791
706
|
}
|
|
792
707
|
}
|
|
793
|
-
async function installPlugin(item,
|
|
708
|
+
async function installPlugin(item, agents, scope, method, cwd = process.cwd()) {
|
|
794
709
|
const results = [];
|
|
795
|
-
for (const
|
|
796
|
-
const result = await
|
|
710
|
+
for (const agent of agents) {
|
|
711
|
+
const result = await installPluginForAgent(item, agent, scope, method, cwd);
|
|
797
712
|
results.push(result);
|
|
798
713
|
}
|
|
799
714
|
return results;
|
|
800
715
|
}
|
|
801
|
-
async function uninstallPlugin(slug,
|
|
802
|
-
if (
|
|
716
|
+
async function uninstallPlugin(slug, agent, scope, cwd = process.cwd()) {
|
|
717
|
+
if (agent !== "claude") return false;
|
|
803
718
|
const registry = await readJson(INSTALLED_PLUGINS_PATH);
|
|
804
719
|
if (!registry.plugins) return false;
|
|
805
720
|
const matchingKey = Object.keys(registry.plugins).find(
|
|
@@ -824,8 +739,8 @@ async function uninstallPlugin(slug, tool, scope, cwd = process.cwd()) {
|
|
|
824
739
|
}
|
|
825
740
|
return true;
|
|
826
741
|
}
|
|
827
|
-
async function getInstalledPlugins(
|
|
828
|
-
if (
|
|
742
|
+
async function getInstalledPlugins(agent, scope, cwd = process.cwd()) {
|
|
743
|
+
if (agent !== "claude") return [];
|
|
829
744
|
const registry = await readJson(INSTALLED_PLUGINS_PATH);
|
|
830
745
|
if (!registry.plugins) return [];
|
|
831
746
|
const installed = [];
|
|
@@ -842,14 +757,14 @@ async function getInstalledPlugins(tool, scope, cwd = process.cwd()) {
|
|
|
842
757
|
}
|
|
843
758
|
var pluginHandler = {
|
|
844
759
|
type: "plugin",
|
|
845
|
-
async install(item,
|
|
846
|
-
return installPlugin(item,
|
|
760
|
+
async install(item, agents, scope, method, cwd) {
|
|
761
|
+
return installPlugin(item, agents, scope, method, cwd);
|
|
847
762
|
},
|
|
848
|
-
async uninstall(slug,
|
|
849
|
-
return uninstallPlugin(slug,
|
|
763
|
+
async uninstall(slug, agent, scope, cwd) {
|
|
764
|
+
return uninstallPlugin(slug, agent, scope, cwd);
|
|
850
765
|
},
|
|
851
|
-
async listInstalled(
|
|
852
|
-
return getInstalledPlugins(
|
|
766
|
+
async listInstalled(agent, scope, cwd) {
|
|
767
|
+
return getInstalledPlugins(agent, scope, cwd);
|
|
853
768
|
}
|
|
854
769
|
};
|
|
855
770
|
|
|
@@ -904,43 +819,43 @@ async function resolveItem(itemName, type) {
|
|
|
904
819
|
}
|
|
905
820
|
return selected;
|
|
906
821
|
}
|
|
907
|
-
function
|
|
908
|
-
const typeCompatible =
|
|
822
|
+
function resolveAgents(agentsArg, item) {
|
|
823
|
+
const typeCompatible = filterCompatibleAgents(item.type, item.compatibility);
|
|
909
824
|
if (!agentsArg) return [];
|
|
910
|
-
const
|
|
911
|
-
if (agentsArg === "all") return
|
|
912
|
-
const incompatible =
|
|
825
|
+
const agents = parseAgentsArg(agentsArg, typeCompatible);
|
|
826
|
+
if (agentsArg === "all") return agents;
|
|
827
|
+
const incompatible = agents.filter((a) => !typeCompatible.includes(a));
|
|
913
828
|
if (incompatible.length > 0) {
|
|
914
829
|
warn(`${incompatible.join(", ")} not compatible with this ${item.type}`);
|
|
915
|
-
return
|
|
830
|
+
return agents.filter((a) => typeCompatible.includes(a));
|
|
916
831
|
}
|
|
917
|
-
return
|
|
832
|
+
return agents;
|
|
918
833
|
}
|
|
919
|
-
function printDryRunSummary(item,
|
|
834
|
+
function printDryRunSummary(item, agents, scope, method, cwd) {
|
|
920
835
|
info("Dry run - no files will be written\n");
|
|
921
|
-
console.log(
|
|
922
|
-
console.log(` ${item.type}: ${
|
|
923
|
-
console.log(` Scope: ${
|
|
924
|
-
console.log(` Method: ${
|
|
836
|
+
console.log(brand(" Would install:"));
|
|
837
|
+
console.log(` ${item.type}: ${chalk7.white(item.name)}`);
|
|
838
|
+
console.log(` Scope: ${chalk7.white(scope)}`);
|
|
839
|
+
console.log(` Method: ${chalk7.white(method)}`);
|
|
925
840
|
console.log();
|
|
926
841
|
if (method === "symlink" && item.type === "skill") {
|
|
927
842
|
const centralPath = getAgentsPath("skill", item.slug, cwd);
|
|
928
|
-
console.log(
|
|
929
|
-
console.log(` ${
|
|
843
|
+
console.log(brand(" Central storage:"));
|
|
844
|
+
console.log(` ${chalk7.gray("\u2192")} ${chalk7.gray(centralPath)}`);
|
|
930
845
|
console.log();
|
|
931
|
-
console.log(
|
|
846
|
+
console.log(brand(" Symlinks from agent folders:"));
|
|
932
847
|
} else {
|
|
933
|
-
console.log(
|
|
848
|
+
console.log(brand(" Target locations:"));
|
|
934
849
|
}
|
|
935
|
-
for (const
|
|
936
|
-
const config =
|
|
937
|
-
const contentPath = getContentPath(
|
|
850
|
+
for (const agent of agents) {
|
|
851
|
+
const config = CODING_AGENTS[agent];
|
|
852
|
+
const contentPath = getContentPath(agent, item.type, scope, cwd);
|
|
938
853
|
if (!contentPath) {
|
|
939
|
-
console.log(` ${
|
|
854
|
+
console.log(` ${chalk7.gray("\u2192")} ${chalk7.white(config.name)}: ${chalk7.red("not supported")}`);
|
|
940
855
|
continue;
|
|
941
856
|
}
|
|
942
857
|
const targetPath = `${contentPath}/${item.slug}`;
|
|
943
|
-
console.log(` ${
|
|
858
|
+
console.log(` ${chalk7.gray("\u2192")} ${chalk7.white(config.name)}: ${chalk7.gray(targetPath)}`);
|
|
944
859
|
}
|
|
945
860
|
console.log();
|
|
946
861
|
}
|
|
@@ -948,55 +863,55 @@ function printInstallSummary(results) {
|
|
|
948
863
|
const successful = results.filter((r) => r.success);
|
|
949
864
|
const failed = results.filter((r) => !r.success);
|
|
950
865
|
if (successful.length > 0) {
|
|
951
|
-
success(`Installed for ${successful.length}
|
|
866
|
+
success(`Installed for ${successful.length} agent(s)`);
|
|
952
867
|
for (const r of successful) {
|
|
953
|
-
console.log(
|
|
868
|
+
console.log(chalk7.gray(` \u2192 ${r.path}`));
|
|
954
869
|
}
|
|
955
870
|
}
|
|
956
871
|
if (failed.length > 0) {
|
|
957
|
-
error(`Failed for ${failed.length}
|
|
872
|
+
error(`Failed for ${failed.length} agent(s)`);
|
|
958
873
|
for (const r of failed) {
|
|
959
|
-
console.log(
|
|
874
|
+
console.log(chalk7.red(` \xD7 ${r.agent}: ${r.error}`));
|
|
960
875
|
}
|
|
961
876
|
process.exit(1);
|
|
962
877
|
}
|
|
963
878
|
}
|
|
964
879
|
var addCommand = new Command("add").description("Install a skill, agent, hook, or other configuration").argument("[name]", "Name of the item to install").option("-t, --type <type>", "Content type: skill, agent, hook, mcp, plugin, settings").option(
|
|
965
|
-
"-a, --agents <
|
|
966
|
-
"Comma-separated
|
|
880
|
+
"-a, --agents <agents>",
|
|
881
|
+
"Comma-separated coding agents or 'all' (claude,copilot,gemini,codex,opencode)"
|
|
967
882
|
).option("-s, --scope <scope>", "Installation scope: project, user, or local").option("-m, --method <method>", "Installation method: symlink or copy").option("-y, --yes", "Skip confirmation prompts").option("-f, --force", "Overwrite existing files").option("-n, --dry-run", "Show what would be installed without making changes").action(async (name, options) => {
|
|
968
883
|
try {
|
|
969
884
|
printLogo();
|
|
970
|
-
|
|
885
|
+
intro("Seedr");
|
|
971
886
|
const itemName = name;
|
|
972
887
|
const contentType = options.type;
|
|
973
888
|
const item = await resolveItem(itemName, contentType);
|
|
974
889
|
if (!item) process.exit(1);
|
|
975
|
-
step(`Selected: ${
|
|
890
|
+
step(`Selected: ${brand(item.name)} ${chalk7.gray(`(${item.type})`)} ${chalk7.gray(`- ${item.description}`)}`);
|
|
976
891
|
const handler = getHandler(item.type);
|
|
977
892
|
if (!handler) {
|
|
978
893
|
error(`No handler found for type "${item.type}"`);
|
|
979
894
|
process.exit(1);
|
|
980
895
|
}
|
|
981
|
-
let
|
|
982
|
-
const typeCompatible =
|
|
983
|
-
if (
|
|
896
|
+
let agents = resolveAgents(options.agents, item);
|
|
897
|
+
const typeCompatible = filterCompatibleAgents(item.type, item.compatibility);
|
|
898
|
+
if (agents.length === 0) {
|
|
984
899
|
if (typeCompatible.length === 1) {
|
|
985
|
-
|
|
900
|
+
agents = typeCompatible;
|
|
986
901
|
} else {
|
|
987
|
-
const selected = await
|
|
902
|
+
const selected = await selectAgents(typeCompatible);
|
|
988
903
|
if (p.isCancel(selected)) {
|
|
989
904
|
cancelled();
|
|
990
905
|
return;
|
|
991
906
|
}
|
|
992
|
-
|
|
907
|
+
agents = selected;
|
|
993
908
|
}
|
|
994
909
|
}
|
|
995
|
-
if (
|
|
996
|
-
error("No valid
|
|
910
|
+
if (agents.length === 0) {
|
|
911
|
+
error("No valid agents selected");
|
|
997
912
|
process.exit(1);
|
|
998
913
|
}
|
|
999
|
-
step(`
|
|
914
|
+
step(`Agents: ${brand(agents.join(", "))}`);
|
|
1000
915
|
let scope;
|
|
1001
916
|
if (options.scope) {
|
|
1002
917
|
scope = options.scope;
|
|
@@ -1009,11 +924,11 @@ var addCommand = new Command("add").description("Install a skill, agent, hook, o
|
|
|
1009
924
|
}
|
|
1010
925
|
scope = selected;
|
|
1011
926
|
}
|
|
1012
|
-
step(`Scope: ${
|
|
927
|
+
step(`Scope: ${brand(scope)}`);
|
|
1013
928
|
let method;
|
|
1014
929
|
if (options.method) {
|
|
1015
930
|
method = options.method;
|
|
1016
|
-
} else if (
|
|
931
|
+
} else if (agents.length === 1) {
|
|
1017
932
|
method = "copy";
|
|
1018
933
|
} else {
|
|
1019
934
|
const symlinkPath = getAgentsPath(item.type, item.slug, process.cwd());
|
|
@@ -1024,26 +939,26 @@ var addCommand = new Command("add").description("Install a skill, agent, hook, o
|
|
|
1024
939
|
}
|
|
1025
940
|
method = selected;
|
|
1026
941
|
}
|
|
1027
|
-
step(`Method: ${
|
|
942
|
+
step(`Method: ${brand(method)}`);
|
|
1028
943
|
if (options.dryRun) {
|
|
1029
944
|
console.log();
|
|
1030
|
-
printDryRunSummary(item,
|
|
1031
|
-
|
|
945
|
+
printDryRunSummary(item, agents, scope, method, process.cwd());
|
|
946
|
+
outro("Dry run complete");
|
|
1032
947
|
return;
|
|
1033
948
|
}
|
|
1034
949
|
if (!options.yes) {
|
|
1035
950
|
console.log();
|
|
1036
|
-
const confirmed = await
|
|
951
|
+
const confirmed = await confirm("Proceed with installation?");
|
|
1037
952
|
if (p.isCancel(confirmed) || !confirmed) {
|
|
1038
953
|
cancelled();
|
|
1039
954
|
return;
|
|
1040
955
|
}
|
|
1041
956
|
}
|
|
1042
957
|
console.log();
|
|
1043
|
-
const results = await handler.install(item,
|
|
958
|
+
const results = await handler.install(item, agents, scope, method, process.cwd());
|
|
1044
959
|
trackInstalls(item.slug, item.type, results, scope);
|
|
1045
960
|
printInstallSummary(results);
|
|
1046
|
-
|
|
961
|
+
outro("Installation complete");
|
|
1047
962
|
} catch (error2) {
|
|
1048
963
|
handleCommandError(error2);
|
|
1049
964
|
}
|
|
@@ -1051,17 +966,17 @@ var addCommand = new Command("add").description("Install a skill, agent, hook, o
|
|
|
1051
966
|
|
|
1052
967
|
// src/commands/list.ts
|
|
1053
968
|
import { Command as Command2 } from "commander";
|
|
1054
|
-
import
|
|
969
|
+
import chalk8 from "chalk";
|
|
1055
970
|
var SEPARATOR_WIDTH = 40;
|
|
1056
971
|
var SLUG_COLUMN_WIDTH = 24;
|
|
1057
972
|
var TYPE_COLORS = {
|
|
1058
|
-
skill:
|
|
1059
|
-
hook:
|
|
1060
|
-
agent:
|
|
1061
|
-
plugin:
|
|
1062
|
-
command:
|
|
1063
|
-
settings:
|
|
1064
|
-
mcp:
|
|
973
|
+
skill: chalk8.magenta,
|
|
974
|
+
hook: chalk8.hex("#a855f7"),
|
|
975
|
+
agent: chalk8.blue,
|
|
976
|
+
plugin: chalk8.hex("#6366f1"),
|
|
977
|
+
command: chalk8.hex("#f59e0b"),
|
|
978
|
+
settings: chalk8.hex("#f97316"),
|
|
979
|
+
mcp: chalk8.hex("#2dd4bf")
|
|
1065
980
|
};
|
|
1066
981
|
var listCommand = new Command2("list").alias("ls").description("List available or installed skills").option("-t, --type <type>", "Filter by type (skill, hook, agent, plugin)").option("-i, --installed", "Show only installed items").option("--scope <scope>", "Scope for installed check (project, user)", "project").action(async (options) => {
|
|
1067
982
|
try {
|
|
@@ -1077,52 +992,52 @@ var listCommand = new Command2("list").alias("ls").description("List available o
|
|
|
1077
992
|
async function listAvailable(type) {
|
|
1078
993
|
const items = await listItems(type);
|
|
1079
994
|
if (items.length === 0) {
|
|
1080
|
-
console.log(
|
|
995
|
+
console.log(chalk8.yellow("No items found in registry"));
|
|
1081
996
|
return;
|
|
1082
997
|
}
|
|
1083
998
|
const grouped = groupByType(items);
|
|
1084
999
|
for (const [itemType, typeItems] of Object.entries(grouped)) {
|
|
1085
|
-
const colorFn = TYPE_COLORS[itemType] ??
|
|
1000
|
+
const colorFn = TYPE_COLORS[itemType] ?? chalk8.white;
|
|
1086
1001
|
console.log(colorFn(`
|
|
1087
1002
|
${itemType.toUpperCase()}S`));
|
|
1088
|
-
console.log(
|
|
1003
|
+
console.log(chalk8.gray("\u2500".repeat(SEPARATOR_WIDTH)));
|
|
1089
1004
|
for (const item of typeItems) {
|
|
1090
|
-
const compatIcons = item.compatibility.map((
|
|
1091
|
-
const featured = item.featured ?
|
|
1005
|
+
const compatIcons = item.compatibility.map((a) => CODING_AGENTS[a].shortName).join(" ");
|
|
1006
|
+
const featured = item.featured ? chalk8.yellow("\u2605 ") : " ";
|
|
1092
1007
|
console.log(
|
|
1093
|
-
`${featured}${
|
|
1008
|
+
`${featured}${chalk8.white(item.slug.padEnd(SLUG_COLUMN_WIDTH))} ${chalk8.gray(compatIcons)}`
|
|
1094
1009
|
);
|
|
1095
|
-
console.log(` ${
|
|
1010
|
+
console.log(` ${chalk8.gray(item.description)}`);
|
|
1096
1011
|
}
|
|
1097
1012
|
}
|
|
1098
1013
|
console.log("");
|
|
1099
1014
|
console.log(
|
|
1100
|
-
|
|
1015
|
+
chalk8.gray(`Total: ${items.length} items. Use 'npx @toolr/seedr add <name>' to install.`)
|
|
1101
1016
|
);
|
|
1102
1017
|
}
|
|
1103
1018
|
async function listInstalled(scope) {
|
|
1104
|
-
console.log(
|
|
1019
|
+
console.log(brand(`
|
|
1105
1020
|
Installed skills (${scope} scope):
|
|
1106
1021
|
`));
|
|
1107
1022
|
let total = 0;
|
|
1108
|
-
for (const
|
|
1023
|
+
for (const agent of ALL_AGENTS) {
|
|
1109
1024
|
const installed = await getInstalledSkills(
|
|
1110
|
-
|
|
1025
|
+
agent,
|
|
1111
1026
|
scope
|
|
1112
1027
|
);
|
|
1113
1028
|
if (installed.length > 0) {
|
|
1114
|
-
console.log(
|
|
1029
|
+
console.log(chalk8.blue(CODING_AGENTS[agent].name));
|
|
1115
1030
|
for (const skill of installed) {
|
|
1116
|
-
console.log(` ${
|
|
1031
|
+
console.log(` ${chalk8.white(skill)}`);
|
|
1117
1032
|
total++;
|
|
1118
1033
|
}
|
|
1119
1034
|
console.log("");
|
|
1120
1035
|
}
|
|
1121
1036
|
}
|
|
1122
1037
|
if (total === 0) {
|
|
1123
|
-
console.log(
|
|
1038
|
+
console.log(chalk8.yellow("No skills installed"));
|
|
1124
1039
|
} else {
|
|
1125
|
-
console.log(
|
|
1040
|
+
console.log(chalk8.gray(`Total: ${total} installed`));
|
|
1126
1041
|
}
|
|
1127
1042
|
}
|
|
1128
1043
|
function groupByType(items) {
|
|
@@ -1140,7 +1055,7 @@ function groupByType(items) {
|
|
|
1140
1055
|
|
|
1141
1056
|
// src/commands/remove.ts
|
|
1142
1057
|
import { Command as Command3 } from "commander";
|
|
1143
|
-
import
|
|
1058
|
+
import chalk9 from "chalk";
|
|
1144
1059
|
import ora6 from "ora";
|
|
1145
1060
|
|
|
1146
1061
|
// src/utils/prompts.ts
|
|
@@ -1158,37 +1073,37 @@ async function promptConfirm(message, defaultValue = true) {
|
|
|
1158
1073
|
}
|
|
1159
1074
|
|
|
1160
1075
|
// src/commands/remove.ts
|
|
1161
|
-
async function
|
|
1076
|
+
async function findInstalledAgents(slug, type, scope) {
|
|
1162
1077
|
const handler = getHandler(type);
|
|
1163
1078
|
if (!handler) return [];
|
|
1164
|
-
const
|
|
1165
|
-
for (const
|
|
1166
|
-
const installed = await handler.listInstalled(
|
|
1079
|
+
const agents = [];
|
|
1080
|
+
for (const agent of ALL_AGENTS) {
|
|
1081
|
+
const installed = await handler.listInstalled(agent, scope);
|
|
1167
1082
|
if (installed.includes(slug)) {
|
|
1168
|
-
|
|
1083
|
+
agents.push(agent);
|
|
1169
1084
|
}
|
|
1170
1085
|
}
|
|
1171
|
-
return
|
|
1086
|
+
return agents;
|
|
1172
1087
|
}
|
|
1173
|
-
async function
|
|
1088
|
+
async function removeFromAgents(slug, type, agents, scope) {
|
|
1174
1089
|
const handler = getHandler(type);
|
|
1175
1090
|
if (!handler) return 0;
|
|
1176
1091
|
let successCount = 0;
|
|
1177
|
-
for (const
|
|
1178
|
-
const spinner = ora6(`Removing from ${
|
|
1179
|
-
const removed = await handler.uninstall(slug,
|
|
1092
|
+
for (const agent of agents) {
|
|
1093
|
+
const spinner = ora6(`Removing from ${CODING_AGENTS[agent].name}...`).start();
|
|
1094
|
+
const removed = await handler.uninstall(slug, agent, scope);
|
|
1180
1095
|
if (removed) {
|
|
1181
|
-
spinner.succeed(
|
|
1096
|
+
spinner.succeed(brand(`Removed from ${CODING_AGENTS[agent].name}`));
|
|
1182
1097
|
successCount++;
|
|
1183
1098
|
} else {
|
|
1184
|
-
spinner.info(
|
|
1099
|
+
spinner.info(chalk9.gray(`Not found in ${CODING_AGENTS[agent].name}`));
|
|
1185
1100
|
}
|
|
1186
1101
|
}
|
|
1187
1102
|
return successCount;
|
|
1188
1103
|
}
|
|
1189
1104
|
var removeCommand = new Command3("remove").alias("rm").description("Remove an installed item (skill, plugin, agent, hook, mcp)").argument("<name>", "Name/slug of the item to remove").option("-t, --type <type>", "Content type: skill, agent, hook, mcp, plugin, settings").option(
|
|
1190
|
-
"-a, --agents <
|
|
1191
|
-
"Comma-separated
|
|
1105
|
+
"-a, --agents <agents>",
|
|
1106
|
+
"Comma-separated coding agents or 'all'"
|
|
1192
1107
|
).option(
|
|
1193
1108
|
"--scope <scope>",
|
|
1194
1109
|
"Installation scope: project, user, or global",
|
|
@@ -1199,43 +1114,43 @@ var removeCommand = new Command3("remove").alias("rm").description("Remove an in
|
|
|
1199
1114
|
const type = options.type;
|
|
1200
1115
|
if (!type) {
|
|
1201
1116
|
console.log(
|
|
1202
|
-
|
|
1117
|
+
chalk9.yellow(`Please specify the content type with --type (skill, plugin, agent, hook, mcp, settings)`)
|
|
1203
1118
|
);
|
|
1204
1119
|
process.exit(1);
|
|
1205
1120
|
}
|
|
1206
1121
|
const handler = getHandler(type);
|
|
1207
1122
|
if (!handler) {
|
|
1208
|
-
console.log(
|
|
1123
|
+
console.log(chalk9.red(`No handler found for type "${type}"`));
|
|
1209
1124
|
process.exit(1);
|
|
1210
1125
|
}
|
|
1211
|
-
const
|
|
1212
|
-
if (
|
|
1126
|
+
const agents = options.agents ? parseAgentsArg(options.agents, ALL_AGENTS) : await findInstalledAgents(name, type, scope);
|
|
1127
|
+
if (agents.length === 0) {
|
|
1213
1128
|
console.log(
|
|
1214
|
-
|
|
1129
|
+
chalk9.yellow(`${type} "${name}" is not installed in ${scope} scope`)
|
|
1215
1130
|
);
|
|
1216
1131
|
process.exit(0);
|
|
1217
1132
|
}
|
|
1218
1133
|
if (!options.yes) {
|
|
1219
|
-
console.log(
|
|
1134
|
+
console.log(brand(`
|
|
1220
1135
|
Will remove ${type} "${name}" from:`));
|
|
1221
|
-
for (const
|
|
1222
|
-
console.log(` - ${
|
|
1136
|
+
for (const agent of agents) {
|
|
1137
|
+
console.log(` - ${CODING_AGENTS[agent].name}`);
|
|
1223
1138
|
}
|
|
1224
1139
|
console.log("");
|
|
1225
1140
|
const confirmed = await promptConfirm("Proceed with removal?");
|
|
1226
1141
|
if (!confirmed) {
|
|
1227
|
-
console.log(
|
|
1142
|
+
console.log(chalk9.yellow("Removal cancelled"));
|
|
1228
1143
|
process.exit(0);
|
|
1229
1144
|
}
|
|
1230
1145
|
}
|
|
1231
|
-
const successCount = await
|
|
1146
|
+
const successCount = await removeFromAgents(name, type, agents, scope);
|
|
1232
1147
|
console.log("");
|
|
1233
1148
|
if (successCount > 0) {
|
|
1234
1149
|
console.log(
|
|
1235
|
-
|
|
1150
|
+
brand(`Successfully removed from ${successCount} agent(s)`)
|
|
1236
1151
|
);
|
|
1237
1152
|
} else {
|
|
1238
|
-
console.log(
|
|
1153
|
+
console.log(chalk9.yellow("Nothing to remove"));
|
|
1239
1154
|
}
|
|
1240
1155
|
} catch (error2) {
|
|
1241
1156
|
handleCommandError(error2);
|
|
@@ -1244,39 +1159,39 @@ Will remove ${type} "${name}" from:`));
|
|
|
1244
1159
|
|
|
1245
1160
|
// src/commands/init.ts
|
|
1246
1161
|
import { Command as Command4 } from "commander";
|
|
1247
|
-
import
|
|
1162
|
+
import chalk10 from "chalk";
|
|
1248
1163
|
import ora7 from "ora";
|
|
1249
1164
|
import { join as join4 } from "path";
|
|
1250
|
-
var initCommand = new Command4("init").description("Initialize
|
|
1251
|
-
"-a, --agents <
|
|
1252
|
-
"Comma-separated
|
|
1165
|
+
var initCommand = new Command4("init").description("Initialize coding agent configuration directories").option(
|
|
1166
|
+
"-a, --agents <agents>",
|
|
1167
|
+
"Comma-separated coding agents or 'all'",
|
|
1253
1168
|
"claude"
|
|
1254
1169
|
).option("-y, --yes", "Skip confirmation prompts").action(async (options) => {
|
|
1255
1170
|
try {
|
|
1256
|
-
const
|
|
1257
|
-
if (
|
|
1258
|
-
console.error(
|
|
1171
|
+
const agents = parseAgentsArg(options.agents, ALL_AGENTS);
|
|
1172
|
+
if (agents.length === 0) {
|
|
1173
|
+
console.error(chalk10.red("No valid agents specified"));
|
|
1259
1174
|
process.exit(1);
|
|
1260
1175
|
}
|
|
1261
|
-
console.log(
|
|
1262
|
-
for (const
|
|
1263
|
-
const path =
|
|
1264
|
-
console.log(` - ${
|
|
1176
|
+
console.log(brand("\nWill initialize configuration for:"));
|
|
1177
|
+
for (const agent of agents) {
|
|
1178
|
+
const path = getAgentPath(agent, "project");
|
|
1179
|
+
console.log(` - ${CODING_AGENTS[agent].name} \u2192 ${path}`);
|
|
1265
1180
|
}
|
|
1266
1181
|
console.log("");
|
|
1267
1182
|
if (!options.yes) {
|
|
1268
1183
|
const confirmed = await promptConfirm("Proceed?");
|
|
1269
1184
|
if (!confirmed) {
|
|
1270
|
-
console.log(
|
|
1185
|
+
console.log(chalk10.yellow("Cancelled"));
|
|
1271
1186
|
process.exit(0);
|
|
1272
1187
|
}
|
|
1273
1188
|
}
|
|
1274
|
-
for (const
|
|
1275
|
-
const spinner = ora7(`Initializing ${
|
|
1276
|
-
const path =
|
|
1189
|
+
for (const agent of agents) {
|
|
1190
|
+
const spinner = ora7(`Initializing ${CODING_AGENTS[agent].name}...`).start();
|
|
1191
|
+
const path = getAgentPath(agent, "project");
|
|
1277
1192
|
if (await exists(path)) {
|
|
1278
1193
|
spinner.info(
|
|
1279
|
-
|
|
1194
|
+
chalk10.gray(`${CODING_AGENTS[agent].name} already initialized`)
|
|
1280
1195
|
);
|
|
1281
1196
|
continue;
|
|
1282
1197
|
}
|
|
@@ -1284,23 +1199,23 @@ var initCommand = new Command4("init").description("Initialize AI tool configura
|
|
|
1284
1199
|
const readmePath = join4(path, "README.md");
|
|
1285
1200
|
await writeTextFile(
|
|
1286
1201
|
readmePath,
|
|
1287
|
-
`# ${
|
|
1202
|
+
`# ${CODING_AGENTS[agent].name} Configuration
|
|
1288
1203
|
|
|
1289
|
-
This directory contains AI configuration files for ${
|
|
1204
|
+
This directory contains AI configuration files for ${CODING_AGENTS[agent].name}.
|
|
1290
1205
|
|
|
1291
1206
|
Add skills with:
|
|
1292
1207
|
\`\`\`bash
|
|
1293
|
-
npx @toolr/seedr add <skill-name> --agents ${
|
|
1208
|
+
npx @toolr/seedr add <skill-name> --agents ${agent}
|
|
1294
1209
|
\`\`\`
|
|
1295
1210
|
|
|
1296
1211
|
Browse available skills at https://seedr.toolr.dev
|
|
1297
1212
|
`
|
|
1298
1213
|
);
|
|
1299
|
-
spinner.succeed(
|
|
1214
|
+
spinner.succeed(brand(`Initialized ${CODING_AGENTS[agent].name}`));
|
|
1300
1215
|
}
|
|
1301
1216
|
console.log("");
|
|
1302
1217
|
console.log(
|
|
1303
|
-
|
|
1218
|
+
brand("Done! Use 'npx @toolr/seedr add <skill>' to install skills.")
|
|
1304
1219
|
);
|
|
1305
1220
|
} catch (error2) {
|
|
1306
1221
|
handleCommandError(error2);
|
|
@@ -1309,18 +1224,9 @@ Browse available skills at https://seedr.toolr.dev
|
|
|
1309
1224
|
|
|
1310
1225
|
// src/cli.ts
|
|
1311
1226
|
var program = new Command5();
|
|
1312
|
-
program.name("seedr").description("Seed your projects with
|
|
1227
|
+
program.name("seedr").description("Seed your projects with capabilities").version("0.1.0").addCommand(addCommand).addCommand(listCommand).addCommand(removeCommand).addCommand(initCommand);
|
|
1313
1228
|
program.action(() => {
|
|
1314
|
-
|
|
1315
|
-
chalk12.green(`
|
|
1316
|
-
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
1317
|
-
\u2551 \u2551
|
|
1318
|
-
\u2551 \u{1F331} Seedr \u2551
|
|
1319
|
-
\u2551 Seed your projects with AI configs \u2551
|
|
1320
|
-
\u2551 \u2551
|
|
1321
|
-
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
1322
|
-
`)
|
|
1323
|
-
);
|
|
1229
|
+
printLogo();
|
|
1324
1230
|
program.help();
|
|
1325
1231
|
});
|
|
1326
1232
|
program.parse();
|