kirorepo 1.0.0 → 1.1.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.
Files changed (2) hide show
  1. package/bin/kirorepo.js +37 -21
  2. package/package.json +1 -1
package/bin/kirorepo.js CHANGED
@@ -35,32 +35,40 @@ function get(url) {
35
35
  }
36
36
 
37
37
  // ── Commands ──────────────────────────────────────────────
38
- async function add(name) {
38
+ async function add(name, forceType) {
39
39
  if (!name) {
40
40
  console.log(`${c.red}✗${c.reset} Usage: ${c.cyan}npx kirorepo add <skill-name>${c.reset}`);
41
- console.log(` Example: ${c.dim}npx kirorepo add systematic-debugging${c.reset}`);
41
+ console.log(` ${c.dim}npx kirorepo add skill <name>${c.reset} — install a skill`);
42
+ console.log(` ${c.dim}npx kirorepo add agent <name>${c.reset} — install a sub-agent`);
43
+ console.log(` ${c.dim}npx kirorepo add <name>${c.reset} — auto-detect type`);
42
44
  process.exit(1);
43
45
  }
44
46
 
45
47
  console.log(`\n${c.magenta}⬡${c.reset} ${c.bold}KiroRepo${c.reset} — Installing ${c.cyan}${name}${c.reset}\n`);
46
48
 
47
- // Try skills first, then agents
48
49
  let resource = null;
49
- let type = 'skills';
50
+ let type = forceType || null;
50
51
 
51
- try {
52
- const data = await get(`${API}/api/skills/${name}`);
53
- resource = JSON.parse(data);
54
- } catch {
52
+ if (type === 'skills' || !type) {
53
+ try {
54
+ const data = await get(`${API}/api/skills/${name}`);
55
+ resource = JSON.parse(data);
56
+ type = 'skills';
57
+ } catch {}
58
+ }
59
+
60
+ if (!resource && (type === 'agents' || !type)) {
55
61
  try {
56
62
  const data = await get(`${API}/api/agents/${name}`);
57
63
  resource = JSON.parse(data);
58
64
  type = 'agents';
59
- } catch {
60
- console.log(`${c.red}✗${c.reset} Resource "${name}" not found in KiroRepository.`);
61
- console.log(` ${c.dim}Browse available resources at https://agents.kirorepository.online/search${c.reset}`);
62
- process.exit(1);
63
- }
65
+ } catch {}
66
+ }
67
+
68
+ if (!resource) {
69
+ console.log(`${c.red}✗${c.reset} Resource "${name}" not found in KiroRepository.`);
70
+ console.log(` ${c.dim}Browse available resources at https://agents.kirorepository.online/search${c.reset}`);
71
+ process.exit(1);
64
72
  }
65
73
 
66
74
  if (!resource.s3DownloadUrl) {
@@ -131,15 +139,17 @@ function help() {
131
139
  ${c.magenta}⬡${c.reset} ${c.bold}KiroRepo${c.reset} — Install Kiro skills & agents with one command
132
140
 
133
141
  ${c.bold}Usage:${c.reset}
134
- npx kirorepo add <name> Install a skill or agent
135
- npx kirorepo list skills List all available skills
136
- npx kirorepo list agents List all available agents
137
- npx kirorepo help Show this help
142
+ npx kirorepo add <name> Auto-detect and install
143
+ npx kirorepo add skill <name> Install a skill
144
+ npx kirorepo add agent <name> Install a sub-agent
145
+ npx kirorepo list skills List all available skills
146
+ npx kirorepo list agents List all available agents
147
+ npx kirorepo help Show this help
138
148
 
139
149
  ${c.bold}Examples:${c.reset}
140
- ${c.cyan}npx kirorepo add systematic-debugging${c.reset}
150
+ ${c.cyan}npx kirorepo add skill systematic-debugging${c.reset}
151
+ ${c.cyan}npx kirorepo add agent code-reviewer${c.reset}
141
152
  ${c.cyan}npx kirorepo add react-best-practices${c.reset}
142
- ${c.cyan}npx kirorepo add code-reviewer${c.reset}
143
153
 
144
154
  ${c.dim}Files are installed to ~/.kiro/skills/ or ~/.kiro/agents/${c.reset}
145
155
  ${c.dim}Browse all resources: https://agents.kirorepository.online${c.reset}
@@ -147,13 +157,19 @@ ${c.dim}Browse all resources: https://agents.kirorepository.online${c.reset}
147
157
  }
148
158
 
149
159
  // ── Main ──────────────────────────────────────────────────
150
- const [,, cmd, arg] = process.argv;
160
+ const [,, cmd, arg, arg2] = process.argv;
151
161
 
152
162
  switch (cmd) {
153
163
  case 'add':
154
164
  case 'install':
155
165
  case 'i':
156
- add(arg);
166
+ if (arg === 'skill' || arg === 'skills') {
167
+ add(arg2, 'skills');
168
+ } else if (arg === 'agent' || arg === 'agents') {
169
+ add(arg2, 'agents');
170
+ } else {
171
+ add(arg, null);
172
+ }
157
173
  break;
158
174
  case 'list':
159
175
  case 'ls':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kirorepo",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Install Kiro skills and agents from KiroRepository with one command",
5
5
  "bin": {
6
6
  "kirorepo": "./bin/kirorepo.js"