golem-cc 0.1.29 → 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 +17 -12
- package/bin/install.cjs +42 -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,28 @@ 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
|
+
echo ""
|
|
232
|
+
echo -e " ${YELLOW}What's New:${NC}"
|
|
233
|
+
echo -e " ${DIM}• Pretty markdown output (bundled renderer)${NC}"
|
|
234
|
+
echo -e " ${DIM}• Better build loop progress (task display, timing)${NC}"
|
|
235
|
+
echo -e " ${DIM}• All files now inside .golem/ directory${NC}"
|
|
231
236
|
echo ""
|
|
232
237
|
|
|
233
238
|
# Create directories
|
|
@@ -464,7 +469,7 @@ run_plan_mode() {
|
|
|
464
469
|
elif [[ -f "$GOLEM_DIR/golem/prompts/PROMPT_plan.md" ]]; then
|
|
465
470
|
prompt_file="$GOLEM_DIR/golem/prompts/PROMPT_plan.md"
|
|
466
471
|
else
|
|
467
|
-
status_line "✗" "$RED" "No PROMPT_plan.md found. Run golem --
|
|
472
|
+
status_line "✗" "$RED" "No PROMPT_plan.md found. Run golem --init first."
|
|
468
473
|
exit 1
|
|
469
474
|
fi
|
|
470
475
|
|
|
@@ -529,7 +534,7 @@ run_build_loop() {
|
|
|
529
534
|
build_prompt="$GOLEM_DIR/golem/prompts/PROMPT_build.md"
|
|
530
535
|
else
|
|
531
536
|
status_line "✗" "$RED" "No PROMPT_build.md found"
|
|
532
|
-
echo -e " ${DIM}Run: golem --
|
|
537
|
+
echo -e " ${DIM}Run: golem --init${NC}"
|
|
533
538
|
log_event "BUILD_ABORT" "No PROMPT_build.md found"
|
|
534
539
|
exit $EXIT_ERROR
|
|
535
540
|
fi
|
|
@@ -752,8 +757,8 @@ main() {
|
|
|
752
757
|
local command="${1:-}"
|
|
753
758
|
|
|
754
759
|
case "$command" in
|
|
755
|
-
--
|
|
756
|
-
|
|
760
|
+
--init)
|
|
761
|
+
cmd_init
|
|
757
762
|
;;
|
|
758
763
|
--yolo)
|
|
759
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';
|
|
@@ -25,34 +24,28 @@ ${cyan} ██████╗ ██████╗ ██╗ ███
|
|
|
25
24
|
|
|
26
25
|
Golem ${dim}v${pkg.version}${reset}
|
|
27
26
|
${dim}"Ruby's son is a doctor, and you're letting a computer write your code?"${reset}
|
|
27
|
+
|
|
28
|
+
${yellow}What's New:${reset}
|
|
29
|
+
${dim}• Pretty markdown output (bundled renderer)${reset}
|
|
30
|
+
${dim}• Better build loop progress (task display, timing)${reset}
|
|
31
|
+
${dim}• All files now inside .golem/ directory${reset}
|
|
28
32
|
`;
|
|
29
33
|
|
|
30
34
|
// Parse args
|
|
31
35
|
const args = process.argv.slice(2);
|
|
32
|
-
const hasGlobal = args.includes('--global') || args.includes('-g');
|
|
33
|
-
const hasLocal = args.includes('--local') || args.includes('-l');
|
|
34
36
|
const hasHelp = args.includes('--help') || args.includes('-h');
|
|
35
37
|
|
|
36
38
|
console.log(banner);
|
|
37
39
|
|
|
38
40
|
// Show help if requested
|
|
39
41
|
if (hasHelp) {
|
|
40
|
-
console.log(` ${yellow}Usage:${reset} npx golem-cc
|
|
42
|
+
console.log(` ${yellow}Usage:${reset} npx golem-cc
|
|
41
43
|
|
|
42
44
|
${yellow}Options:${reset}
|
|
43
|
-
${cyan}-g, --global${reset} Install globally (to ~/.claude)
|
|
44
|
-
${cyan}-l, --local${reset} Install locally (to ./.claude in current directory)
|
|
45
45
|
${cyan}-h, --help${reset} Show this help message
|
|
46
46
|
|
|
47
|
-
${yellow}Examples:${reset}
|
|
48
|
-
${dim}# Install to default ~/.claude directory${reset}
|
|
49
|
-
npx golem-cc --global
|
|
50
|
-
|
|
51
|
-
${dim}# Install to current project only${reset}
|
|
52
|
-
npx golem-cc --local
|
|
53
|
-
|
|
54
47
|
${yellow}After Installation:${reset}
|
|
55
|
-
golem --
|
|
48
|
+
golem --init Initialize golem in current project
|
|
56
49
|
golem run plan Create implementation plan
|
|
57
50
|
golem run build Run autonomous build loop
|
|
58
51
|
golem simplify Simplify code
|
|
@@ -199,56 +192,46 @@ function verifyInstalled(dirPath, description) {
|
|
|
199
192
|
}
|
|
200
193
|
|
|
201
194
|
/**
|
|
202
|
-
* Install
|
|
195
|
+
* Install golem globally
|
|
203
196
|
*/
|
|
204
|
-
function install(
|
|
197
|
+
function install() {
|
|
205
198
|
const src = path.join(__dirname, '..');
|
|
206
|
-
const claudeDir =
|
|
207
|
-
? path.join(os.homedir(), '.claude')
|
|
208
|
-
: path.join(process.cwd(), '.claude');
|
|
209
|
-
|
|
199
|
+
const claudeDir = path.join(os.homedir(), '.claude');
|
|
210
200
|
const golemHomeDir = path.join(os.homedir(), '.golem');
|
|
201
|
+
const pathPrefix = '~/.claude/';
|
|
211
202
|
|
|
212
|
-
|
|
213
|
-
? '~/.claude'
|
|
214
|
-
: './.claude';
|
|
215
|
-
|
|
216
|
-
const pathPrefix = isGlobal ? '~/.claude/' : './.claude/';
|
|
217
|
-
|
|
218
|
-
console.log(` Installing to ${cyan}${locationLabel}${reset}\n`);
|
|
203
|
+
console.log(` Installing to ${cyan}~/.claude${reset} and ${cyan}~/.golem${reset}\n`);
|
|
219
204
|
|
|
220
205
|
const failures = [];
|
|
221
206
|
|
|
222
207
|
// Create directories
|
|
223
208
|
fs.mkdirSync(claudeDir, { recursive: true });
|
|
224
209
|
|
|
225
|
-
//
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
console.log(` ${green}✓${reset} Installed markdown renderer`);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
// Also copy golem directory for the CLI to reference
|
|
248
|
-
const golemDataSrc = path.join(src, 'golem');
|
|
249
|
-
const golemDataDest = path.join(golemHomeDir, 'golem');
|
|
250
|
-
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`);
|
|
251
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);
|
|
252
235
|
}
|
|
253
236
|
|
|
254
237
|
// Copy commands/golem
|
|
@@ -277,11 +260,9 @@ function install(isGlobal) {
|
|
|
277
260
|
const versionDest = path.join(claudeDir, 'golem', 'VERSION');
|
|
278
261
|
fs.writeFileSync(versionDest, pkg.version);
|
|
279
262
|
|
|
280
|
-
//
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
fs.writeFileSync(golemVersionDest, pkg.version);
|
|
284
|
-
}
|
|
263
|
+
// Also write VERSION to ~/.golem/ for CLI access
|
|
264
|
+
const golemVersionDest = path.join(golemHomeDir, 'VERSION');
|
|
265
|
+
fs.writeFileSync(golemVersionDest, pkg.version);
|
|
285
266
|
console.log(` ${green}✓${reset} Wrote VERSION (${pkg.version})`);
|
|
286
267
|
|
|
287
268
|
// Install shell alias
|
|
@@ -299,7 +280,7 @@ function install(isGlobal) {
|
|
|
299
280
|
|
|
300
281
|
${yellow}Next steps:${reset}
|
|
301
282
|
1. Restart your shell (or run: ${cyan}${sourceCmd}${reset})
|
|
302
|
-
2. Run ${cyan}golem --
|
|
283
|
+
2. Run ${cyan}golem --init${reset} in your project directory
|
|
303
284
|
|
|
304
285
|
${yellow}Workflow:${reset}
|
|
305
286
|
claude → /golem:spec → Define requirements (interactive)
|
|
@@ -308,54 +289,5 @@ function install(isGlobal) {
|
|
|
308
289
|
`);
|
|
309
290
|
}
|
|
310
291
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
*/
|
|
314
|
-
function promptLocation() {
|
|
315
|
-
if (!process.stdin.isTTY) {
|
|
316
|
-
console.log(` ${yellow}Non-interactive terminal, defaulting to local install${reset}\n`);
|
|
317
|
-
install(false);
|
|
318
|
-
return;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
const rl = readline.createInterface({
|
|
322
|
-
input: process.stdin,
|
|
323
|
-
output: process.stdout
|
|
324
|
-
});
|
|
325
|
-
|
|
326
|
-
let answered = false;
|
|
327
|
-
|
|
328
|
-
rl.on('close', () => {
|
|
329
|
-
if (!answered) {
|
|
330
|
-
answered = true;
|
|
331
|
-
console.log(`\n ${yellow}Defaulting to local install${reset}\n`);
|
|
332
|
-
install(false);
|
|
333
|
-
}
|
|
334
|
-
});
|
|
335
|
-
|
|
336
|
-
console.log(` ${yellow}Where would you like to install?${reset}
|
|
337
|
-
|
|
338
|
-
${cyan}1${reset}) Local ${dim}(./.claude)${reset} - this project only (Recommended)
|
|
339
|
-
${cyan}2${reset}) Global ${dim}(~/.claude)${reset} - available in all projects
|
|
340
|
-
`);
|
|
341
|
-
|
|
342
|
-
rl.question(` Choice ${dim}[1]${reset}: `, (answer) => {
|
|
343
|
-
answered = true;
|
|
344
|
-
rl.close();
|
|
345
|
-
const choice = answer.trim() || '1';
|
|
346
|
-
const isGlobal = choice === '2';
|
|
347
|
-
install(isGlobal);
|
|
348
|
-
});
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
// Main
|
|
352
|
-
if (hasGlobal && hasLocal) {
|
|
353
|
-
console.error(` ${yellow}Cannot specify both --global and --local${reset}`);
|
|
354
|
-
process.exit(1);
|
|
355
|
-
} else if (hasGlobal) {
|
|
356
|
-
install(true);
|
|
357
|
-
} else if (hasLocal) {
|
|
358
|
-
install(false);
|
|
359
|
-
} else {
|
|
360
|
-
promptLocation();
|
|
361
|
-
}
|
|
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/",
|