@morebeans/cli 2.0.0 → 2.0.2

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 +29 -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.0.0";
18
+ const VERSION = "2.0.2";
19
19
  const BEANS_HOME = join(homedir(), ".beans");
20
20
  const BEANS_CONFIG = join(BEANS_HOME, "config.json");
21
21
 
@@ -101,10 +101,10 @@ async function cmdInit() {
101
101
  const dirs = [
102
102
  ".claude/plugins",
103
103
  ".claude/agents",
104
- ".beads/analysis",
105
- ".beads/context",
106
- ".beads/cache",
107
- ".beads/logs",
104
+ ".beans/analysis",
105
+ ".beans/context",
106
+ ".beans/cache",
107
+ ".beans/logs",
108
108
  ];
109
109
 
110
110
  for (const dir of dirs) {
@@ -115,6 +115,7 @@ async function cmdInit() {
115
115
  // Find plugin source
116
116
  const pluginSources = [
117
117
  join(cwd, "submodules/beans/plugin"),
118
+ join(cwd, "plugin"), // If running from beans repo itself
118
119
  join(homedir(), ".beans/plugin"),
119
120
  join(import.meta.dir, "../plugin"),
120
121
  ];
@@ -127,11 +128,30 @@ async function cmdInit() {
127
128
  }
128
129
  }
129
130
 
131
+ // Auto-clone if not found
130
132
  if (!pluginSource) {
131
- error("Could not find BEANS plugin source");
132
- info("Clone the beans repo first:");
133
- log(` git clone https://github.com/shinyobjectz/beans.git ~/.beans`);
134
- return;
133
+ info("BEANS plugin not found locally, cloning from GitHub...");
134
+ const beansHome = join(homedir(), ".beans");
135
+
136
+ try {
137
+ if (existsSync(beansHome)) {
138
+ info("Updating existing ~/.beans...");
139
+ await $`cd ${beansHome} && git pull`.quiet();
140
+ } else {
141
+ await $`git clone https://github.com/shinyobjectz/beans.git ${beansHome}`;
142
+ }
143
+ pluginSource = join(beansHome, "plugin");
144
+
145
+ if (!existsSync(pluginSource)) {
146
+ error("Clone succeeded but plugin directory not found");
147
+ return;
148
+ }
149
+ success("BEANS repo cloned to ~/.beans");
150
+ } catch (e) {
151
+ error(`Failed to clone BEANS repo: ${e}`);
152
+ info("Try manually: git clone https://github.com/shinyobjectz/beans.git ~/.beans");
153
+ return;
154
+ }
135
155
  }
136
156
 
137
157
  // Symlink plugin
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morebeans/cli",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "BEANS CLI - Setup and configure autonomous development for Claude Code",
5
5
  "type": "module",
6
6
  "main": "index.ts",