feat(cli): add shell completion support#974
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
|
Looking into the CI failure. |
|
There is a bug in the |
|
@nekomoyi can you rebase and fix conflicts? |
…ive paths Fix mixed path separators in env files on Windows - Before: $HOME/.vite-plus\bin (mixed) - After: $HOME/.vite-plus/bin (consistent) Simplify completion generation with loop-based approach
…dows - Increase stack size to 8MB on Windows - Set RUST_MIN_STACK to 8MB in CI test jobs Cargo test default (2MB) are insufficient for deep recursion in clap_complete::generate(). This causes stack overflow when generating shell completion scripts during tests.
0d02ce0 to
9fb37ec
Compare
The forward/backward slash path issue in __vp_bin has been addressed in this PR. # .vite-plus/env
__vp_bin="$HOME/.vite-plus/bin"# .vite-plus/env.ps1
$__vp_bin = "C:\Users\nekomoyi\.vite-plus\bin" |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 444eabb7bd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 444eabb7bd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@nekomoyi There is a problem with the automatic suggestions for subcommands, for example, vp build
zsh: do you wish to see all 3976 possibilities (1999 lines)? |
|
@fengmk2 I tried to reproduce the problem on my side but couldn't replicate it. When I type |

Summary
Implements shell completion for the vp CLI.
Changes
Completion scripts for bash, zsh, fish, and PowerShell are generated in
~/.vite-plus/completion/when runningvp env setup, and automatically sourced in the respective env files.Fixes
Fixed mixed path separators in env files on Windows to use forward slashes consistently for
$HOME-relative pathsIncreased stack size to 8MB to handle deep recursion in
clap_complete::generate()which exceeds Windows' default stack size.Closes #950