@morebeans/cli 2.2.0 → 2.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/index.ts +85 -15
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -15,7 +15,7 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
|
15
15
|
import { join, resolve } from "path";
|
|
16
16
|
import { homedir } from "os";
|
|
17
17
|
|
|
18
|
-
const VERSION = "2.
|
|
18
|
+
const VERSION = "2.3.0";
|
|
19
19
|
const BEANS_HOME = join(homedir(), ".beans");
|
|
20
20
|
const BEANS_CONFIG = join(BEANS_HOME, "config.json");
|
|
21
21
|
|
|
@@ -166,12 +166,41 @@ async function cmdInit() {
|
|
|
166
166
|
return;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
// Copy agents
|
|
169
|
+
// Copy core agents from plugin
|
|
170
170
|
info("Installing agents...");
|
|
171
171
|
const agentsSrc = join(pluginSource, "agents");
|
|
172
172
|
if (existsSync(agentsSrc)) {
|
|
173
173
|
await $`cp -r ${agentsSrc}/* ${join(cwd, ".claude/agents/")}`.nothrow();
|
|
174
|
-
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Install essential subagents from catalog
|
|
177
|
+
const beansHome = join(homedir(), ".beans");
|
|
178
|
+
const subagentsSrc = join(beansHome, "package/subagents/categories");
|
|
179
|
+
const agentsDest = join(cwd, ".claude/agents");
|
|
180
|
+
|
|
181
|
+
// Core agents every project should have
|
|
182
|
+
const coreAgents = [
|
|
183
|
+
"04-quality-security/code-reviewer.md",
|
|
184
|
+
"04-quality-security/debugger.md",
|
|
185
|
+
"10-research-analysis/research-analyst.md",
|
|
186
|
+
"06-developer-experience/refactoring-specialist.md",
|
|
187
|
+
"09-meta-orchestration/workflow-orchestrator.md",
|
|
188
|
+
];
|
|
189
|
+
|
|
190
|
+
if (existsSync(subagentsSrc)) {
|
|
191
|
+
let installed = 0;
|
|
192
|
+
for (const agent of coreAgents) {
|
|
193
|
+
const src = join(subagentsSrc, agent);
|
|
194
|
+
const dest = join(agentsDest, agent.split("/").pop()!);
|
|
195
|
+
if (existsSync(src) && !existsSync(dest)) {
|
|
196
|
+
await $`cp ${src} ${dest}`.nothrow();
|
|
197
|
+
installed++;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
success(`Agents installed (${installed} core + plugin agents)`);
|
|
201
|
+
} else {
|
|
202
|
+
success("Plugin agents installed");
|
|
203
|
+
info("Run 'beans init' again after clone to get subagent catalog");
|
|
175
204
|
}
|
|
176
205
|
|
|
177
206
|
// Create commands symlinks (Claude Code discovers commands here)
|
|
@@ -179,8 +208,8 @@ async function cmdInit() {
|
|
|
179
208
|
const commandsDir = join(cwd, ".claude/commands");
|
|
180
209
|
mkdirSync(commandsDir, { recursive: true });
|
|
181
210
|
|
|
182
|
-
// Register
|
|
183
|
-
const beansCommands = ["beans.md", "beans-status.md", "beans-land.md"];
|
|
211
|
+
// Register the BEANS commands
|
|
212
|
+
const beansCommands = ["beans.md", "beans-status.md", "beans-land.md", "beans-agents.md"];
|
|
184
213
|
for (const cmd of beansCommands) {
|
|
185
214
|
const src = join(pluginSource, "commands", cmd);
|
|
186
215
|
if (existsSync(src)) {
|
|
@@ -200,7 +229,20 @@ async function cmdInit() {
|
|
|
200
229
|
if (existsSync(settingsSrc) && !existsSync(settingsDest)) {
|
|
201
230
|
await $`cp ${settingsSrc} ${settingsDest}`.nothrow();
|
|
202
231
|
}
|
|
203
|
-
success("Commands registered (
|
|
232
|
+
success("Commands registered (4 BEANS commands)");
|
|
233
|
+
|
|
234
|
+
// Initialize beads issue tracker (uses .beans directory now)
|
|
235
|
+
info("Initializing issue tracker...");
|
|
236
|
+
try {
|
|
237
|
+
const bdResult = await $`bd init`.nothrow();
|
|
238
|
+
if (bdResult.exitCode === 0) {
|
|
239
|
+
success("Issue tracker initialized (.beans/)");
|
|
240
|
+
} else {
|
|
241
|
+
warn("bd init failed - run 'bd init' manually or install bd CLI");
|
|
242
|
+
}
|
|
243
|
+
} catch {
|
|
244
|
+
warn("bd command not found - install beads CLI for issue tracking");
|
|
245
|
+
}
|
|
204
246
|
|
|
205
247
|
// Track installation
|
|
206
248
|
config.installed_at = config.installed_at || [];
|
|
@@ -220,9 +262,10 @@ async function cmdInit() {
|
|
|
220
262
|
|
|
221
263
|
log(`\n${c.green}${c.bold}✅ BEANS initialized!${c.reset}\n`);
|
|
222
264
|
log("Next steps:");
|
|
223
|
-
log(` ${c.cyan}beans doctor${c.reset}
|
|
224
|
-
log(` ${c.cyan}beans config${c.reset}
|
|
225
|
-
log(` ${c.cyan}/beans${c.reset}
|
|
265
|
+
log(` ${c.cyan}beans doctor${c.reset} # Verify setup`);
|
|
266
|
+
log(` ${c.cyan}beans config${c.reset} # Configure API keys`);
|
|
267
|
+
log(` ${c.cyan}/beans${c.reset} # In Claude Code: start building`);
|
|
268
|
+
log(` ${c.cyan}/beans:agents${c.reset} # Browse 127+ specialized subagents`);
|
|
226
269
|
log("");
|
|
227
270
|
}
|
|
228
271
|
|
|
@@ -414,20 +457,47 @@ async function cmdDoctor(args: string[]) {
|
|
|
414
457
|
|
|
415
458
|
// Count components
|
|
416
459
|
const commands = join(pluginPath, "commands");
|
|
417
|
-
const agents = join(pluginPath, "agents");
|
|
418
460
|
if (existsSync(commands)) {
|
|
419
461
|
const cmdCount = (await $`ls ${commands}/*.md 2>/dev/null`.text().catch(() => "")).split("\n").filter(Boolean).length;
|
|
420
|
-
log(` Commands: ${cmdCount} (/beans, /beans:status, /beans:land)`);
|
|
421
|
-
}
|
|
422
|
-
if (existsSync(agents)) {
|
|
423
|
-
const agentCount = (await $`ls ${agents}`.text()).split("\n").filter(Boolean).length;
|
|
424
|
-
log(` Agents: ${agentCount} subagents`);
|
|
462
|
+
log(` Commands: ${cmdCount} (/beans, /beans:status, /beans:land, /beans:agents)`);
|
|
425
463
|
}
|
|
426
464
|
} else {
|
|
427
465
|
error("Plugin not installed");
|
|
428
466
|
issues++;
|
|
429
467
|
}
|
|
430
468
|
|
|
469
|
+
// Check installed subagents
|
|
470
|
+
log(`\n${c.bold}Subagents${c.reset}`);
|
|
471
|
+
const projectAgents = join(cwd, ".claude/agents");
|
|
472
|
+
const globalAgents = join(homedir(), ".claude/agents");
|
|
473
|
+
const catalogDir = join(homedir(), ".beans/package/subagents/categories");
|
|
474
|
+
|
|
475
|
+
let projectCount = 0;
|
|
476
|
+
let globalCount = 0;
|
|
477
|
+
|
|
478
|
+
if (existsSync(projectAgents)) {
|
|
479
|
+
projectCount = (await $`ls ${projectAgents}/*.md 2>/dev/null`.text().catch(() => "")).split("\n").filter(Boolean).length;
|
|
480
|
+
}
|
|
481
|
+
if (existsSync(globalAgents)) {
|
|
482
|
+
globalCount = (await $`ls ${globalAgents}/*.md 2>/dev/null`.text().catch(() => "")).split("\n").filter(Boolean).length;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
if (projectCount > 0) {
|
|
486
|
+
success(`Project agents: ${projectCount} (.claude/agents/)`);
|
|
487
|
+
} else {
|
|
488
|
+
warn("No project agents installed");
|
|
489
|
+
}
|
|
490
|
+
if (globalCount > 0) {
|
|
491
|
+
success(`Global agents: ${globalCount} (~/.claude/agents/)`);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
if (existsSync(catalogDir)) {
|
|
495
|
+
const catalogCount = (await $`find ${catalogDir} -name "*.md" -not -name "README.md" | wc -l`.text()).trim();
|
|
496
|
+
log(` Catalog: ${catalogCount} available (use /beans:agents to browse)`);
|
|
497
|
+
} else {
|
|
498
|
+
info(" Catalog: not installed (run 'beans init' to get 127+ agents)");
|
|
499
|
+
}
|
|
500
|
+
|
|
431
501
|
log("");
|
|
432
502
|
if (fix && fixed > 0) {
|
|
433
503
|
log(`${c.green}${c.bold}🔧 Fixed ${fixed} issue(s)${c.reset}`);
|