Skip to content

feat: add one-shot shell completion installer#9

Open
francoischalifour wants to merge 1 commit into
fc/agent-human-outputfrom
codex/completion-install
Open

feat: add one-shot shell completion installer#9
francoischalifour wants to merge 1 commit into
fc/agent-human-outputfrom
codex/completion-install

Conversation

@francoischalifour

@francoischalifour francoischalifour commented Jun 27, 2026

Copy link
Copy Markdown
Member

This PR builds on #8. The goal is to make shell completion easy to install with one command.

Preview

image

What changed

  • Adds altertable completion install with shell detection from SHELL.
  • Adds explicit install targets: altertable completion install bash, fish, and zsh.
  • Writes completion scripts to standard user paths.
  • Updates bash and zsh startup files with an idempotent managed block unless --no-rc is passed.
  • Keeps manual generation commands: altertable completion bash, fish, and zsh.
  • Cleans completion UX so shells are suggested after completion install instead of repeating install.
  • Improves install output into a scannable status block with shell, script path, startup action, next step, and docs.
  • Adds terminal Markdown link formatting so labeled links can render as OSC hyperlinks where supported.
  • Updates README shell completion docs.

Verification

  • ./scripts/verify.sh --quick
  • Smoke tested the worktree launcher with temporary HOME values for fish and zsh install paths.

@francoischalifour francoischalifour changed the title Add one-shot shell completion installer feat: add one-shot shell completion installer Jun 27, 2026

@albert20260301 albert20260301 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

2 participants