golem-cc 0.1.30 → 0.2.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/README.md +7 -7
- package/bin/golem +12 -12
- package/bin/install.cjs +37 -110
- package/commands/golem/help.md +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -85,16 +85,16 @@ Golem is an autonomous coding loop that implements features while you watch (or
|
|
|
85
85
|
|
|
86
86
|
```bash
|
|
87
87
|
# npm
|
|
88
|
-
npx golem-cc
|
|
88
|
+
npx golem-cc
|
|
89
89
|
|
|
90
90
|
# pnpm
|
|
91
|
-
pnpm dlx golem-cc
|
|
91
|
+
pnpm dlx golem-cc
|
|
92
92
|
|
|
93
93
|
# yarn
|
|
94
|
-
yarn dlx golem-cc
|
|
94
|
+
yarn dlx golem-cc
|
|
95
95
|
|
|
96
96
|
# bun
|
|
97
|
-
bunx golem-cc
|
|
97
|
+
bunx golem-cc
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
Then reload your shell:
|
|
@@ -107,7 +107,7 @@ source ~/.zshrc # or ~/.bashrc
|
|
|
107
107
|
```bash
|
|
108
108
|
# 1. Initialize in your project
|
|
109
109
|
cd my-project
|
|
110
|
-
golem --
|
|
110
|
+
golem --init
|
|
111
111
|
|
|
112
112
|
# 2. Define what you're building (interactive)
|
|
113
113
|
claude
|
|
@@ -147,7 +147,7 @@ Then it loops. Fresh context each time. No degradation.
|
|
|
147
147
|
### CLI Commands
|
|
148
148
|
| Command | Description |
|
|
149
149
|
|---------|-------------|
|
|
150
|
-
| `golem --
|
|
150
|
+
| `golem --init` | Initialize golem in current project |
|
|
151
151
|
| `golem run plan` | Create implementation plan from specs |
|
|
152
152
|
| `golem run build` | Run the autonomous build loop |
|
|
153
153
|
| `golem simplify` | Run code simplifier on demand |
|
|
@@ -172,7 +172,7 @@ golem run build --no-simplify # Skip simplification step
|
|
|
172
172
|
|
|
173
173
|
## Project Structure
|
|
174
174
|
|
|
175
|
-
After running `golem --
|
|
175
|
+
After running `golem --init`:
|
|
176
176
|
|
|
177
177
|
```
|
|
178
178
|
my-project/
|
package/bin/golem
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# Usage:
|
|
6
6
|
# golem Launch interactive session
|
|
7
7
|
# golem --yolo Launch with --dangerously-skip-permissions
|
|
8
|
-
# golem --
|
|
8
|
+
# golem --init Initialize golem in current project
|
|
9
9
|
# golem spec Build specs through conversation
|
|
10
10
|
# golem run plan Create implementation plan
|
|
11
11
|
# golem run build Run autonomous build loop
|
|
@@ -194,7 +194,7 @@ print_usage() {
|
|
|
194
194
|
echo " status --check Exit 0 if complete, 1 if incomplete, 2 if no plan"
|
|
195
195
|
echo ""
|
|
196
196
|
echo -e "${BLUE}Options:${NC}"
|
|
197
|
-
echo " --
|
|
197
|
+
echo " --init Initialize golem in current project"
|
|
198
198
|
echo " --yolo Launch with --dangerously-skip-permissions"
|
|
199
199
|
echo " --iterations N Limit build loop to N iterations"
|
|
200
200
|
echo " --no-simplify Skip code simplification in build loop"
|
|
@@ -211,23 +211,23 @@ print_usage() {
|
|
|
211
211
|
echo " done"
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
# Check if golem is
|
|
214
|
+
# Check if golem is initialized in current project
|
|
215
215
|
check_installed() {
|
|
216
216
|
if [[ ! -d ".golem" ]]; then
|
|
217
217
|
echo ""
|
|
218
|
-
status_line "✗" "$RED" "Golem not
|
|
219
|
-
echo -e " ${DIM}Run: golem --
|
|
218
|
+
status_line "✗" "$RED" "Golem not initialized in this project"
|
|
219
|
+
echo -e " ${DIM}Run: golem --init${NC}"
|
|
220
220
|
echo ""
|
|
221
221
|
exit 1
|
|
222
222
|
fi
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
#
|
|
226
|
-
|
|
225
|
+
# Initialize golem in current project
|
|
226
|
+
cmd_init() {
|
|
227
227
|
print_banner
|
|
228
228
|
local version
|
|
229
229
|
version=$(get_version)
|
|
230
|
-
header_box "
|
|
230
|
+
header_box "INITIALIZING v$version" "$BLUE"
|
|
231
231
|
echo ""
|
|
232
232
|
echo -e " ${YELLOW}What's New:${NC}"
|
|
233
233
|
echo -e " ${DIM}• Pretty markdown output (bundled renderer)${NC}"
|
|
@@ -469,7 +469,7 @@ run_plan_mode() {
|
|
|
469
469
|
elif [[ -f "$GOLEM_DIR/golem/prompts/PROMPT_plan.md" ]]; then
|
|
470
470
|
prompt_file="$GOLEM_DIR/golem/prompts/PROMPT_plan.md"
|
|
471
471
|
else
|
|
472
|
-
status_line "✗" "$RED" "No PROMPT_plan.md found. Run golem --
|
|
472
|
+
status_line "✗" "$RED" "No PROMPT_plan.md found. Run golem --init first."
|
|
473
473
|
exit 1
|
|
474
474
|
fi
|
|
475
475
|
|
|
@@ -534,7 +534,7 @@ run_build_loop() {
|
|
|
534
534
|
build_prompt="$GOLEM_DIR/golem/prompts/PROMPT_build.md"
|
|
535
535
|
else
|
|
536
536
|
status_line "✗" "$RED" "No PROMPT_build.md found"
|
|
537
|
-
echo -e " ${DIM}Run: golem --
|
|
537
|
+
echo -e " ${DIM}Run: golem --init${NC}"
|
|
538
538
|
log_event "BUILD_ABORT" "No PROMPT_build.md found"
|
|
539
539
|
exit $EXIT_ERROR
|
|
540
540
|
fi
|
|
@@ -757,8 +757,8 @@ main() {
|
|
|
757
757
|
local command="${1:-}"
|
|
758
758
|
|
|
759
759
|
case "$command" in
|
|
760
|
-
--
|
|
761
|
-
|
|
760
|
+
--init)
|
|
761
|
+
cmd_init
|
|
762
762
|
;;
|
|
763
763
|
--yolo)
|
|
764
764
|
shift
|
package/bin/install.cjs
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const os = require('os');
|
|
6
|
-
const readline = require('readline');
|
|
7
6
|
|
|
8
7
|
// Colors
|
|
9
8
|
const cyan = '\x1b[36m';
|
|
@@ -34,30 +33,19 @@ ${cyan} ██████╗ ██████╗ ██╗ ███
|
|
|
34
33
|
|
|
35
34
|
// Parse args
|
|
36
35
|
const args = process.argv.slice(2);
|
|
37
|
-
const hasGlobal = args.includes('--global') || args.includes('-g');
|
|
38
|
-
const hasLocal = args.includes('--local') || args.includes('-l');
|
|
39
36
|
const hasHelp = args.includes('--help') || args.includes('-h');
|
|
40
37
|
|
|
41
38
|
console.log(banner);
|
|
42
39
|
|
|
43
40
|
// Show help if requested
|
|
44
41
|
if (hasHelp) {
|
|
45
|
-
console.log(` ${yellow}Usage:${reset} npx golem-cc
|
|
42
|
+
console.log(` ${yellow}Usage:${reset} npx golem-cc
|
|
46
43
|
|
|
47
44
|
${yellow}Options:${reset}
|
|
48
|
-
${cyan}-g, --global${reset} Install globally (to ~/.claude)
|
|
49
|
-
${cyan}-l, --local${reset} Install locally (to ./.claude in current directory)
|
|
50
45
|
${cyan}-h, --help${reset} Show this help message
|
|
51
46
|
|
|
52
|
-
${yellow}Examples:${reset}
|
|
53
|
-
${dim}# Install to default ~/.claude directory${reset}
|
|
54
|
-
npx golem-cc --global
|
|
55
|
-
|
|
56
|
-
${dim}# Install to current project only${reset}
|
|
57
|
-
npx golem-cc --local
|
|
58
|
-
|
|
59
47
|
${yellow}After Installation:${reset}
|
|
60
|
-
golem --
|
|
48
|
+
golem --init Initialize golem in current project
|
|
61
49
|
golem run plan Create implementation plan
|
|
62
50
|
golem run build Run autonomous build loop
|
|
63
51
|
golem simplify Simplify code
|
|
@@ -204,56 +192,46 @@ function verifyInstalled(dirPath, description) {
|
|
|
204
192
|
}
|
|
205
193
|
|
|
206
194
|
/**
|
|
207
|
-
* Install
|
|
195
|
+
* Install golem globally
|
|
208
196
|
*/
|
|
209
|
-
function install(
|
|
197
|
+
function install() {
|
|
210
198
|
const src = path.join(__dirname, '..');
|
|
211
|
-
const claudeDir =
|
|
212
|
-
? path.join(os.homedir(), '.claude')
|
|
213
|
-
: path.join(process.cwd(), '.claude');
|
|
214
|
-
|
|
199
|
+
const claudeDir = path.join(os.homedir(), '.claude');
|
|
215
200
|
const golemHomeDir = path.join(os.homedir(), '.golem');
|
|
201
|
+
const pathPrefix = '~/.claude/';
|
|
216
202
|
|
|
217
|
-
|
|
218
|
-
? '~/.claude'
|
|
219
|
-
: './.claude';
|
|
220
|
-
|
|
221
|
-
const pathPrefix = isGlobal ? '~/.claude/' : './.claude/';
|
|
222
|
-
|
|
223
|
-
console.log(` Installing to ${cyan}${locationLabel}${reset}\n`);
|
|
203
|
+
console.log(` Installing to ${cyan}~/.claude${reset} and ${cyan}~/.golem${reset}\n`);
|
|
224
204
|
|
|
225
205
|
const failures = [];
|
|
226
206
|
|
|
227
207
|
// Create directories
|
|
228
208
|
fs.mkdirSync(claudeDir, { recursive: true });
|
|
229
209
|
|
|
230
|
-
//
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
console.log(` ${green}✓${reset} Installed markdown renderer`);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
// Also copy golem directory for the CLI to reference
|
|
253
|
-
const golemDataSrc = path.join(src, 'golem');
|
|
254
|
-
const golemDataDest = path.join(golemHomeDir, 'golem');
|
|
255
|
-
copyWithPathReplacement(golemDataSrc, golemDataDest, pathPrefix);
|
|
210
|
+
// Install the golem CLI script
|
|
211
|
+
const binDir = path.join(golemHomeDir, 'bin');
|
|
212
|
+
fs.mkdirSync(binDir, { recursive: true });
|
|
213
|
+
|
|
214
|
+
const golemScriptSrc = path.join(src, 'bin', 'golem');
|
|
215
|
+
const golemScriptDest = path.join(binDir, 'golem');
|
|
216
|
+
|
|
217
|
+
if (fs.existsSync(golemScriptSrc)) {
|
|
218
|
+
fs.copyFileSync(golemScriptSrc, golemScriptDest);
|
|
219
|
+
fs.chmodSync(golemScriptDest, 0o755);
|
|
220
|
+
console.log(` ${green}✓${reset} Installed golem CLI to ~/.golem/bin/`);
|
|
221
|
+
|
|
222
|
+
// Copy markdown renderer
|
|
223
|
+
const renderMdSrc = path.join(src, 'bin', 'render-md.cjs');
|
|
224
|
+
const renderMdDest = path.join(binDir, 'render-md.cjs');
|
|
225
|
+
if (fs.existsSync(renderMdSrc)) {
|
|
226
|
+
fs.copyFileSync(renderMdSrc, renderMdDest);
|
|
227
|
+
fs.chmodSync(renderMdDest, 0o755);
|
|
228
|
+
console.log(` ${green}✓${reset} Installed markdown renderer`);
|
|
256
229
|
}
|
|
230
|
+
|
|
231
|
+
// Also copy golem directory for the CLI to reference
|
|
232
|
+
const golemDataSrc = path.join(src, 'golem');
|
|
233
|
+
const golemDataDest = path.join(golemHomeDir, 'golem');
|
|
234
|
+
copyWithPathReplacement(golemDataSrc, golemDataDest, pathPrefix);
|
|
257
235
|
}
|
|
258
236
|
|
|
259
237
|
// Copy commands/golem
|
|
@@ -282,11 +260,9 @@ function install(isGlobal) {
|
|
|
282
260
|
const versionDest = path.join(claudeDir, 'golem', 'VERSION');
|
|
283
261
|
fs.writeFileSync(versionDest, pkg.version);
|
|
284
262
|
|
|
285
|
-
//
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
fs.writeFileSync(golemVersionDest, pkg.version);
|
|
289
|
-
}
|
|
263
|
+
// Also write VERSION to ~/.golem/ for CLI access
|
|
264
|
+
const golemVersionDest = path.join(golemHomeDir, 'VERSION');
|
|
265
|
+
fs.writeFileSync(golemVersionDest, pkg.version);
|
|
290
266
|
console.log(` ${green}✓${reset} Wrote VERSION (${pkg.version})`);
|
|
291
267
|
|
|
292
268
|
// Install shell alias
|
|
@@ -304,7 +280,7 @@ function install(isGlobal) {
|
|
|
304
280
|
|
|
305
281
|
${yellow}Next steps:${reset}
|
|
306
282
|
1. Restart your shell (or run: ${cyan}${sourceCmd}${reset})
|
|
307
|
-
2. Run ${cyan}golem --
|
|
283
|
+
2. Run ${cyan}golem --init${reset} in your project directory
|
|
308
284
|
|
|
309
285
|
${yellow}Workflow:${reset}
|
|
310
286
|
claude → /golem:spec → Define requirements (interactive)
|
|
@@ -313,54 +289,5 @@ function install(isGlobal) {
|
|
|
313
289
|
`);
|
|
314
290
|
}
|
|
315
291
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
*/
|
|
319
|
-
function promptLocation() {
|
|
320
|
-
if (!process.stdin.isTTY) {
|
|
321
|
-
console.log(` ${yellow}Non-interactive terminal, defaulting to local install${reset}\n`);
|
|
322
|
-
install(false);
|
|
323
|
-
return;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
const rl = readline.createInterface({
|
|
327
|
-
input: process.stdin,
|
|
328
|
-
output: process.stdout
|
|
329
|
-
});
|
|
330
|
-
|
|
331
|
-
let answered = false;
|
|
332
|
-
|
|
333
|
-
rl.on('close', () => {
|
|
334
|
-
if (!answered) {
|
|
335
|
-
answered = true;
|
|
336
|
-
console.log(`\n ${yellow}Defaulting to local install${reset}\n`);
|
|
337
|
-
install(false);
|
|
338
|
-
}
|
|
339
|
-
});
|
|
340
|
-
|
|
341
|
-
console.log(` ${yellow}Where would you like to install?${reset}
|
|
342
|
-
|
|
343
|
-
${cyan}1${reset}) Local ${dim}(./.claude)${reset} - this project only (Recommended)
|
|
344
|
-
${cyan}2${reset}) Global ${dim}(~/.claude)${reset} - available in all projects
|
|
345
|
-
`);
|
|
346
|
-
|
|
347
|
-
rl.question(` Choice ${dim}[1]${reset}: `, (answer) => {
|
|
348
|
-
answered = true;
|
|
349
|
-
rl.close();
|
|
350
|
-
const choice = answer.trim() || '1';
|
|
351
|
-
const isGlobal = choice === '2';
|
|
352
|
-
install(isGlobal);
|
|
353
|
-
});
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
// Main
|
|
357
|
-
if (hasGlobal && hasLocal) {
|
|
358
|
-
console.error(` ${yellow}Cannot specify both --global and --local${reset}`);
|
|
359
|
-
process.exit(1);
|
|
360
|
-
} else if (hasGlobal) {
|
|
361
|
-
install(true);
|
|
362
|
-
} else if (hasLocal) {
|
|
363
|
-
install(false);
|
|
364
|
-
} else {
|
|
365
|
-
promptLocation();
|
|
366
|
-
}
|
|
292
|
+
// Main - always install globally
|
|
293
|
+
install();
|
package/commands/golem/help.md
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "golem-cc",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Autonomous coding loop with Claude - structured specs, ralph loop execution, code simplification",
|
|
5
5
|
"bin": {
|
|
6
|
-
"golem-cc": "
|
|
6
|
+
"golem-cc": "bin/install.cjs"
|
|
7
7
|
},
|
|
8
8
|
"files": [
|
|
9
9
|
"bin/",
|