Skip to content

Commit 6aedd7b

Browse files
committed
fix(cli): remove hardcoded default for init level option
The level option had a default value of "2" which prevented the interactive level prompt from ever being shown during `bmalph init`.
1 parent 63bc083 commit 6aedd7b

4 files changed

Lines changed: 35 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bmalph",
3-
"version": "0.8.3",
3+
"version": "0.8.4",
44
"description": "Unified AI Development Framework - BMAD phases with Ralph execution loop for Claude Code",
55
"type": "module",
66
"bin": {

src/cli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const program = new Command();
1212
program
1313
.name("bmalph")
1414
.description("BMAD-METHOD + Ralph integration — structured planning to autonomous implementation")
15-
.version("0.8.3")
15+
.version("0.8.4")
1616
.option("--verbose", "Enable debug logging")
1717
.hook("preAction", () => {
1818
if (program.opts().verbose) {
@@ -25,7 +25,7 @@ program
2525
.description("Initialize bmalph in the current project")
2626
.option("-n, --name <name>", "Project name")
2727
.option("-d, --description <desc>", "Project description")
28-
.option("-l, --level <level>", "Complexity level (0-4)", "2")
28+
.option("-l, --level <level>", "Complexity level (0-4)")
2929
.action(initCommand);
3030

3131
program

tests/cli.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,10 @@ describe("CLI entry point", () => {
7575
const { stdout } = runCli(["--help"]);
7676
expect(stdout).toContain("--verbose");
7777
});
78+
79+
it("init level option has no default value", () => {
80+
const { stdout } = runCli(["init", "--help"]);
81+
expect(stdout).toContain("--level");
82+
expect(stdout).not.toContain("default");
83+
});
7884
});

tests/commands/init.test.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,32 @@ describe("init command", () => {
102102
expect(output).toContain("/bmalph");
103103
});
104104

105+
it("includes level prompt when level option not provided", async () => {
106+
const { isInitialized, installProject, mergeClaudeMd } = await import(
107+
"../../src/installer.js"
108+
);
109+
const { writeConfig } = await import("../../src/utils/config.js");
110+
const inquirer = await import("inquirer");
111+
112+
vi.mocked(isInitialized).mockResolvedValue(false);
113+
vi.mocked(installProject).mockResolvedValue(undefined);
114+
vi.mocked(mergeClaudeMd).mockResolvedValue(undefined);
115+
vi.mocked(writeConfig).mockResolvedValue(undefined);
116+
vi.mocked(inquirer.default.prompt).mockResolvedValue({
117+
name: "test",
118+
description: "test",
119+
level: 2,
120+
});
121+
122+
const { initCommand } = await import("../../src/commands/init.js");
123+
await initCommand({});
124+
125+
const promptArgs = vi.mocked(inquirer.default.prompt).mock.calls[0][0] as Array<{ name: string; type: string }>;
126+
const levelQuestion = promptArgs.find((q) => q.name === "level");
127+
expect(levelQuestion).toBeDefined();
128+
expect(levelQuestion!.type).toBe("list");
129+
});
130+
105131
it("prompts user when options missing", async () => {
106132
const { isInitialized, installProject, mergeClaudeMd } = await import(
107133
"../../src/installer.js"

0 commit comments

Comments
 (0)