Skip to content

fix(cli): --no-passcode flag properly disables passcode authentication#497

Open
RytisLT wants to merge 2 commits into
cline:mainfrom
RytisLT:fix-no-pass
Open

fix(cli): --no-passcode flag properly disables passcode authentication#497
RytisLT wants to merge 2 commits into
cline:mainfrom
RytisLT:fix-no-pass

Conversation

@RytisLT

@RytisLT RytisLT commented May 18, 2026

Copy link
Copy Markdown

Problem

The --no-passcode CLI 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 to false (not true). The code was checking options.noPasscode === true, which never matched.

Fix

Align --no-passcode handling with the existing --no-open pattern:

  • Changed RootCommandOptions to use passcode?: boolean (matching how Commander stores --no-* flags).
  • Updated the CLI option mapping to read options.passcode === false instead of options.noPasscode === true.

@greptile-apps

greptile-apps Bot commented May 18, 2026

Copy link
Copy Markdown

Greptile Summary

This PR fixes the --no-passcode CLI flag, which was silently ignored because Commander.js stores --no-* flags under the base property name (e.g. options.passcode = false), not options.noPasscode = true as the old code expected.

  • RootCommandOptions renames noPasscode?: boolean to passcode?: boolean, and the mapping reads options.passcode === false — consistent with the existing --no-open / options.open === false pattern already used in the same block.
  • A new integration test spawns the real CLI binary with and without the flag (on a remote host) and asserts the correct startup output in both cases.

Confidence Score: 5/5

Safe 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-* property naming) is correctly diagnosed, the fix is consistent with the identical --no-open pattern already in the same call site, and the new integration test exercises the actual CLI binary end-to-end for both branches.

No files require special attention.

Important Files Changed

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: ...
Loading

Reviews (1): Last reviewed commit: "fix: --no-passcode flag properly disable..." | Re-trigger Greptile

@RytisLT RytisLT changed the title fix: --no-passcode flag properly disables passcode authentication fix(cli): --no-passcode flag properly disables passcode authentication May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant