guolei-agents 1.0.2

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/bin/agents.js ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { spawn } from 'child_process';
4
+ import { fileURLToPath } from 'url';
5
+ import { dirname, join } from 'path';
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = dirname(__filename);
9
+
10
+ const distPath = join(__dirname, '..', 'dist', 'index.js');
11
+
12
+ const args = process.argv.slice(2);
13
+ const child = spawn('node', [distPath, ...args], {
14
+ stdio: 'inherit'
15
+ });
16
+
17
+ child.on('exit', (code) => {
18
+ process.exit(code || 0);
19
+ });
package/build.mjs ADDED
@@ -0,0 +1,47 @@
1
+ import * as esbuild from 'esbuild';
2
+ import { copyFileSync, mkdirSync, existsSync } from 'fs';
3
+ import { dirname, join } from 'path';
4
+ import { fileURLToPath } from 'url';
5
+
6
+ const __dirname = dirname(fileURLToPath(import.meta.url));
7
+
8
+ async function build() {
9
+ // Ensure dist directory exists
10
+ if (!existsSync(join(__dirname, 'dist'))) {
11
+ mkdirSync(join(__dirname, 'dist'), { recursive: true });
12
+ }
13
+
14
+ // Build the main entry point
15
+ await esbuild.build({
16
+ entryPoints: [join(__dirname, 'src/index.ts')],
17
+ bundle: true,
18
+ platform: 'node',
19
+ format: 'esm',
20
+ outdir: join(__dirname, 'dist'),
21
+ external: ['./node_modules/*'],
22
+ sourcemap: true,
23
+ minify: false,
24
+ });
25
+
26
+ // Copy bin file
27
+ copyFileSync(
28
+ join(__dirname, 'bin/agents.js'),
29
+ join(__dirname, 'dist/agents.js')
30
+ );
31
+
32
+ // Copy templates
33
+ if (!existsSync(join(__dirname, 'dist/templates'))) {
34
+ mkdirSync(join(__dirname, 'dist/templates'), { recursive: true });
35
+ }
36
+ copyFileSync(
37
+ join(__dirname, 'templates/default-agent.md'),
38
+ join(__dirname, 'dist/templates/default-agent.md')
39
+ );
40
+
41
+ console.log('Build complete!');
42
+ }
43
+
44
+ build().catch((err) => {
45
+ console.error(err);
46
+ process.exit(1);
47
+ });
package/dist/agents.js ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { spawn } from 'child_process';
4
+ import { fileURLToPath } from 'url';
5
+ import { dirname, join } from 'path';
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = dirname(__filename);
9
+
10
+ const distPath = join(__dirname, '..', 'dist', 'index.js');
11
+
12
+ const args = process.argv.slice(2);
13
+ const child = spawn('node', [distPath, ...args], {
14
+ stdio: 'inherit'
15
+ });
16
+
17
+ child.on('exit', (code) => {
18
+ process.exit(code || 0);
19
+ });
package/dist/index.js ADDED
@@ -0,0 +1,577 @@
1
+ #!/usr/bin/env node
2
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
3
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
4
+ }) : x)(function(x) {
5
+ if (typeof require !== "undefined") return require.apply(this, arguments);
6
+ throw Error('Dynamic require of "' + x + '" is not supported');
7
+ });
8
+
9
+ // src/index.ts
10
+ import { Command } from "../node_modules/commander/esm.mjs";
11
+
12
+ // src/commands/add.ts
13
+ import ora from "../node_modules/ora/index.js";
14
+
15
+ // src/core/installer.ts
16
+ import { join as join3, basename as basename3 } from "path";
17
+ import { existsSync as existsSync3, readdirSync as readdirSync3, readFileSync as readFileSync3, copyFileSync as copyFileSync2, symlinkSync as symlinkSync2, rmSync as rmSync2 } from "fs";
18
+ import { tmpdir } from "os";
19
+ import { mkdtempSync } from "fs";
20
+
21
+ // src/core/parser.ts
22
+ import matter from "../node_modules/gray-matter/index.js";
23
+ function parseAgentFile(content, path) {
24
+ const { data, content: body } = matter(content);
25
+ if (!data.description) {
26
+ throw new Error(`Agent at ${path} is missing required "description" field in frontmatter`);
27
+ }
28
+ const agent = {
29
+ description: data.description,
30
+ name: data.name,
31
+ mode: data.mode,
32
+ model: data.model,
33
+ temperature: data.temperature,
34
+ maxSteps: data.maxSteps,
35
+ color: data.color,
36
+ trigger: data.trigger,
37
+ hidden: data.hidden,
38
+ tools: data.tools,
39
+ permission: data.permission,
40
+ mcp: data.mcp,
41
+ version: data.version
42
+ };
43
+ return {
44
+ path,
45
+ agent,
46
+ content: body.trim()
47
+ };
48
+ }
49
+
50
+ // src/core/discover.ts
51
+ import { join as join2, basename as basename2 } from "path";
52
+ import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
53
+
54
+ // src/utils/filesystem.ts
55
+ import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync, symlinkSync, copyFileSync, rmSync, statSync } from "fs";
56
+ import { join, dirname } from "path";
57
+ import { homedir } from "os";
58
+ function ensureDir(dir) {
59
+ if (!existsSync(dir)) {
60
+ mkdirSync(dir, { recursive: true });
61
+ }
62
+ }
63
+ function isDirectory(path) {
64
+ return existsSync(path) && statSync(path).isDirectory();
65
+ }
66
+ function getPlatformPaths(platform, global) {
67
+ const home = homedir();
68
+ const paths = {
69
+ "opencode": {
70
+ project: [".opencode/agents/"],
71
+ global: [join(home, ".config", "opencode", "agents")]
72
+ },
73
+ "claude-code": {
74
+ project: [".claude/agents/"],
75
+ global: [join(home, ".claude", "agents")]
76
+ },
77
+ "cursor": {
78
+ project: [".cursor/agents/"],
79
+ global: [join(home, ".cursor", "agents")]
80
+ },
81
+ "windsurf": {
82
+ project: [".windsurf/agents/"],
83
+ global: [join(home, ".codeium", "windsurf", "agents")]
84
+ },
85
+ "cline": {
86
+ project: [".cline/agents/"],
87
+ global: [join(home, ".cline", "agents")]
88
+ },
89
+ "roo": {
90
+ project: [".roo/agents/"],
91
+ global: [join(home, ".roo", "agents")]
92
+ },
93
+ "codex": {
94
+ project: [".codex/agents/"],
95
+ global: [join(home, ".codex", "agents")]
96
+ },
97
+ "continue": {
98
+ project: [".continue/agents/"],
99
+ global: [join(home, ".continue", "agents")]
100
+ }
101
+ };
102
+ return global ? paths[platform].global : paths[platform].project;
103
+ }
104
+ function findFiles(dir, pattern) {
105
+ const results = [];
106
+ if (!existsSync(dir)) {
107
+ return results;
108
+ }
109
+ const files = readdirSync(dir);
110
+ for (const file of files) {
111
+ const fullPath = join(dir, file);
112
+ if (isDirectory(fullPath)) {
113
+ results.push(...findFiles(fullPath, pattern));
114
+ } else if (pattern.test(file)) {
115
+ results.push(fullPath);
116
+ }
117
+ }
118
+ return results;
119
+ }
120
+ function detectPlatforms() {
121
+ const platforms = [];
122
+ const home = homedir();
123
+ const cwd = process.cwd();
124
+ const checks = [
125
+ {
126
+ platform: "opencode",
127
+ check: () => existsSync(join(home, ".config", "opencode")) || existsSync(join(cwd, ".opencode"))
128
+ },
129
+ {
130
+ platform: "claude-code",
131
+ check: () => existsSync(join(home, ".claude")) || existsSync(join(cwd, ".claude"))
132
+ },
133
+ {
134
+ platform: "cursor",
135
+ check: () => existsSync(join(home, ".cursor")) || existsSync(join(cwd, ".cursor"))
136
+ },
137
+ {
138
+ platform: "windsurf",
139
+ check: () => existsSync(join(home, ".codeium", "windsurf")) || existsSync(join(cwd, ".windsurf"))
140
+ },
141
+ {
142
+ platform: "cline",
143
+ check: () => existsSync(join(home, ".cline")) || existsSync(join(cwd, ".cline"))
144
+ },
145
+ {
146
+ platform: "roo",
147
+ check: () => existsSync(join(home, ".roo")) || existsSync(join(cwd, ".roo"))
148
+ },
149
+ {
150
+ platform: "codex",
151
+ check: () => existsSync(join(home, ".codex")) || existsSync(join(cwd, ".codex"))
152
+ },
153
+ {
154
+ platform: "continue",
155
+ check: () => existsSync(join(home, ".continue")) || existsSync(join(cwd, ".continue"))
156
+ }
157
+ ];
158
+ for (const check of checks) {
159
+ if (check.check()) {
160
+ platforms.push(check.platform);
161
+ }
162
+ }
163
+ if (platforms.length === 0) {
164
+ platforms.push("opencode");
165
+ }
166
+ return platforms;
167
+ }
168
+
169
+ // src/core/discover.ts
170
+ var SEARCH_DIRECTORIES = [
171
+ "",
172
+ "agents",
173
+ ".agents",
174
+ ".opencode/agents",
175
+ "src/agents"
176
+ ];
177
+ var PRIORITY_FILES = [
178
+ "AGENTS.md",
179
+ "SKILL.md",
180
+ "AGENT.md"
181
+ ];
182
+ async function discoverFromDirectory(dir) {
183
+ const agents = [];
184
+ for (const subDir of SEARCH_DIRECTORIES) {
185
+ const searchDir = subDir ? join2(dir, subDir) : dir;
186
+ if (!existsSync2(searchDir)) continue;
187
+ const mdFiles = findFiles(searchDir, /\.md$/);
188
+ for (const file of mdFiles) {
189
+ const fileName = basename2(file);
190
+ if (fileName.startsWith(".")) continue;
191
+ if (fileName === "README.md") continue;
192
+ try {
193
+ const content = readFileSync2(file, "utf-8");
194
+ const agentFile = parseAgentFile(content, file);
195
+ agents.push(agentFile);
196
+ } catch (err) {
197
+ continue;
198
+ }
199
+ }
200
+ }
201
+ for (const fileName of PRIORITY_FILES) {
202
+ const priorityFile = join2(dir, fileName);
203
+ if (existsSync2(priorityFile)) {
204
+ try {
205
+ const content = readFileSync2(priorityFile, "utf-8");
206
+ const agentFile = parseAgentFile(content, priorityFile);
207
+ const exists = agents.some((a) => a.path === agentFile.path);
208
+ if (!exists) {
209
+ agents.unshift(agentFile);
210
+ }
211
+ } catch (err) {
212
+ continue;
213
+ }
214
+ }
215
+ }
216
+ return agents;
217
+ }
218
+
219
+ // src/utils/logger.ts
220
+ import chalk from "../node_modules/chalk/source/index.js";
221
+ var logger = {
222
+ info: (msg) => console.log(chalk.blue("\u2139"), msg),
223
+ success: (msg) => console.log(chalk.green("\u2713"), msg),
224
+ warn: (msg) => console.log(chalk.yellow("\u26A0"), msg),
225
+ error: (msg) => console.error(chalk.red("\u2717"), msg),
226
+ debug: (msg) => {
227
+ if (process.env.DEBUG === "npx-agents") {
228
+ console.log(chalk.gray("[debug]"), msg);
229
+ }
230
+ }
231
+ };
232
+
233
+ // src/core/installer.ts
234
+ async function installAgent(options) {
235
+ const { source, global, platforms, agentName, copy } = options;
236
+ logger.info(`Installing agent from: ${source}`);
237
+ const tempDir = await fetchSource(source);
238
+ try {
239
+ const agents = await discoverFromDirectory(tempDir);
240
+ if (agents.length === 0) {
241
+ throw new Error("No agents found in the source");
242
+ }
243
+ for (const platform of platforms) {
244
+ const targetPaths = getPlatformPaths(platform, global);
245
+ for (const targetPath of targetPaths) {
246
+ ensureDir(targetPath);
247
+ for (const agentFile of agents) {
248
+ const name = agentName || agentFile.agent.name || basename3(agentFile.path, ".md");
249
+ const finalPath = join3(targetPath, `${name}.md`);
250
+ if (existsSync3(finalPath) && !options.yes) {
251
+ logger.warn(`Agent "${name}" already exists at ${finalPath}`);
252
+ continue;
253
+ }
254
+ if (copy) {
255
+ const sourcePath = agentFile.path;
256
+ if (isDirectory(sourcePath)) {
257
+ copyDirectory(sourcePath, join3(targetPath, name));
258
+ } else {
259
+ copyFileSync2(sourcePath, finalPath);
260
+ }
261
+ logger.success(`Copied agent "${name}" to ${finalPath}`);
262
+ } else {
263
+ const sourceDir = tempDir;
264
+ try {
265
+ symlinkSync2(sourceDir, finalPath, "dir");
266
+ logger.success(`Symlinked agent "${name}" to ${finalPath}`);
267
+ } catch (err) {
268
+ logger.warn(`Failed to create symlink, copying instead: ${err}`);
269
+ copyDirectory(sourceDir, join3(targetPath, name));
270
+ logger.success(`Copied agent "${name}" to ${targetPath}`);
271
+ }
272
+ }
273
+ }
274
+ }
275
+ }
276
+ } finally {
277
+ if (existsSync3(tempDir) && tempDir.startsWith(tmpdir())) {
278
+ rmSync2(tempDir, { recursive: true, force: true });
279
+ }
280
+ }
281
+ }
282
+ async function fetchSource(source) {
283
+ if (source.startsWith(".") || source.startsWith("/") || /^[a-zA-Z]:\\/.test(source)) {
284
+ return source;
285
+ }
286
+ const degit = await import("../node_modules/degit/dist/index.js");
287
+ const tempDir = mkdtempSync(join3(tmpdir(), "npx-agents-"));
288
+ const parts = source.split("/");
289
+ let owner = parts[0];
290
+ let repo = parts[1]?.replace(/#.+$/, "") || "";
291
+ let ref = "";
292
+ if (source.includes("#")) {
293
+ const [repoPart, refPart] = source.split("#");
294
+ repo = repoPart.split("/")[1];
295
+ ref = refPart;
296
+ }
297
+ try {
298
+ const target = ref ? `${owner}/${repo}#${ref}` : `${owner}/${repo}`;
299
+ await degit.default(target).clone(tempDir);
300
+ return tempDir;
301
+ } catch (err) {
302
+ rmSync2(tempDir, { recursive: true, force: true });
303
+ throw new Error(`Failed to fetch from ${source}: ${err}`);
304
+ }
305
+ }
306
+ function copyDirectory(source, target) {
307
+ ensureDir(target);
308
+ const files = readdirSync3(source);
309
+ for (const file of files) {
310
+ const srcPath = join3(source, file);
311
+ const destPath = join3(target, file);
312
+ if (isDirectory(srcPath)) {
313
+ copyDirectory(srcPath, destPath);
314
+ } else {
315
+ copyFileSync2(srcPath, destPath);
316
+ }
317
+ }
318
+ }
319
+ function listInstalledAgents(platform, global) {
320
+ const agents = [];
321
+ const paths = getPlatformPaths(platform, global);
322
+ for (const path of paths) {
323
+ if (!existsSync3(path)) continue;
324
+ const mdFiles = findFiles(path, /\.md$/);
325
+ for (const file of mdFiles) {
326
+ try {
327
+ const content = readFileSync3(file, "utf-8");
328
+ const agentFile = parseAgentFile(content, file);
329
+ agents.push(agentFile);
330
+ } catch (err) {
331
+ continue;
332
+ }
333
+ }
334
+ }
335
+ return agents;
336
+ }
337
+ function removeAgent(name, platform, global) {
338
+ const paths = getPlatformPaths(platform, global);
339
+ for (const path of paths) {
340
+ const agentPath = join3(path, `${name}.md`);
341
+ if (existsSync3(agentPath)) {
342
+ rmSync2(agentPath, { recursive: true, force: true });
343
+ logger.success(`Removed agent "${name}" from ${path}`);
344
+ return true;
345
+ }
346
+ if (existsSync3(path)) {
347
+ const entries = readdirSync3(path);
348
+ for (const entry of entries) {
349
+ const entryPath = join3(path, entry);
350
+ const linkTarget = existsSync3(entryPath) ? entryPath : null;
351
+ if (linkTarget && readlinkCheck(entryPath, name)) {
352
+ rmSync2(entryPath, { recursive: true, force: true });
353
+ logger.success(`Removed agent "${name}" from ${path}`);
354
+ return true;
355
+ }
356
+ }
357
+ }
358
+ }
359
+ return false;
360
+ }
361
+ function readlinkCheck(path, name) {
362
+ try {
363
+ const stat = __require("fs").lstatSync(path);
364
+ return stat.isSymbolicLink() && path.includes(name);
365
+ } catch {
366
+ return false;
367
+ }
368
+ }
369
+
370
+ // src/commands/add.ts
371
+ async function addCommand(source, options) {
372
+ const spinner = ora("Installing agent...").start();
373
+ try {
374
+ let platforms;
375
+ if (options.agent && options.agent.length > 0) {
376
+ platforms = options.agent;
377
+ } else {
378
+ platforms = detectPlatforms();
379
+ }
380
+ const installOptions = {
381
+ source,
382
+ global: options.global,
383
+ platforms,
384
+ agentName: options.agentName,
385
+ copy: options.copy,
386
+ yes: options.yes
387
+ };
388
+ await installAgent(installOptions);
389
+ spinner.succeed(`Successfully installed agent from ${source}`);
390
+ } catch (err) {
391
+ spinner.fail(`Failed to install agent: ${err instanceof Error ? err.message : String(err)}`);
392
+ logger.error(String(err));
393
+ process.exit(1);
394
+ }
395
+ }
396
+
397
+ // src/commands/list.ts
398
+ import chalk2 from "../node_modules/chalk/source/index.js";
399
+ async function listCommand(options) {
400
+ let platforms;
401
+ if (options.agent) {
402
+ platforms = [options.agent];
403
+ } else {
404
+ platforms = detectPlatforms();
405
+ }
406
+ const scope = options.global ? "global" : "project";
407
+ for (const platform of platforms) {
408
+ const agents = listInstalledAgents(platform, options.global);
409
+ if (agents.length === 0) {
410
+ logger.info(`No agents found for ${platform} (${scope})`);
411
+ continue;
412
+ }
413
+ console.log(chalk2.bold(`
414
+ ${platform} agents (${scope}):
415
+ `));
416
+ for (const agent of agents) {
417
+ const name = agent.agent.name || agent.path.split(/[/\\]/).pop()?.replace(".md", "") || "unknown";
418
+ const mode = agent.agent.mode || "subagent";
419
+ const description = agent.agent.description || "No description";
420
+ console.log(` ${chalk2.cyan(name)} ${chalk2.gray(`[${mode}]`)}`);
421
+ console.log(` ${chalk2.dim(description)}
422
+ `);
423
+ }
424
+ }
425
+ }
426
+
427
+ // src/commands/remove.ts
428
+ import ora2 from "../node_modules/ora/index.js";
429
+ async function removeCommand(name, options) {
430
+ const spinner = ora2(`Removing agent "${name}"...`).start();
431
+ try {
432
+ let platforms;
433
+ if (options.agent) {
434
+ platforms = [options.agent];
435
+ } else {
436
+ platforms = detectPlatforms();
437
+ }
438
+ let removed = false;
439
+ for (const platform of platforms) {
440
+ const result = removeAgent(name, platform, options.global);
441
+ if (result) {
442
+ removed = true;
443
+ }
444
+ }
445
+ if (removed) {
446
+ spinner.succeed(`Removed agent "${name}"`);
447
+ } else {
448
+ spinner.warn(`Agent "${name}" not found`);
449
+ }
450
+ } catch (err) {
451
+ spinner.fail(`Failed to remove agent: ${err instanceof Error ? err.message : String(err)}`);
452
+ process.exit(1);
453
+ }
454
+ }
455
+
456
+ // src/commands/init.ts
457
+ import { join as join4 } from "path";
458
+ import { existsSync as existsSync4, readFileSync as readFileSync4 } from "fs";
459
+ import { fileURLToPath } from "url";
460
+ import { dirname as dirname2 } from "path";
461
+ var __dirname = dirname2(fileURLToPath(import.meta.url));
462
+ async function initCommand(name, _options) {
463
+ try {
464
+ const targetName = name || "my-agent";
465
+ const targetDir = name ? join4(process.cwd(), name) : process.cwd();
466
+ const targetPath = join4(targetDir, `${targetName}.md`);
467
+ if (existsSync4(targetPath)) {
468
+ logger.error(`Agent file already exists at ${targetPath}`);
469
+ process.exit(1);
470
+ }
471
+ ensureDir(targetDir);
472
+ let template;
473
+ const templatePath = join4(__dirname, "..", "..", "templates", "default-agent.md");
474
+ if (existsSync4(templatePath)) {
475
+ template = readFileSync4(templatePath, "utf-8");
476
+ } else {
477
+ template = getDefaultTemplate(targetName);
478
+ }
479
+ const fs = await import("fs");
480
+ fs.writeFileSync(targetPath, template, "utf-8");
481
+ logger.success(`Created agent template at ${targetPath}`);
482
+ console.log(`
483
+ You can now edit ${targetPath} to customize your agent.`);
484
+ } catch (err) {
485
+ logger.error(`Failed to create agent: ${err instanceof Error ? err.message : String(err)}`);
486
+ process.exit(1);
487
+ }
488
+ }
489
+ function getDefaultTemplate(name) {
490
+ return `---
491
+ description: ${name} - Add your agent description here
492
+ mode: subagent
493
+ model: anthropic/claude-3-5-sonnet-20241022
494
+ temperature: 0.7
495
+ tools:
496
+ read: true
497
+ write: true
498
+ edit: true
499
+ bash: false
500
+ glob: true
501
+ grep: true
502
+ task: false
503
+ skill: false
504
+ hidden: false
505
+ ---
506
+
507
+ # ${name}
508
+
509
+ You are a custom AI agent. Describe your purpose and behavior here.
510
+
511
+ ## When to Use
512
+
513
+ Describe when this agent should be invoked.
514
+
515
+ ## Workflow
516
+
517
+ 1. First step...
518
+ 2. Second step...
519
+ 3. Third step...
520
+
521
+ ## Guidelines
522
+
523
+ - Add your specific guidelines here
524
+ - Be clear and concise
525
+ `;
526
+ }
527
+
528
+ // src/commands/find.ts
529
+ import chalk3 from "../node_modules/chalk/source/index.js";
530
+ async function findCommand(query, _options) {
531
+ if (!query) {
532
+ console.log(chalk3.bold("\nSearch for agents\n"));
533
+ console.log("Usage: npx agents find <query>");
534
+ console.log("\nExample:");
535
+ console.log(" npx agents find code-review");
536
+ console.log(" npx agents find testing");
537
+ return;
538
+ }
539
+ logger.info(`Searching for agents matching "${query}"...`);
540
+ console.log(chalk3.yellow("\nNote: Agent search functionality requires integration with skills.sh API."));
541
+ console.log("For now, you can browse agents at: https://skills.sh\n");
542
+ console.log(chalk3.dim("Alternatively, you can:"));
543
+ console.log(chalk3.dim(" 1. Check GitHub for agent repositories"));
544
+ console.log(chalk3.dim(' 2. Use "npx agents add <owner/repo>" to install directly'));
545
+ }
546
+
547
+ // src/commands/check.ts
548
+ import chalk4 from "../node_modules/chalk/source/index.js";
549
+ async function checkCommand() {
550
+ logger.info("Checking for agent updates...");
551
+ console.log(chalk4.yellow("\nNote: Update checking requires version tracking."));
552
+ console.log("To update agents, use: npx agents add <source> --force\n");
553
+ console.log(chalk4.dim("Add version info to your agents to enable update checking."));
554
+ }
555
+
556
+ // src/commands/update.ts
557
+ import chalk5 from "../node_modules/chalk/source/index.js";
558
+ async function updateCommand() {
559
+ logger.info("Updating agents...");
560
+ console.log(chalk5.yellow("\nNote: Auto-update functionality coming soon.\n"));
561
+ console.log(chalk5.dim("To update an agent, remove it and reinstall:"));
562
+ console.log(chalk5.dim(" npx agents remove <agent-name>"));
563
+ console.log(chalk5.dim(" npx agents add <source>"));
564
+ }
565
+
566
+ // src/index.ts
567
+ var program = new Command();
568
+ program.name("agents").description("CLI for managing AI coding agents").version("1.0.0");
569
+ program.command("add <source>").description("Install one or more agents from a GitHub repository or local path").option("-g, --global", "Install to global directory", false).option("-a, --agent <agents...>", "Target agent platform(s)").option("--agent-name <name>", "Name for the installed agent").option("-y, --yes", "Skip confirmation", false).option("--copy", "Copy instead of symlink", false).action(addCommand);
570
+ program.command("list").description("List installed agents").option("-g, --global", "List only global agents").option("-a, --agent <agent>", "Filter by platform").action(listCommand);
571
+ program.command("remove <name>").description("Remove an installed agent").option("-g, --global", "Remove from global directory").option("-a, --agent <agent>", "Remove from specific platform").action(removeCommand);
572
+ program.command("init [name]").description("Create a new agent definition template").action(initCommand);
573
+ program.command("find [query]").description("Search for available agents").action(findCommand);
574
+ program.command("check").description("Check for updates to installed agents").action(checkCommand);
575
+ program.command("update").description("Update all installed agents to the latest version").action(updateCommand);
576
+ program.parse();
577
+ //# sourceMappingURL=index.js.map