feat: add one-shot shell completion installer#9
Conversation
albert20260301
left a comment
There was a problem hiding this comment.
Local verification is failing on this stacked PR:
bash scripts/verify.sh --quick
...
5 tests failed:
- renderAltertableUsage active context > shows active context on root help when stdout is a TTY
- errors > renderCliError formats CliError
- errors > unknown errors render without stack traces
- completion command > install writes fish completion without startup file changes
- completion command > install can skip shell startup file updates
The first three are inherited from #8's terminal color state leak. The last two are new to this PR: the completion installer tests pass when run alone, but in the full suite runCompletionInstall() receives an empty output string even though the completion files are written. That points to the tests depending on whatever global CLI runtime/output sink previous tests left behind.
Please make the completion install tests hermetic by running them under an explicit createCliRuntime({ json: false, agent: false }) with a captured sink, rather than relying on the process/global runtime and console.log interception. This PR is stacked on #8, so it also needs #8's color/runtime isolation fixed before it is merge-ready.
This PR builds on #8. The goal is to make shell completion easy to install with one command.
Preview
What changed
Verification