fix(cli): de-duplicate --help output and add init e2e coverage#38
Merged
Conversation
The program description embedded a hand-maintained command list that commander also auto-prints, so `--help` rendered the command list twice with two contradictory `init` descriptions — the manual one stale, claiming the global skill installs by default (it is opt-in since #36). Drop the manual list so commander is the single source; preserve the MCP-mode and Try hints via addHelpText("after"). Add tests/cli-init.e2e.test.ts spawning the real binary across the full init lifecycle (the CLI action is excluded from coverage and was untested): --help no-duplication regression, --json, default, --all, --agents subset, unknown-id exit 2, empty selection, idempotency, missing-path exit 1, --skill opt-in. Add promptSelection non-TTY fallback tests. Sync README init line to opt-in skill wording.
bntvllnt
added a commit
that referenced
this pull request
Jun 1, 2026
## Release v2.4.1 Patch release. Ships the `--help` de-duplication fix and the new `init` lifecycle E2E coverage from #38 (already on `main`, verified live on the `2.4.0-canary.e21b238` build). - `package.json` → `2.4.1` - `CHANGELOG.md` → `[2.4.1]` entry (Fixed: doubled `--help`; Added: init E2E tests) No version-pinned docs to update — README/llms reference `@latest`. After merge, dispatch the **Publish** workflow to tag `v2.4.1`, publish npm `latest` (OIDC provenance), and create the GitHub Release.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Dogfooding
initsurfaced a broken-lookingcodebase-intelligence --help: thecommand list printed twice with two contradictory
initdescriptions. Rootcause — the program
.description()embedded a hand-maintained command list thatcommander also auto-generates. The manual
initline was stale, claiming theglobal skill installs by default (it is opt-in since #36).
The CLI action layer (
src/cli.ts) is excluded from coverage and had zerotests, so nothing caught this or guards the
initlifecycle.What
.description(); commander is now thesingle source. Preserve MCP-mode + Try hints via
addHelpText("after").tests/cli-init.e2e.test.ts, new): spawn the real binary across thefull init lifecycle with a sandboxed
HOME— help no-duplication regression,--json, default (non-TTY),--all,--agentssubset, unknown-id → exit 2,empty selection, idempotent re-run, missing path → exit 1,
--skillopt-in,skill-not-installed-by-default.
promptSelectionnon-TTY fallback tests (no mocking of own code).initline synced to opt-in skill wording.Verification
326 + 16 new, zero regressions).
node dist/cli.js --helpnow shows one command list.Behavior of
inititself is unchanged — verified working across every mode(interactive PTY,
--json,--all,--agents, idempotency).