fix(cli): forward flags in npm exec hints

Merged
AG
2mo ago
+16-8

What and why

  • execCommand('npm', ...) omitted npm's -- separator. npm 11 consumed flags from the suggested direct command, so --headed never reached e2e run.
  • Add the separator to npm CLI hints from run, list, and init. Update the matching tests, CLI reference, bundled skill, and patch changeset.

Verified

Ran it locally: yes

  • On Windows with Node 24.19.0, npm 11.6.2, and the built e2e 0.17.0 installed in a scratch project, I ran both commands. The observed e2e argument vectors were:

    main hintthis branch
    npm exec e2e run --headed → ["run"]npm exec -- e2e run --headed → ["run","--headed"]
  • The same setup printed npm's 11.6.2 for npm exec e2e --version and e2e's 0.17.0 for npm exec -- e2e --version.

  • Rebuilt the CLI and triggered its forwarded-flag error in an npm project. It exited 2 and printed Run the CLI directly instead: npm exec -- e2e run --headed.

  • pnpm build, pnpm --filter e2e run typecheck, and the focused package-manager, CLI flag-hint, and init-hint tests passed.

  • The full local Windows gate did not pass: pnpm check stopped at dead-code analysis of scripts/check-dist.ts and scripts/stamp-dist.ts; docs validation could not load the installed Windows sharp binary; the broad unit suite had 44 failures across 14 files, including symlink permission errors. The focused tests above passed.

Checklist

  • Changeset added for the published e2e package.
  • CLI reference and bundled skill updated.
  • Breaking change: none.
  • Public type, wire, or engine contract change: none.