feat(cli): grok-style clap completions with tiny rc hook - #37
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Deploying crabcode with
|
| Latest commit: |
f843b93
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bf1ae921.crabcode.pages.dev |
| Branch Preview URL: | https://feat-clap-completion-install.crabcode.pages.dev |
56b69cc to
646827f
Compare
`crabcode completion <shell>` prints a clap_complete script. `--install` writes it to the autoload path and a marked rc block appended after other installers. Zsh uses fpath + autoload + compdef so the script is not sourced at startup (parsed on first Tab). `#compdef` includes aliases discovered from `.zshrc` at install time. clap#6282: drop the unused prompt slot.
…HOME dotsources, strip old inline dumps - Default shell from `$SHELL` env var (zsh/fish/elvish/pwsh, else bash) - Script paths use `$XDG_DATA_HOME` / `$XDG_CONFIG_HOME` when set - Bash falls back to `.bash_profile` when `.bashrc` is absent - PowerShell hooks dotsource `"$HOME/..."` instead of bare `~` - Strip old inline completion dumps from rc before installing marked block - Add CI workflow for rustfmt + completion tests on PRs - Add PR review doc - Update README and npm/README with XDG, $SHELL default, and re-run note - 19 completion tests pass chore(ci): drop PR Actions workflow Too expensive, and cargo test hits build.rs requiring remote-client assets. Keep local completion tests; merge confidence stays 4.5/5.
clap_complete zsh scripts end with `compdef _crabcode` inside if/else/fi. The stripper treated `compdef` as the dump end and left a stray `fi` in .zshrc (`parse error near 'fi'`). Eat that closer (and following blanks). Drop the in-branch PR review doc. Tests now assert no leftover `fi` and `zsh -n` on a real clap dump.
646827f to
f843b93
Compare
PR Review — #37 feat(cli): grok-style clap completions with tiny rc hookBranch: Body (GitHub comment)Grok-style Follow-up Ready to merge. Remaining 0.15 is live Tab dogfood in an interactive zsh (not blocking). Diff summary
Regressions?No remaining CLI break. Previously Fixed since last review:
Remaining (non-blocking):
TUI / agent / persistence paths are untouched. Branch is 0 behind Migrations?No.
Checks run (non-mutating)
Checklist before merge
Confidence bumpsNow 4.85 / 5 (was 3.0 before
Merge is fine at 4.85. The leftover 0.15 is interactive Tab UX, already unit-smoked ( |
Summary
Grok-style
crabcode completion <shell>on clap. Tiny rc hook; clap_complete Tab UX.What
crabcode completion zsh/bash/fish/elvish/powershell— prints the script--installwrites the autoload file + a marked rc block appended at the end-prefix then flags, same as grok).zshrcforalias foo=crabcodeinto#compdef(no runtime loop, no hardcoded cc)[PROMPT]slot so nested commands completeInstall
crabcode completion zsh --install exec zshThen
crabcode completion <tab>→ shells;crabcode completion zsh <tab>→-then flags.