Skip to content

[P3] Guard unknown commands and render non-Error throws safely #96

Description

@Bccorb

Severity: P3 — Improvement/UX

Where: src/index.ts:114, 117-119; src/commands/whoami.ts:19; src/commands/sessions.ts:30

Problem
Any unmatched first arg falls through to runCLI (init), so seamless verfy (typo) silently scaffolds a directory with no feedback. The top-level catch prints Error: undefined when a non-Error is thrown; (err as Error).message has the same issue in whoami/sessions.

Suggested fix
Keep the seamless <name> shortcut but reject flag-like/known-typo first args with a "did you mean" hint; render thrown values safely (String(err) fallback).

Filed from an internal code audit (2026-07). File references are against main at audit time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions