fix(cli): route legacy completions through public binary - #5530
fix(cli): route legacy completions through public binary#5530wuisabel-gif wants to merge 2 commits into
Conversation
Keep `codewhale completions <shell>` as a compatibility alias while generating scripts from the canonical public CLI name. Add provider-free parser and shell coverage for Hmbown#5526.
|
Thanks @wuisabel-gif for taking the time to contribute. This repository is observing a maintainer-managed PR intake gate in dry-run mode, so this pull request is staying open. This note helps maintainers prepare the allowlist before any enforcement is considered. Please read |
Keep the generated TUI changelog aligned with the root changelog for Hmbown#5526.
|
CI update:
The completion implementation and all 217 local CLI library tests pass. Please let me know whether you would prefer those unrelated baseline lint cleanups in a separate PR or included as a mechanical follow-up here. |
Lstarsky0
left a comment
There was a problem hiding this comment.
Built both sides and diffed the scripts the two versions actually emit. On 75dca2cfb the PowerShell script registers for codewhale-tui and carries the runtime's 29 subcommands; on 95df027f1 it registers for codewhale and carries the CLI's 42. Sixteen of those are new — config, run, thread, web, metrics, update and friends were never completable before, which is the bigger win here than the binary name.
Three go the other way. pr, scorecard and session-diagnostics were in the old script, aren't in the new one, and are still typeable: codewhale hands anything it doesn't recognise to the runtime — a made-up subcommand gets the same "requires an interactive terminal" error that codewhale pr --help does — and all three are real commands (Pr at crates/tui/src/lib.rs:323, Scorecard at :342, SessionDiagnostics at :276). So they still work in a terminal and no longer complete. Defensible if the script is meant to describe the public CLI surface and nothing else, but it isn't visible from the diff.
Smaller: every_completion_shell_uses_the_public_binary_name lists Bash, Fish, PowerShell and Zsh by hand and misses Elvish, the fifth clap_complete::Shell variant. Shell::value_variants() covers all of them and keeps covering them. And let _ = io::stdout().write_all(&output) throws the write result away where run() could ? it.
cargo test -p codewhale-cli --lib --locked on 95df027 is 217 passed here too.
|
Thanks @wuisabel-gif — this slice is now superseded by the v0.9.11 integration merged in #5542 ( |
Record the integrated contributions behind PRs Hmbown#5523, Hmbown#5524, and Hmbown#5525, and acknowledge the independently reviewed overlap in Hmbown#5530 without counting it as a duplicate merge. Signed-off-by: CodeWhale Bot <bot@codewhale.net>
Summary
Addresses the approved scope of #5526.
The legacy
codewhale completions <shell>command now uses the same canonical completion generator ascodewhale completion <shell>instead of forwarding to thecodewhale-tuiruntime. Generated scripts use the publiccodewhalecommand name.The legacy plural command remains available as a compatibility alias. The canonical singular command is unchanged.
Coverage
Added provider-free CLI tests that verify:
codewhale completions powershellparses directly in the CLI;codewhale;codewhale-tuibinary name.Verification
cargo fmt --all -- --checkgit diff --checkcargo test -p codewhale-cli --lib --locked(217 passed)No provider credentials or network access are required.
No-Issue: This PR addresses the approved compatibility slice of #5526 without automatically closing the broader report.