@morebeans/cli 2.3.4 → 2.4.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 +34 -14
  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.3.4";
18
+ const VERSION = "2.4.0";
19
19
  const BEANS_HOME = join(homedir(), ".beans");
20
20
  const BEANS_CONFIG = join(BEANS_HOME, "config.json");
21
21
 
@@ -120,23 +120,30 @@ async function cmdInit() {
120
120
  info("Setting up global BEANS repo (~/.beans)...");
121
121
  try {
122
122
  // Backup config if exists
123
- const configBackup = existsSync(join(beansHome, "config.json"))
124
- ? JSON.parse(readFileSync(join(beansHome, "config.json"), "utf-8"))
125
- : null;
123
+ let configBackup: any = null;
124
+ const configPath = join(beansHome, "config.json");
125
+ if (existsSync(configPath)) {
126
+ configBackup = JSON.parse(readFileSync(configPath, "utf-8"));
127
+ }
128
+
129
+ // Clone to temp, then move (avoids rm -rf issues with locks)
130
+ const tmpDir = `/tmp/beans-clone-${Date.now()}`;
131
+ await $`git clone --depth 1 https://github.com/shinyobjectz/beans.git ${tmpDir}`;
126
132
 
127
- // Clone fresh (removes any partial state)
133
+ // Remove old and move new
128
134
  if (existsSync(beansHome)) {
129
- await $`rm -rf ${beansHome}`.quiet();
135
+ await $`rm -rf ${beansHome}`;
130
136
  }
131
- await $`git clone https://github.com/shinyobjectz/beans.git ${beansHome}`.quiet();
137
+ await $`mv ${tmpDir} ${beansHome}`;
132
138
 
133
139
  // Restore config
134
140
  if (configBackup) {
135
- writeFileSync(join(beansHome, "config.json"), JSON.stringify(configBackup, null, 2));
141
+ writeFileSync(configPath, JSON.stringify(configBackup, null, 2));
136
142
  }
137
- success("BEANS repo cloned to ~/.beans (subagent catalog available)");
143
+ success("BEANS repo cloned to ~/.beans (127+ subagents available)");
138
144
  } catch (e) {
139
145
  warn(`Could not clone global BEANS repo: ${e}`);
146
+ info("Run manually: git clone https://github.com/shinyobjectz/beans.git ~/.beans");
140
147
  }
141
148
  }
142
149
 
@@ -214,8 +221,12 @@ async function cmdInit() {
214
221
  const commandsDir = join(cwd, ".claude/commands");
215
222
  mkdirSync(commandsDir, { recursive: true });
216
223
 
217
- // Register the BEANS commands
218
- const beansCommands = ["beans.md", "beans-status.md", "beans-land.md", "beans-agents.md"];
224
+ // Register ALL BEANS commands (core + phase commands)
225
+ const beansCommands = [
226
+ "beans.md", "beans-status.md", "beans-land.md", "beans-agents.md",
227
+ "beans-new.md", "beans-research.md", "beans-requirements.md",
228
+ "beans-design.md", "beans-tasks.md", "beans-implement.md"
229
+ ];
219
230
  for (const cmd of beansCommands) {
220
231
  const src = join(pluginSource, "commands", cmd);
221
232
  if (existsSync(src)) {
@@ -223,13 +234,22 @@ async function cmdInit() {
223
234
  }
224
235
  }
225
236
 
237
+ // Install beans-loop script to ~/.local/bin
238
+ const loopScript = join(beansHome, "scripts/beans-loop.sh");
239
+ const localBin = join(homedir(), ".local/bin");
240
+ if (existsSync(loopScript)) {
241
+ mkdirSync(localBin, { recursive: true });
242
+ await $`cp ${loopScript} ${join(localBin, "beans-loop")}`.nothrow();
243
+ await $`chmod +x ${join(localBin, "beans-loop")}`.nothrow();
244
+ }
245
+
226
246
  // Copy settings.json if not exists
227
247
  const settingsSrc = join(pluginSource, "settings.json");
228
248
  const settingsDest = join(cwd, ".claude/settings.json");
229
249
  if (existsSync(settingsSrc) && !existsSync(settingsDest)) {
230
250
  await $`cp ${settingsSrc} ${settingsDest}`.nothrow();
231
251
  }
232
- success("Commands registered (4 BEANS commands)");
252
+ success("Commands registered (10 BEANS commands + beans-loop)");
233
253
 
234
254
  // Initialize beads issue tracker (uses .beans directory now)
235
255
  info("Initializing issue tracker...");
@@ -263,9 +283,9 @@ async function cmdInit() {
263
283
  log(`\n${c.green}${c.bold}✅ BEANS initialized!${c.reset}\n`);
264
284
  log("Next steps:");
265
285
  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`);
286
+ log(` ${c.cyan}/beans:new${c.reset} # Create new spec with PRD flow`);
268
287
  log(` ${c.cyan}/beans:agents${c.reset} # Browse 127+ specialized subagents`);
288
+ log(` ${c.cyan}beans-loop${c.reset} # Autonomous execution (bash)`);
269
289
  log("");
270
290
  }
271
291
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morebeans/cli",
3
- "version": "2.3.4",
3
+ "version": "2.4.0",
4
4
  "description": "BEANS CLI - Setup and configure autonomous development for Claude Code",
5
5
  "type": "module",
6
6
  "main": "index.ts",