@morebeans/cli 2.3.3 → 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.
- package/index.ts +16 -10
- 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.
|
|
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
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
//
|
|
133
|
+
// Remove old and move new
|
|
128
134
|
if (existsSync(beansHome)) {
|
|
129
|
-
await $`rm -rf ${beansHome}
|
|
135
|
+
await $`rm -rf ${beansHome}`;
|
|
130
136
|
}
|
|
131
|
-
await $`
|
|
137
|
+
await $`mv ${tmpDir} ${beansHome}`;
|
|
132
138
|
|
|
133
139
|
// Restore config
|
|
134
140
|
if (configBackup) {
|
|
135
|
-
writeFileSync(
|
|
141
|
+
writeFileSync(configPath, JSON.stringify(configBackup, null, 2));
|
|
136
142
|
}
|
|
137
|
-
success("BEANS repo cloned to ~/.beans (
|
|
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
|
|
|
@@ -181,7 +188,6 @@ async function cmdInit() {
|
|
|
181
188
|
}
|
|
182
189
|
|
|
183
190
|
// Install essential subagents from catalog
|
|
184
|
-
const beansHome = join(homedir(), ".beans");
|
|
185
191
|
const subagentsSrc = join(beansHome, "package/subagents/categories");
|
|
186
192
|
const agentsDest = join(cwd, ".claude/agents");
|
|
187
193
|
|