zz_

31943d52 ยท zzmq.dev@gmail.com/zz

Commit

31943d522eaaff2b7c60364829fe1e3dbc2fdc96

zz top: fix the crash-on-missing-config bug, add --local, go remote-aware The actual reported bug: `zz top` with no ~/.zz/config.json and no --repos threw a raw, uncaught Error with a multi-line stack trace instead of either working or printing clean guidance. Root cause was readConfig() hard-requiring at least one repo -- correct for work/review (they need a repo to do anything) but wrong for top, which has a perfectly valid empty-dashboard state. readConfig() now takes an allowEmpty option; only top.ts passes it. Also fixed the systemic version of the same bug class: cli/zz.ts had no top-level .catch() on parseAsync at all, so ANY command's thrown error (not just this one) surfaced as a raw unhandled-rejection dump. One global catch now prints `zz: <message>` and exits 1 instead. zz top had no --local flag at all (work/review both have it) and never passed `remote` to its two polling hooks, so it silently always read local state even when pointed at repos being worked remotely -- confirmed bug, not a design choice. Extracted the useRemote/identity/ cleanup/withBackend dance -- duplicated near-identically in work.ts and review.ts -- into cli/lib/backendMode.ts's resolveCliBackendMode, now shared by all three commands. Verified live against the real built CLI (dist/): `zz top --local` with zero config/repos now renders a clean empty dashboard instead of crashing; work/review --help unaffected by the refactor. Separately noticed: ~/.zz/credentials.json is missing from this machine even though its token is still valid server-side (used via curl all session) -- unrelated to this fix, flagging rather than touching it.

Troy Howard <thoward37@gmail.com> -- 2026-10-13T06:50:21.000Z

Tree at this commit