Skip to content

docs: improve README scannability and document the exit-code contract#150

Merged
ThomasK33 merged 1 commit into
mainfrom
readme-ywr6
Jun 12, 2026
Merged

docs: improve README scannability and document the exit-code contract#150
ThomasK33 merged 1 commit into
mainfrom
readme-ywr6

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

Improves README scannability and documents the CLI's stable exit-code contract, inspired by a side-by-side review of coder/boo's README.

What changed

README.md

  • Added an anchor nav line under the badges (Quickstart · Why · How it works · Commands · Contributing).
  • Framed the Quickstart example as "the canonical loop" with numbered step comments (open → type → wait → read → capture → clean up).
  • Rewrote the "Command surface" section from a dense prose paragraph into a grouped table (lifecycle / input / observation / live view / environment), added a stable-exit-code note, and pointed readers at --help self-discoverability and the new exit-code reference.

docs/USAGE.md

  • New Exit Codes section documenting the full 011 mapping from src/cli/exitCodes.ts, plus batch fail-fast / --keep-going semantics.
  • New note in the wait section: a standalone wait that times out exits 0 with timedOut: true in the JSON result; exit code 11 (WAIT_TIMEOUT) only surfaces from a timed-out wait step inside a fail-fast batch. Callers must check the envelope, not the exit code.

src/cli/exitCodes.ts

  • One-line comment marking the exit-code map as a public contract documented in docs/USAGE.md, so code and docs don't drift.

No behavior changes — docs plus one source comment.

Validation

  • mise run ci (format check, lint, typecheck, tests).
  • Exit codes verified empirically against a live session in an isolated AGENT_TTY_HOME: usage error → 2, session not found → 3, destroy → 0, already destroyed → 4, and standalone wait timeout → 0 with {"matched": false, "timedOut": true} in the envelope (which is why the docs describe 11 as batch-only — confirmed in src/batch/executor.ts and test/integration/batch.test.ts).

Note for maintainers

The standalone-wait-exits-0-on-timeout behavior is now documented as-is, not changed. If you'd rather standalone wait also exit non-zero on timeout (so wait ... && next-step fails closed), that's a breaking CLI change worth its own issue.


Generated with mux • Model: anthropic:claude-fable-5 • Thinking: xhigh

@ThomasK33 ThomasK33 merged commit 3c52b22 into main Jun 12, 2026
11 checks passed
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