godotmaker-cli 0.2.0

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.
@@ -0,0 +1,346 @@
1
+ # godotmaker-cli 上手测试指南
2
+
3
+ > English: [GETTING_STARTED.md](./GETTING_STARTED.md) · 参考手册:[README.zh-CN.md](./README.zh-CN.md)
4
+
5
+ 这份指南带你完成第一次端到端的测试会话。假设你以前没跑过这个工具。读完之后你会:
6
+
7
+ 1. 在不烧 agent token 的前提下验证你的环境装对了。
8
+ 2. 从一句话点子生成一个完整的 Godot 项目。
9
+ 3. 摸过所有失败 / 恢复 / 交互路径,真用的时候不会被吓到。
10
+
11
+ 如果你看到的跟这里写的不符,留下 `.godotmaker/` 目录和终端输出,提个 issue。
12
+
13
+ ---
14
+
15
+ ## 0. 环境准备
16
+
17
+ | 工具 | 版本 | 验证方式 |
18
+ |---|---|---|
19
+ | Node.js | 22+ | `node --version` |
20
+ | Claude Code CLI 或 Codex CLI | latest | `claude --version` 或 `codex --version` |
21
+ | Godot | 4.x | `godot --version`(或者直接打开 GUI) |
22
+
23
+ 选中的 agent 二进制必须在 PATH 上**且**已认证。版本探测跑不通的话,安装对应的 agent CLI 然后重开 shell。
24
+
25
+ CLI 会在 preflight 时把 GodotMaker framework(`/gm-scaffold`、
26
+ `/gm-gdd`、`/gm-asset`、`/gm-build`、`/gm-verify`、`/gm-evaluate`、
27
+ `/gm-fixgap`、`/gm-accept`、`/gm-finalize`)自动 publish 到项目里,
28
+ 版本由 `cliConfig.pinnedGodotmakerVersion` 决定(当前 `v0.5.0`)。
29
+
30
+ ### 安装或运行 CLI
31
+
32
+ 一次性运行用 `npx`;如果你会在多个项目目录里反复测试,可以全局安装:
33
+
34
+ ```bash
35
+ npx godotmaker-cli --help
36
+ # 或者
37
+ npm install -g godotmaker-cli
38
+ ```
39
+
40
+ 后面的示例使用全局 `godotmaker-cli` 命令。如果你选择 `npx`,把它替换成
41
+ `npx godotmaker-cli`。
42
+
43
+ 本地开发时,从 checkout 先构建,再按需要链接 workspace 包:
44
+
45
+ ```bash
46
+ cd /path/to/GodotMakerApp
47
+ npm install
48
+ npm run build
49
+ npm link -w godotmaker-cli # 可选:把 `godotmaker-cli` 注册到系统 PATH
50
+ godotmaker-cli --help
51
+ ```
52
+
53
+ 改 repo 代码前先确认测试 + 类型检查是绿的(在 repo root 跑这两条):
54
+
55
+ ```bash
56
+ npm test # vitest,快,但**不**做类型检查
57
+ npm run typecheck # 两个 workspace 跑 tsc --noEmit,包括 test 文件
58
+ ```
59
+
60
+ 两条都应该干净退出。`npm test` 走 vitest + esbuild(不做类型检查),单独跑 typecheck 才能抓出 test fixture 的字段缺失和签名漂移。
61
+
62
+ > 之后想拆掉本地开发链接?在同一个 repo root 跑 `npm unlink -w godotmaker-cli`。
63
+
64
+ ---
65
+
66
+ ## 1. 用 `--dry-run` 做冒烟测试(不烧 token)
67
+
68
+ Dry-run 用本地 stub 走完完整 9 阶段 pipeline。它能证明你的安装接线正确,不花 agent credit。
69
+
70
+ ```bash
71
+ mkdir test-pong && cd test-pong
72
+ godotmaker-cli --dry-run --auto-start
73
+ ```
74
+
75
+ 你应该看到:
76
+
77
+ - TUI 启动:header、9 行 pipeline 面板、session view、输入栏、footer。
78
+ - header 区出现黄色 `DRY-RUN` 徽章。
79
+ - 每行 stub 跑完依次变 ✓(总共 ≈1 秒)。
80
+ - footer 变绿:`Pipeline complete. Press q or type /quit to exit.`
81
+
82
+ 应该出现的文件:
83
+
84
+ ```
85
+ test-pong/
86
+ ├── project.godot # stub 项目
87
+ ├── GDD.md # stub 设计文档
88
+ └── .godotmaker/
89
+ ├── pipeline_state.json # status: completed
90
+ ├── stage.jsonl # 9 个事件,每阶段一个
91
+ ├── evaluation.json # result: approve
92
+ └── final_report.json
93
+ ```
94
+
95
+ 按 `q` 或者输入 `/quit` 然后回车退出。
96
+
97
+ **任何阶段在这里卡住,先停下来修,再继续。** Dry-run 失败说明接线本身坏了。
98
+
99
+ ### 顺手在 dry-run 输出上试 slash 命令
100
+
101
+ 再跑一次不带 `--auto-start` 的 dry-run,输入 `/start`,然后在按 `q` 之前:
102
+
103
+ - 输入 `/help` 回车 —— 弹出 overlay 列出所有命令和快捷键。
104
+ - 按任意键关闭。
105
+ - 看 TUI 顶部的 Header —— 直接显示当前 iteration N/maxN、build try
106
+ N/maxN,以及最后一次评估的 verdict(dry-run 走 happy path 显示
107
+ `✓ approved`,绿色);下方 PipelinePanel 显示当前 stage。这些信息
108
+ 一直在屏,不需要打开 overlay。
109
+ - 输入 `/peek` 回车 —— dry-run 下没有真正在跑的非交互 agent session 可以
110
+ 尾巴查看,会看到黄色消息 `no active agent session to tail.`。在真实跑
111
+ 的非交互态(build / verify 等)下,这条命令会打开一个 1 Hz 实时刷新
112
+ 的 overlay,显示当前 state 的 stream-json + stderr;按任意键关闭。
113
+ - 只输入 `/`(不带命令名)—— 输入栏下方弹出建议列表,包含所有 slash
114
+ 命令。**Up / Down** 上下选择(环形),**Tab** 把高亮命令补全到输入栏,
115
+ **Enter** 直接补全并执行高亮命令(`/h` + Enter 直接跑 `/help`)。
116
+ 匹配区分大小写 —— `/H` 不会匹配 `/help`。
117
+ - 输入 `/foo` 回车 —— 建议列表自动隐藏(没匹配),黄色消息:
118
+ `unknown command: /foo — try /help`。
119
+ - 输入任意字符 —— 消息消失。
120
+ - 输入 `/quit` 回车 —— 任意状态都能退出(运行中按下会顺手 abort
121
+ 当前选中 agent 子进程并把 resume 检查点写入 `pipeline_state.json`,
122
+ 下次启动 `/start` 即可从中断处继续)。
123
+
124
+ ---
125
+
126
+ ## 2. 真实首次跑(一个已认证的 agent 账号,约 10–30 分钟)
127
+
128
+ ```bash
129
+ mkdir my-pong && cd my-pong
130
+ godotmaker-cli
131
+ ```
132
+
133
+ TUI 会在 preflight 后进入 `idle`。输入 `/start` 才会开始;如果要无人值守运行,传 `--auto-start`。
134
+
135
+ 走完 9 个阶段。其中 3 个是交互的:TUI 会把终端交给选中的 agent 会话,那期间你看到的是该 agent 自己的 UI。
136
+
137
+ ### 2a. scaffold(交互)
138
+
139
+ 选中 agent 会问:
140
+ - **游戏名** —— 比如 `Pong`
141
+ - **视角** —— `2D` 或 `3D`
142
+
143
+ `/gm-scaffold` 跑完后 选中 agent 退出,TUI 重新挂载。scaffold 行变 ✓。
144
+
145
+ 如果项目根目录没出现 `project.godot`,运行会停下。重新检查选中 agent 认证。
146
+
147
+ ### 2b. gdd(交互)
148
+
149
+ 选中 agent 做一段简短的设计访谈(机制、胜利条件、…)。简明回答即可。`GDD.md` 落到项目根目录。
150
+
151
+ ### 2c. asset(自动,约 30 秒 – 2 分钟)
152
+
153
+ 后台跑。session view 实时滚 `[tool] Bash`、`[tool] Read`、`[agent] ...` 这些行。不需要输入。
154
+
155
+ ### 2d. build(自动,最长的阶段)
156
+
157
+ 实际场景 / 脚本就在这里写出来。默认 idle-timeout 是 900 秒。这不是总墙钟超时,只会在选中 agent 连续这么久没有 stdout/stderr 输出时触发。看 session view 估进度;如果 5 分钟以上一动不动,可能卡住了。`Ctrl-C` 中断。
158
+
159
+ ### 2e. verify(自动)
160
+
161
+ 只读检查。pipeline 根据一个做过 freshness 检查的 `stage.jsonl` 事件路由:
162
+ - pass → evaluate
163
+ - fail → build(计入 `maxBuildAttempts`)
164
+
165
+ ### 2f. evaluate(自动)
166
+
167
+ 写出 `.godotmaker/evaluation.json`,包含二元
168
+ `result: "approve" | "reject"` verdict + 分类 issue 数组。看 Header
169
+ 的 `eval` 单元格 —— approve 时显示绿色 `✓ approved`,reject 时显示
170
+ 黄色 `✗ Nc+Mm`(N/M 分别是 critical / major issue 数量)。
171
+
172
+ 路由:
173
+ - `verdict === "approve"` → **accept**
174
+ - `verdict === "reject"` 且达到最大 iteration → **accept**(agent escape:
175
+ `/gm-accept` 自己分流——要么放行,要么推荐别的 SKILL,参考 0509 测试报告)
176
+ - 否则 → **fixgap**
177
+
178
+ ### 2g. fixgap(自动,仅在重试时进入)
179
+
180
+ 读最近的评估,把它作为指引喂给一个 build 风格的会话,然后回 verify。这就是 Generator-Evaluator 模式的一整圈。
181
+
182
+ ### 2h. accept(交互)
183
+
184
+ 选中 agent 把项目状态和评估展示给你,然后问决定:
185
+ - `accept` → finalize → 完成
186
+ - `fix` → 再来一圈 fixgap,用你写的反馈作引导
187
+ - `done` → 在 accept 暂停 pipeline;**下次启动从这里恢复**
188
+
189
+ ### 2i. finalize(自动)
190
+
191
+ `/gm-finalize` 写出 `final_report.json`,包含一致性检查和归档总结。Pipeline 完成;按 `q`。
192
+
193
+ ### 在 Godot 里打开结果
194
+
195
+ ```bash
196
+ godot --path .
197
+ # 或者:godot project.godot
198
+ ```
199
+
200
+ 应该能正常加载项目。如果加载就崩,说明 build 在技术上是对的但功能上有问题 —— 这是下次 iteration `/gm-fixgap` 的素材。想多跑几圈就把 `--max-iterations` 调高。
201
+
202
+ ---
203
+
204
+ ## 3. 测试 resume 路径
205
+
206
+ Resume 是真实使用最常走的路径,验证一下:
207
+
208
+ ```bash
209
+ # 在一个停在 accept(你选了 `done`)的项目里:
210
+ godotmaker-cli
211
+ ```
212
+
213
+ 要确认:
214
+ - TUI 重启;已经跑完的行从第 0 帧就显示 ✓。
215
+ - header 显示正确的 `iter N/maxN`。
216
+ - Header 的 `eval` 单元格立刻显示前一次的 verdict(不是 `--`)—— 这是 P1 修复:`restoreContext` 在 resume 时读 `evaluation.json`。
217
+
218
+ 然后测试破坏性路径:
219
+
220
+ ```bash
221
+ godotmaker-cli --fresh
222
+ ```
223
+
224
+ `.godotmaker/` 清空(state、stage 事件、evaluation、report);你的 `GDD.md`、scenes、scripts 不动。Pipeline 从 scaffold 重启。
225
+
226
+ ---
227
+
228
+ ## 4. 测试交互 handoff 的失败模式
229
+
230
+ 值得戳一戳的边缘情况:
231
+
232
+ ### 4a. 交互阶段中 `Ctrl-C`
233
+ 在 `/gm-scaffold`(或 `/gm-gdd` / `/gm-accept`)里面按 `Ctrl-C`。
234
+ 被交接出去的 选中 agent 会话退出,控制权回到 cli,cli 的 unmount-cleanup
235
+ 钩子写入 resume 检查点后退出。下次启动 `/start` 即可从那个 state 恢复。
236
+
237
+ ### 4b. 自动阶段中 `Ctrl-C`
238
+ `build` 或 `evaluate` 跑的时候按 `Ctrl-C`。Ink 卸载 cli,unmount-cleanup
239
+ 钩子 abort 在飞的选中 agent 子进程并把 paused 检查点写入 `pipeline_state.json`。
240
+ 下次启动 `/start` 即可从中断处恢复。**不退出只暂停**(cli 保持挂载、
241
+ `/start` 立刻恢复)请改用 `/pause` 命令。
242
+
243
+ ### 4c. 跑到一半按 `q`
244
+ Pipeline 还在跑的时候按 `q`,**没反应** —— `q` 是单键退出快捷键,但
245
+ 有意只在非 running 状态(`idle` / `paused` / `finished` / `failed`)
246
+ 生效;运行中这一下按键直接落到输入栏。运行中要退出请用 `Ctrl-C` 或
247
+ `/quit`(两条都会 abort 选中 agent 并写检查点);不退只暂停请用 `/pause`。
248
+ footer 应该提示 `running… (/pause to pause, Ctrl-C to exit; /help for commands)`。
249
+
250
+ ### 4d. 崩溃恢复
251
+ 这个手动触发比较难,但如果某个 state 抛了意外错误,`run.tsx` 的 try/catch 兜住,`unmountForCrash()` 干净地拆掉 Ink(终端回到 cooked 模式),栈追踪打到 stderr。需要测的话只能手动注入一个 throw。
252
+
253
+ ---
254
+
255
+ ## 5. 配置
256
+
257
+ ### CLI flags(优先级:CLI > config.yaml > 默认值)
258
+
259
+ ```bash
260
+ node ... --agent codex --max-iterations 5 --model gpt-5.5
261
+ ```
262
+
263
+ 用 `--agent claude-code` 或 `--agent codex` 可以只为本次启动选择
264
+ agent runtime,不改项目配置或全局配置。选择优先级是:命令行参数、
265
+ 项目配置、CLI 全局配置,最后才是默认 `claude-code`。
266
+ build / evaluate 的默认模型会根据 agent 变化:Claude Code 使用 `opus`,
267
+ Codex 使用 `gpt-5.5`。
268
+
269
+ ### 项目级配置
270
+
271
+ 建 `.godotmaker/config.yaml`:
272
+
273
+ ```yaml
274
+ agent: codex
275
+ pipeline:
276
+ maxIterations: 5
277
+ maxBuildAttempts: 3
278
+ buildModel: gpt-5.5
279
+ evalModel: gpt-5.5
280
+ ```
281
+
282
+ 非交互 agent 会话的 idle-timeout 走全局配置 `~/.godotmaker/cli/config.yaml`
283
+ 里的 `idle_timeout_seconds`(默认 900),不在项目级 yaml 里——每个
284
+ workspace 共用同一台机器的"选中 agent 卡住"定义。
285
+
286
+ ### 环境变量
287
+
288
+ - `GMA_DRY_RUN=1` —— 跟 `--dry-run` 等价。CI 或一次性脚本里好用。
289
+
290
+ ---
291
+
292
+ ## 6. 提 bug 时该带什么
293
+
294
+ ```
295
+ .godotmaker/pipeline_state.json
296
+ .godotmaker/stage.jsonl
297
+ .godotmaker/evaluation.json # 如果存在
298
+ .godotmaker/final_report.json # 如果存在
299
+ project.godot # 如果存在
300
+ GDD.md # 如果存在
301
+ ```
302
+
303
+ 加上能往回滚的终端输出。TUI 是实时流的,事后只能靠这些文件 + 你记得卡在哪。
304
+
305
+ ---
306
+
307
+ ## 7. 速查
308
+
309
+ ```bash
310
+ # 第一次,验证安装
311
+ godotmaker-cli --dry-run --auto-start
312
+
313
+ # 真实跑
314
+ godotmaker-cli
315
+ # 然后在 TUI 输入 /start
316
+
317
+ # 暂停后恢复
318
+ godotmaker-cli
319
+
320
+ # 全炸了重头来
321
+ godotmaker-cli --fresh
322
+
323
+ # 多几次重试
324
+ godotmaker-cli --max-iterations 5
325
+
326
+ # TUI 里
327
+ /start # 启动(或 pause 后恢复)pipeline
328
+ /pause # 暂停正在跑的 pipeline(cli 保持挂载;/start 即可恢复)
329
+ /refresh # 重置 iteration / build 预算(idle / paused / finished / failed;running 中先 /pause)
330
+ /help # 命令列表
331
+ /peek # 实时尾巴查看当前 agent session(仅非交互态有效)
332
+ /usage # token / 花费 / 时长汇总(当前运行 + 项目累计)
333
+ /quit # 退出(任意状态);运行中也会顺手 abort 选中 agent + 写 resume 检查点
334
+ q # 退出(仅在非 running 状态生效,且输入栏需为空);走的是 /quit 同一条检查点路径
335
+ Ctrl-C # 退出(任意状态);运行中按下会同时 abort 选中 agent + 写 resume 检查点
336
+ Esc # 清空输入栏
337
+ ```
338
+
339
+ ---
340
+
341
+ ## 接下来
342
+
343
+ - 参考文档:[`README.zh-CN.md`](./README.zh-CN.md)
344
+ - 设计 / 内部:[`../docs/design/cli-design.md`](../docs/design/cli-design.md)
345
+ - Roadmap:[`../ROADMAP.md`](../ROADMAP.md)
346
+ - 上游 skill 源码:[GodotMaker](https://github.com/RandallLiuXin/GodotMaker)
package/LICENSE ADDED
@@ -0,0 +1,48 @@
1
+ GodotMakerApp CLI License
2
+
3
+ Copyright (c) Randall Liu Xin.
4
+ All rights reserved.
5
+
6
+ GodotMakerApp CLI and its included runtime code are proprietary software.
7
+ This license grants you a limited, non-exclusive, non-transferable right to
8
+ install and use official copies of the software distributed by Randall Liu Xin
9
+ or GodotMakerApp for creating, testing, and managing Godot game projects.
10
+
11
+ You may not:
12
+
13
+ - copy, redistribute, sublicense, sell, rent, lease, or host the software for
14
+ third-party use;
15
+ - reverse engineer, decompile, disassemble, or attempt to derive the source
16
+ code, except where this restriction is not permitted by applicable law;
17
+ - remove or bypass license, access-control, telemetry, or protection
18
+ mechanisms;
19
+ - use the software, its workflow, or its runtime code to build or operate a
20
+ competing commercial game-generation, automation, or agent-platform product;
21
+ - publish modified versions of the software or package it into another product
22
+ without prior written permission.
23
+
24
+ Generated Output
25
+ ----------------
26
+
27
+ GodotMakerApp CLI does not claim ownership of game projects, source code,
28
+ assets, design documents, screenshots, reports, or other output generated in
29
+ your target project. Subject to any third-party rights, provider terms, asset
30
+ licenses, or model-service terms that may apply, those project outputs belong
31
+ to you.
32
+
33
+ Separate Components
34
+ -------------------
35
+
36
+ The upstream GodotMaker framework, third-party packages, Godot Engine, agent
37
+ CLIs, model providers, and generated project dependencies are governed by their
38
+ own licenses and terms. This license applies only to GodotMakerApp CLI and its
39
+ included runtime code.
40
+
41
+ No Warranty
42
+ -----------
43
+
44
+ The software is provided "as is", without warranty of any kind, express or
45
+ implied, including but not limited to warranties of merchantability, fitness for
46
+ a particular purpose, and non-infringement. In no event shall the copyright
47
+ holder be liable for any claim, damages, or other liability arising from use of
48
+ the software.
package/README.md ADDED
@@ -0,0 +1,240 @@
1
+ # godotmaker-cli
2
+
3
+ > 中文版:[README.zh-CN.md](./README.zh-CN.md) · Hands-on testing guide: [GETTING_STARTED.md](./GETTING_STARTED.md) ([中文](./GETTING_STARTED.zh-CN.md))
4
+
5
+ Pipeline driver for [GodotMaker](https://github.com/RandallLiuXin/GodotMaker) — an AI-assisted text-to-Godot game generator. This package ships an Ink TUI that orchestrates the upstream `/gm-*` skill chain across independent selected-agent sessions, so you can `cd` into an empty folder, run one command, and watch a Godot project build itself.
6
+
7
+ > Proprietary. You may install and use official copies to create Godot game
8
+ > projects. Redistribution, reverse engineering, and competing commercial
9
+ > platform use are not permitted. Generated game projects and assets belong to
10
+ > you; see [LICENSE](./LICENSE).
11
+
12
+ ---
13
+
14
+ ## Requirements
15
+
16
+ | Tool | Version | Purpose |
17
+ |---|---|---|
18
+ | Node.js | 22+ | Runs the CLI (Ink 7 requires Node 22 or newer) |
19
+ | [Claude Code CLI](https://docs.claude.com/en/docs/claude-code) or Codex CLI | latest | The selected agent binary must be on your PATH |
20
+ | [Godot](https://godotengine.org/) | 4.x | Runs the generated project |
21
+
22
+ The CLI auto-publishes the GodotMaker framework into each project during preflight; the framework version is pinned by `cliConfig.pinnedGodotmakerVersion` (currently `v0.5.0`).
23
+
24
+ ---
25
+
26
+ ## Install
27
+
28
+ ```bash
29
+ npx godotmaker-cli
30
+ # or install it globally
31
+ npm install -g godotmaker-cli
32
+ ```
33
+
34
+ For local development from a checkout:
35
+
36
+ ```bash
37
+ npm install
38
+ npm run build
39
+ node cli/dist/run.js --help
40
+ ```
41
+
42
+ The examples below use the global `godotmaker-cli` command. If you are
43
+ using `npx`, replace it with `npx godotmaker-cli`.
44
+
45
+ ---
46
+
47
+ ## Quick start
48
+
49
+ ```bash
50
+ mkdir my-pong-game && cd my-pong-game
51
+ godotmaker-cli
52
+ ```
53
+
54
+ The TUI launches in `idle` after preflight. Type `/start` to walk the
55
+ 9-stage pipeline; press **q** to exit after it finishes. Pass
56
+ `--auto-start` when you want the run to begin immediately.
57
+
58
+ ```
59
+ ┌─ godotmaker-cli ───────────────────────────────────┐
60
+ │ /home/user/my-pong-game │
61
+ │ iter 1/3 build 1/3 eval -- │
62
+ ├────────────────────────────────────────────────────┤
63
+ │ ✓ scaffold 0:04 │
64
+ │ ✓ gdd 1:12 │
65
+ │ ✓ asset 0:38 │
66
+ │ ▶ build 0:21 │
67
+ │ verify -- │
68
+ │ evaluate -- │
69
+ │ fixgap -- │
70
+ │ accept -- │
71
+ │ finalize -- │
72
+ ├─ session ──────────────────────────────────────────┤
73
+ │ [tool] Bash │
74
+ │ [agent] Implementing Pong scene per PLAN.md... │
75
+ │ [tool] Write src/Ball.gd │
76
+ └────────────────────────────────────────────────────┘
77
+ running… (/pause to pause, Ctrl-C to exit; /help for commands)
78
+ ```
79
+
80
+ ### Interactive stages
81
+
82
+ `scaffold`, `gdd`, and `accept` need user input (game name, design questions, accept / fix / done decision). When the pipeline reaches one, the TUI **suspends**, hands the terminal to a fresh selected-agent session, and **resumes** when that session exits — same pattern as `git commit` opening `$EDITOR`. There is a brief screen flicker; this is expected.
83
+
84
+ ### Lifecycle
85
+
86
+ The cli launches into an `idle` state showing the preflight summary
87
+ (framework version, selected agent probe, pipeline knobs). Type `/start` to
88
+ begin. After a pause, `/start` resumes from the interrupted state.
89
+ Pass `--auto-start` to skip the idle screen — implicitly enabled when
90
+ stdin is not a TTY (CI, piped automation).
91
+
92
+ ### Hotkeys
93
+
94
+ | Key | Effect |
95
+ |---|---|
96
+ | `q` | Quit when the input bar is empty AND the pipeline is not running (works in idle / paused / finished / failed) |
97
+ | `Ctrl-C` | Exit. During a running pipeline, the cli's unmount-cleanup hook also aborts the active selected agent child and writes a resume checkpoint to `pipeline_state.json` so the next `godotmaker-cli` launch can `/start` from where you stopped. To pause WITHOUT exiting (cli stays mounted, you can `/start` immediately to resume), use the `/pause` slash command instead. |
98
+
99
+ ### Slash commands
100
+
101
+ There is an always-on input bar at the bottom of the TUI. Type one of
102
+ the following and press `Enter`:
103
+
104
+ | Command | Effect |
105
+ |---|---|
106
+ | `/help` | Show all commands and hotkeys |
107
+ | `/start` | Begin (or resume, after a pause) the pipeline |
108
+ | `/pause` | Pause the running pipeline; the next `/start` resumes |
109
+ | `/refresh` | Reset iteration / build budget for the current run; allowed in idle / paused / finished / failed (during a run, `/pause` first) |
110
+ | `/peek` | Live tail (1 Hz) of the active non-interactive agent stream log |
111
+ | `/usage` | Token / cost / time totals for this run + project lifetime |
112
+ | `/quit` | Exit. During a run, also aborts the selected agent and writes a resume checkpoint (same path as Ctrl-C); next `godotmaker-cli` launch can `/start` to continue. |
113
+
114
+ The current iteration / build try / last evaluation verdict are
115
+ shown in the Header at the top of the TUI; there is no separate
116
+ overlay for them. The eval cell shows `✓ approved` (green) on
117
+ approve, `✗ Nc+Mm` (yellow, where N/M are critical/major issue
118
+ counts) on reject, or `--` until `/gm-evaluate` runs.
119
+
120
+ Any keystroke dismisses an open overlay. `Esc` clears the input buffer.
121
+ Unknown input shows a transient message until the next keystroke.
122
+
123
+ Typing `/` opens a live suggestion popup directly under the input bar
124
+ listing every command whose name starts with what you've typed. **Up /
125
+ Down** navigate (wrap-around), **Tab** completes the highlighted command
126
+ into the buffer without executing, **Enter** auto-completes-and-runs the
127
+ highlighted command (so `/h` + Enter runs `/help`). The match is
128
+ case-sensitive — `/H` shows nothing, mirroring the parser. If the
129
+ prefix has no matches the popup hides; pressing Enter then surfaces the
130
+ usual `unknown command — try /help` message.
131
+
132
+ `/peek` is only useful in non-interactive states (build / verify /
133
+ asset / evaluate / fixgap / finalize) where the selected agent runs in non-interactive mode
134
+ under the cli's control. In interactive states (scaffold / gdd /
135
+ accept) the interactive agent has the terminal directly so the cli has nothing to
136
+ peek into; the overlay shows "no active agent session to tail" if
137
+ you invoke it then. The overlay refreshes once per second; press any
138
+ key to dismiss.
139
+
140
+ `/usage` shows three sections: **this run** (live token / output /
141
+ duration / cost broken down per state), **project lifetime**
142
+ (cumulative since the first run), and **recent runs** (the last 10
143
+ completed runs as one row each). Tokens and dollar amounts come from
144
+ the selected agent's stream or local session records. Cost is only
145
+ shown when the selected agent reports it; otherwise it stays `--`.
146
+ Persisted to `.godotmaker/usage.json` next to `pipeline_state.json`
147
+ — copy that file along with the project to keep history when moving
148
+ the project elsewhere. Interactive states (scaffold / gdd / accept)
149
+ recover token usage best-effort from local session records and always
150
+ contribute duration. The Header panel always shows the current-run
151
+ total in shorthand; use `/usage` to drill in.
152
+
153
+ ---
154
+
155
+ ## Flags
156
+
157
+ | Flag | Effect |
158
+ |---|---|
159
+ | `--agent <claude-code\|codex>` | Select the agent runtime for this launch, overriding project and CLI-global config |
160
+ | `--max-iterations <n>` | Cap on Generator-Evaluator iterations (default `3`) |
161
+ | `--model <name>` | Override agent model for build / evaluate (default depends on `--agent`) |
162
+ | `--fresh` | Wipe saved state and start over |
163
+ | `--dry-run` | Walk the pipeline without spawning an agent (writes stub artifacts; useful for CI / wiring checks) |
164
+ | `-h`, `--help` | Show help and exit |
165
+
166
+ Agent selection resolves in this order: `--agent`, per-project
167
+ `.godotmaker/config.yaml`, `~/.godotmaker/cli/config.yaml`, then the
168
+ default `claude-code`.
169
+
170
+ Idle-timeout for spawned non-interactive agent sessions (default 900s = 15 min) is
171
+ configured in `~/.godotmaker/cli/config.yaml` via `idle_timeout_seconds`,
172
+ not as a CLI flag. The timer resets on every stdout/stderr chunk; only
173
+ genuine silence triggers a kill.
174
+
175
+ ---
176
+
177
+ ## What the pipeline writes
178
+
179
+ Everything lives under `.godotmaker/` inside your project:
180
+
181
+ | File | Owner | Purpose |
182
+ |---|---|---|
183
+ | `pipeline_state.json` | Core | Resume checkpoint (current state, iteration, build attempts) |
184
+ | `stage.jsonl` | upstream skills | One line per `/gm-*` completion; freshness-checked by Core |
185
+ | `evaluation.json` | `/gm-evaluate` | Latest binary verdict + categorized issues; routes evaluate → accept / fixgap |
186
+ | `final_report.json` | `/gm-finalize` | Summary at the end of a successful run |
187
+ | `usage.json` | Core | Token / cost / time history surfaced by `/usage` (lifetime totals + last 10 runs) — see R-314 |
188
+ | `config.yaml` | (optional, you) | Per-project flag defaults — see `loadConfig` in core |
189
+
190
+ The Godot project itself (`project.godot`, `GDD.md`, `PLAN.md`, scenes, scripts, …) lives at the project root and is owned by the upstream skills. Core never writes to those.
191
+
192
+ ---
193
+
194
+ ## Resume vs fresh
195
+
196
+ By default, re-running `godotmaker-cli` in the same directory **resumes** at the saved checkpoint:
197
+
198
+ ```bash
199
+ godotmaker-cli # picks up where the last run left off
200
+ ```
201
+
202
+ To start over:
203
+
204
+ ```bash
205
+ godotmaker-cli --fresh # deletes pipeline_state.json + stage.jsonl + evaluation.json + final_report.json
206
+ ```
207
+
208
+ User-authored files (`GDD.md`, `PLAN.md`, scenes, scripts) are never touched by `--fresh`.
209
+
210
+ ---
211
+
212
+ ## Dry-run mode
213
+
214
+ `--dry-run` (or `GMA_DRY_RUN=1`) tells the CLI to walk the full state graph **without spawning an agent**. Stub handlers write the artifacts each `/gm-*` skill would have produced (`project.godot`, `GDD.md`, `evaluation.json`, `final_report.json`, plus `stage.jsonl` events) so the pipeline reaches `finalize`. Use it to:
215
+
216
+ - verify your install (Node / paths / config) without burning tokens
217
+ - pre-flight CI plumbing
218
+ - demonstrate the TUI without an agent account
219
+
220
+ Stubs always pick the happy path (`verify=pass`, `evaluate=approve`, `accept=accept`); to exercise fail / fixgap branches you need a real selected-agent session.
221
+
222
+ ---
223
+
224
+ ## Troubleshooting
225
+
226
+ **Selected agent CLI not found on PATH** — Install the selected agent CLI and re-launch your terminal. Verify with `claude --version` or `codex --version`.
227
+
228
+ **Pipeline halts at scaffold with no project.godot** — `/gm-scaffold` exited non-zero. Check that the upstream skills are installed and that the selected agent is authenticated.
229
+
230
+ **Stale stage events being read after a crashed run** — Run with `--fresh` to clear `.godotmaker/stage.jsonl` and start over.
231
+
232
+ **TUI looks broken / line wraps** — The TUI requires a real TTY. Piping output (`godotmaker-cli | tee log`) or running under a CI runner without a PTY is not currently supported.
233
+
234
+ ---
235
+
236
+ ## Links
237
+
238
+ - Upstream framework: [GodotMaker](https://github.com/RandallLiuXin/GodotMaker)
239
+ - Roadmap: [`ROADMAP.md`](https://github.com/RandallLiuXin/GodotMakerApp/blob/main/ROADMAP.md) (private)
240
+ - Design notes: [`docs/design/cli-design.md`](https://github.com/RandallLiuXin/GodotMakerApp/blob/main/docs/design/cli-design.md) (private)