@morebeans/cli 2.1.3 → 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.
Files changed (2) hide show
  1. package/index.ts +94 -21
  2. 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.1.3";
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
- success("Agents installed");
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 only the clean BEANS commands (not all 44 underlying commands)
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 (3 BEANS commands)");
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} # Verify setup`);
224
- log(` ${c.cyan}beans config${c.reset} # Configure API keys`);
225
- log(` ${c.cyan}/beans${c.reset} # In Claude Code: start building`);
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
 
@@ -348,9 +391,12 @@ async function cmdDoctor(args: string[]) {
348
391
  }
349
392
  }
350
393
 
351
- // Check .beads (created by bd init)
352
- if (existsSync(join(cwd, ".beads"))) {
353
- success(".beads (beads issue tracker)");
394
+ // Check beads database (now in .beans, created by bd init)
395
+ const beansDir = join(cwd, ".beans");
396
+ const hasBeadsDb = existsSync(join(beansDir, "beads.db")) || existsSync(join(beansDir, "issues.jsonl"));
397
+
398
+ if (hasBeadsDb) {
399
+ success(".beans/beads.db (issue tracker)");
354
400
 
355
401
  // Run bd doctor if --fix
356
402
  if (fix) {
@@ -368,16 +414,16 @@ async function cmdDoctor(args: string[]) {
368
414
  }
369
415
  } else {
370
416
  if (fix) {
371
- info("Initializing beads...");
417
+ info("Initializing beads (bd init)...");
372
418
  try {
373
419
  await $`bd init`.nothrow();
374
- success(".beads initialized");
420
+ success("beads initialized in .beans/");
375
421
  fixed++;
376
422
  } catch {
377
423
  warn("bd init failed - run manually");
378
424
  }
379
425
  } else {
380
- warn(".beads not initialized (run 'beans doctor --fix' or 'bd init')");
426
+ warn("beads not initialized (run 'beans doctor --fix' or 'bd init')");
381
427
  }
382
428
  }
383
429
 
@@ -411,20 +457,47 @@ async function cmdDoctor(args: string[]) {
411
457
 
412
458
  // Count components
413
459
  const commands = join(pluginPath, "commands");
414
- const agents = join(pluginPath, "agents");
415
460
  if (existsSync(commands)) {
416
461
  const cmdCount = (await $`ls ${commands}/*.md 2>/dev/null`.text().catch(() => "")).split("\n").filter(Boolean).length;
417
- log(` Commands: ${cmdCount} (/beans, /beans:status, /beans:land)`);
418
- }
419
- if (existsSync(agents)) {
420
- const agentCount = (await $`ls ${agents}`.text()).split("\n").filter(Boolean).length;
421
- log(` Agents: ${agentCount} subagents`);
462
+ log(` Commands: ${cmdCount} (/beans, /beans:status, /beans:land, /beans:agents)`);
422
463
  }
423
464
  } else {
424
465
  error("Plugin not installed");
425
466
  issues++;
426
467
  }
427
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
+
428
501
  log("");
429
502
  if (fix && fixed > 0) {
430
503
  log(`${c.green}${c.bold}🔧 Fixed ${fixed} issue(s)${c.reset}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morebeans/cli",
3
- "version": "2.1.3",
3
+ "version": "2.3.0",
4
4
  "description": "BEANS CLI - Setup and configure autonomous development for Claude Code",
5
5
  "type": "module",
6
6
  "main": "index.ts",