@morebeans/cli 2.3.4 → 2.3.5

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 +16 -9
  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.3.5";
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morebeans/cli",
3
- "version": "2.3.4",
3
+ "version": "2.3.5",
4
4
  "description": "BEANS CLI - Setup and configure autonomous development for Claude Code",
5
5
  "type": "module",
6
6
  "main": "index.ts",