Fix default command UX and status exits - #37
Conversation
Add `out.setExitCode()` so status/check commands can emit normal stdout or JSON while returning non-zero to scripts. Keep thrown CLIError exit codes authoritative. Report unknown root commands under no-arg defaults as UNKNOWN_COMMAND, while preserving positional defaults and flags-only fallback.
📝 WalkthroughWalkthroughThis PR introduces two independent changes, savvy? First, a shiny new Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 10 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (10 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
commit: |
Assert app.run() rejects for requested process exits, so the test fails if it resolves unexpectedly. Update affected AGENTS notes for the new exit-code and default-command planner behavior.
d7d3238 to
82e5dd3
Compare
Summary
out.setExitCode(code)for normal-output non-zero status exitsUNKNOWN_COMMANDwhen a default command has no positional argsCloses #26.
Closes #27.
Tests
bun test src/core/cli/planner.test.ts src/core/cli/cli-default.test.ts src/core/output/output.test.ts src/core/testkit/executor-contract.test.ts src/core/testkit/testkit-json.test.ts src/runtime/runtime.test.tsbun run typecheckbun run lintbun run format:checkbun run testbun run docs:build