feat(cli/completion): add support for unstable_dynamic - #6899
Conversation
|
The CI error does not appear to be related to this change |
|
Thank you for your contribution! I am a bit hesitant to use unstable clap features, especially now that epage's work isn't funded anymore. We also have pretty decent completions these days thanks to @hunger |
|
I think this is an optional solution rather than a replacement for the current static generator. The core issue is that Pixi’s completion scripts are simply too long right now—707 KB for pwsh and 398 KB for bash. Evaluating such long shell commands slows down startup, and using this unstable solution can resolve that issue. |
|
Furthermore, this feature would enable more autocompletion options, such as autocompletion for “task-name” (which has already been added), and so on. In short, I think this is a “harmless” feature that could be useful to many people (especially PowerShell users), so I hope you'll consider it. |
|
@Hofer-Julian Let's discuss this in more detail. We've been wishing for this feature since Pixi was created. I would say if it works it would be such a big UX improvement that I would be willing to give it a go. In the worst case we would have to remove these UX features later when it shows to not be a decent feature in the end. @baka-gourd did you have experience with it in other projects? |
|
@ruben-arts in other projects as I have said in issue, cargo and rust-lang/rustup#5033 have this feature to complete toolchains; in the Python ecosystem, at least uv hasn't implemented this feature; for Git, there are already many third-party modules that provide context-aware autocompletion, such as the PS Module I use; for winget, this. The features mentioned above work great in practice, providing quick and intelligent suggestions for what you need. two key advantages:
one drawback:
Overall, I think this is definitely a “decent” solution, it provides a progressive enhancement effect. |
|
I am just as excited about this feature as you all are, but has there actually been progress to stabilize this? Because this feature is in a limbo for a long time now. |
Description
Fixes #6898
for
I have made corresponding changes to the documentation:There are currently no documents related to shell completion, so I haven't added any. If needed, I can add some.
How Has This Been Tested?
Tested all unit tests, and pass all lints. Works on my pwsh(Windows) and Bash(Git Bash for Windows)
AI Disclosure
Tools: {e.g., Claude, Codex, GitHub Copilot, ChatGPT, etc.}
Checklist:
schema/model.py.