@morebeans/cli 2.2.0 → 2.3.1
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 -21
- 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.1";
|
|
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)) {
|
|
@@ -188,19 +217,26 @@ async function cmdInit() {
|
|
|
188
217
|
}
|
|
189
218
|
}
|
|
190
219
|
|
|
191
|
-
// Symlink CLAUDE.md for project docs
|
|
192
|
-
const claudeMd = join(pluginSource, "CLAUDE.md");
|
|
193
|
-
if (existsSync(claudeMd)) {
|
|
194
|
-
await $`ln -sf ${claudeMd} ${join(cwd, ".claude/CLAUDE.md")}`.nothrow();
|
|
195
|
-
}
|
|
196
|
-
|
|
197
220
|
// Copy settings.json if not exists
|
|
198
221
|
const settingsSrc = join(pluginSource, "settings.json");
|
|
199
222
|
const settingsDest = join(cwd, ".claude/settings.json");
|
|
200
223
|
if (existsSync(settingsSrc) && !existsSync(settingsDest)) {
|
|
201
224
|
await $`cp ${settingsSrc} ${settingsDest}`.nothrow();
|
|
202
225
|
}
|
|
203
|
-
success("Commands registered (
|
|
226
|
+
success("Commands registered (4 BEANS commands)");
|
|
227
|
+
|
|
228
|
+
// Initialize beads issue tracker (uses .beans directory now)
|
|
229
|
+
info("Initializing issue tracker...");
|
|
230
|
+
try {
|
|
231
|
+
const bdResult = await $`bd init`.nothrow();
|
|
232
|
+
if (bdResult.exitCode === 0) {
|
|
233
|
+
success("Issue tracker initialized (.beans/)");
|
|
234
|
+
} else {
|
|
235
|
+
warn("bd init failed - run 'bd init' manually or install bd CLI");
|
|
236
|
+
}
|
|
237
|
+
} catch {
|
|
238
|
+
warn("bd command not found - install beads CLI for issue tracking");
|
|
239
|
+
}
|
|
204
240
|
|
|
205
241
|
// Track installation
|
|
206
242
|
config.installed_at = config.installed_at || [];
|
|
@@ -220,9 +256,10 @@ async function cmdInit() {
|
|
|
220
256
|
|
|
221
257
|
log(`\n${c.green}${c.bold}✅ BEANS initialized!${c.reset}\n`);
|
|
222
258
|
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}
|
|
259
|
+
log(` ${c.cyan}beans doctor${c.reset} # Verify setup`);
|
|
260
|
+
log(` ${c.cyan}beans config${c.reset} # Configure API keys`);
|
|
261
|
+
log(` ${c.cyan}/beans${c.reset} # In Claude Code: start building`);
|
|
262
|
+
log(` ${c.cyan}/beans:agents${c.reset} # Browse 127+ specialized subagents`);
|
|
226
263
|
log("");
|
|
227
264
|
}
|
|
228
265
|
|
|
@@ -414,20 +451,47 @@ async function cmdDoctor(args: string[]) {
|
|
|
414
451
|
|
|
415
452
|
// Count components
|
|
416
453
|
const commands = join(pluginPath, "commands");
|
|
417
|
-
const agents = join(pluginPath, "agents");
|
|
418
454
|
if (existsSync(commands)) {
|
|
419
455
|
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`);
|
|
456
|
+
log(` Commands: ${cmdCount} (/beans, /beans:status, /beans:land, /beans:agents)`);
|
|
425
457
|
}
|
|
426
458
|
} else {
|
|
427
459
|
error("Plugin not installed");
|
|
428
460
|
issues++;
|
|
429
461
|
}
|
|
430
462
|
|
|
463
|
+
// Check installed subagents
|
|
464
|
+
log(`\n${c.bold}Subagents${c.reset}`);
|
|
465
|
+
const projectAgents = join(cwd, ".claude/agents");
|
|
466
|
+
const globalAgents = join(homedir(), ".claude/agents");
|
|
467
|
+
const catalogDir = join(homedir(), ".beans/package/subagents/categories");
|
|
468
|
+
|
|
469
|
+
let projectCount = 0;
|
|
470
|
+
let globalCount = 0;
|
|
471
|
+
|
|
472
|
+
if (existsSync(projectAgents)) {
|
|
473
|
+
projectCount = (await $`ls ${projectAgents}/*.md 2>/dev/null`.text().catch(() => "")).split("\n").filter(Boolean).length;
|
|
474
|
+
}
|
|
475
|
+
if (existsSync(globalAgents)) {
|
|
476
|
+
globalCount = (await $`ls ${globalAgents}/*.md 2>/dev/null`.text().catch(() => "")).split("\n").filter(Boolean).length;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
if (projectCount > 0) {
|
|
480
|
+
success(`Project agents: ${projectCount} (.claude/agents/)`);
|
|
481
|
+
} else {
|
|
482
|
+
warn("No project agents installed");
|
|
483
|
+
}
|
|
484
|
+
if (globalCount > 0) {
|
|
485
|
+
success(`Global agents: ${globalCount} (~/.claude/agents/)`);
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
if (existsSync(catalogDir)) {
|
|
489
|
+
const catalogCount = (await $`find ${catalogDir} -name "*.md" -not -name "README.md" | wc -l`.text()).trim();
|
|
490
|
+
log(` Catalog: ${catalogCount} available (use /beans:agents to browse)`);
|
|
491
|
+
} else {
|
|
492
|
+
info(" Catalog: not installed (run 'beans init' to get 127+ agents)");
|
|
493
|
+
}
|
|
494
|
+
|
|
431
495
|
log("");
|
|
432
496
|
if (fix && fixed > 0) {
|
|
433
497
|
log(`${c.green}${c.bold}🔧 Fixed ${fixed} issue(s)${c.reset}`);
|