diff --git a/src/cli/help.ts b/src/cli/help.ts index 9db5823..11a9a23 100644 --- a/src/cli/help.ts +++ b/src/cli/help.ts @@ -27,6 +27,15 @@ const COMMANDS: Record = { detail: "生成 SDD 流程中讨论阶段的提示词,输出到标准输出。需要先运行 init 初始化项目。", exampleArgs: ["discuss"], }, + create: { + name: "create", + alias: "create <变更>", + description: "创建:创建变更目录", + usageTemplate: "create ", + args: [{ name: "", desc: '变更名称,如 "add-login"' }], + detail: "在 .rune/changes/ 下创建以变更名称命名的目录,并生成创建阶段提示词。", + exampleArgs: ["create add-user-auth", "create fix-memory-leak"], + }, plan: { name: "plan", alias: "plan <变更> <文档>", @@ -46,7 +55,7 @@ const COMMANDS: Record = { description: "构建:生成构建阶段提示词", usageTemplate: "build ", args: [{ name: "", desc: '变更名称,如 "add-login"' }], - detail: "生成构建阶段的提示词。变更目录需已存在(通过 plan 创建)。", + detail: "生成构建阶段的提示词。变更目录需已存在(通过 create 创建)。", exampleArgs: ["build add-user-auth", "build fix-memory-leak"], }, archive: { diff --git a/tests/cli/help.test.ts b/tests/cli/help.test.ts index 139b7a4..8bb1707 100644 --- a/tests/cli/help.test.ts +++ b/tests/cli/help.test.ts @@ -18,6 +18,7 @@ describe("showGlobalHelp", () => { const output = showGlobalHelp("rune"); expect(output).toContain("init <工具...>"); expect(output).toContain("discuss"); + expect(output).toContain("create <变更>"); expect(output).toContain("plan <变更> <文档>"); expect(output).toContain("build <名称>"); expect(output).toContain("archive <名称>"); @@ -48,6 +49,13 @@ describe("showCommandHelp", () => { expect(output).toContain("opencode"); }); + it("create 命令包含变更名参数", () => { + const output = showCommandHelp("create", "rune"); + expect(output).toContain("rune create "); + expect(output).toContain("变更名称"); + expect(output).toContain("rune create add-user-auth"); + }); + it("不存在的命令返回 null", () => { const output = showCommandHelp("nonexistent", "rune"); expect(output).toBeNull();