fix(cli): --no-passcode flag properly disables passcode authentication#497
fix(cli): --no-passcode flag properly disables passcode authentication#497RytisLT wants to merge 2 commits into
Conversation
Greptile SummaryThis PR fixes the
Confidence Score: 5/5Safe to merge — the change is a minimal, well-understood two-line fix with integration test coverage confirming both the enabled and disabled passcode paths. The root cause (Commander.js No files require special attention.
|
| Filename | Overview |
|---|---|
| src/cli.ts | Two-line fix: renames noPasscode to passcode in RootCommandOptions and reads options.passcode === false instead of options.noPasscode === true, correctly aligning with Commander.js --no-* flag semantics. |
| test/integration/cli-params.integration.test.ts | New integration test that spawns the CLI with and without --no-passcode, captures startup stdout/stderr, and asserts the correct output in both cases. |
Sequence Diagram
sequenceDiagram
participant User
participant Commander as Commander.js
participant CLI as cli.ts action()
participant Main as runMainCommand()
User->>Commander: kanban --no-passcode
Note over Commander: --no-* flag sets options.passcode = false
Commander->>CLI: "action({ passcode: false })"
CLI->>Main: "{ noPasscode: options.passcode === false → true }"
Main->>Main: disablePasscode()
Main-->>User: Passcode authentication disabled
User->>Commander: kanban (no flag)
Note over Commander: default: options.passcode = true
Commander->>CLI: "action({ passcode: true })"
CLI->>Main: "{ noPasscode: options.passcode === false → false }"
Main->>Main: generatePasscode()
Main-->>User: Remote access passcode: ...
Reviews (1): Last reviewed commit: "fix: --no-passcode flag properly disable..." | Re-trigger Greptile
Problem
The
--no-passcodeCLI flag was not working - the server still required a passcode even when the flag was passed.Root Cause
Commander.js
--no-*flags set the base property tofalse(nottrue). The code was checkingoptions.noPasscode === true, which never matched.Fix
Align
--no-passcodehandling with the existing--no-openpattern:RootCommandOptionsto usepasscode?: boolean(matching how Commander stores--no-*flags).options.passcode === falseinstead ofoptions.noPasscode === true.