Skip to content

feat(cli): summaries, TTY-gated auto-open, exit-codes doc, scoped flag help#275

Merged
danielgwilson merged 1 commit into
mainfrom
feat/cli-ergonomics
Jul 9, 2026
Merged

feat(cli): summaries, TTY-gated auto-open, exit-codes doc, scoped flag help#275
danielgwilson merged 1 commit into
mainfrom
feat/cli-ergonomics

Conversation

@danielgwilson

Copy link
Copy Markdown
Owner

Track B CLI ergonomics wins from the audit, all additive and non-breaking (except the one noted behavioral change), sharpening the freshly-released 0.14.0 UX.

What

  • .summary() on the 12 leaf commands so homun --help shows one line per command instead of wrapping the full description onto two lines. Full .description() still shown on <cmd> --help. (Commander v14 API, verified in node_modules.)
  • TTY-gate the human-mode browser auto-open on watch and all six lab backends to match observe's existing gate. A non-TTY, non---json, no---open/--no-open run no longer tries to spawn a browser. The six backend sites now call ONE extracted resolveBackendShouldOpen helper (one code path, one test) instead of six copied predicates. Behavioral change (narrow: only scripts/CI relying on auto-open without a TTY and without --no-open).
  • README 'Exit Codes' section (0 success / 1 Commander usage error / 2 homun domain failure / 128+N signal), verified against the code.
  • Scoped <backend> only: prefixes on lab run's backend-specific flags, extending the existing convention.

Out of scope (deferred per the audit): createProgram exitOverride, --dry-run rename, --run/--run-id, shell completions.

Review

Reviewed; the one MEDIUM finding (the TTY gate was untested at 7 of 9 sites, mutation-confirmed) is resolved structurally: the 6 lab-backend sites were extracted into resolveBackendShouldOpen with 5 direct unit tests covering every branch (no-open, machine mode, TTY vs non-TTY watch, run mode, defaults.open), so a regression at any backend site now fails a test.

Proof

pnpm check: 922 passed / 10 skipped, build OK. pnpm public-surface:scan: ok. homun --help renders a de-wrapped one-line-per-command list (in the PR discussion).

🤖 Generated with Claude Code

…g help

Track B CLI ergonomics wins from the audit, all additive:
- .summary() on the 12 leaf commands so 'homun --help' lists one line each
  instead of wrapping the full description (commander v14 API).
- TTY-gate the human-mode browser auto-open on watch and every lab backend
  to match observe's existing gate (a non-TTY, non-json, no-flag run no
  longer spawns a browser opener). Behavioral change, narrow blast radius.
  The 6 backend sites now share ONE extracted resolveBackendShouldOpen
  helper with direct unit coverage (closing the review's coverage gap).
- README 'Exit Codes' section (0 ok / 1 commander usage / 2 domain / 128+N
  signal), verified against the code.
- scoped '<backend> only:' prefixes on lab run's backend-specific flags.

Reviewed; the review's one MEDIUM (TTY gate untested at 7/9 sites) is
resolved by the helper extraction + unit tests rather than 6 near-identical
integration tests. 922 passed, scan clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@danielgwilson danielgwilson merged commit bfd3571 into main Jul 9, 2026
5 of 6 checks passed
@danielgwilson danielgwilson deleted the feat/cli-ergonomics branch July 9, 2026 08:00
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