-
-
Notifications
You must be signed in to change notification settings - Fork 764
feat(cli): add TAB completions #3650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@AmirSa12 is attempting to deploy a commit to the Nitro Team on Vercel. A member of the Team first needs to authorize it. |
| const minifyOption = buildCommand.options.get("minify"); | ||
| if (minifyOption) { | ||
| minifyOption.handler = (complete) => { | ||
| complete("true", "Enable minification"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we somehow integrate it with citty core to avoid custom logic for each arg? (we have an object of args with their meta)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's what I'm trying to do.
There is an open PR that integrates tab with citty core:
unjs/citty#211
with this, we can avoid this part.
| const presetOption = buildCommand.options.get("preset"); | ||
| if (presetOption) { | ||
| presetOption.handler = (complete) => { | ||
| complete("node-server", "Node.js server"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(TODO for myself): List can come from auto gen file
|
Salam @pi0! I heard there were concerns about tab depending on the |
|
Amazin @AmirSa12! I will also try to find some time moving citty PR forward to make it happen! |
π Linked issue
β Type of change
π Description
This PR introduces tab completion functionality for the nitro cli, improving developer experience by allowing shell(zsh, powershell, fish, bash) autocompletion for commands, options, values, and flags. With this PR, users can navigate available commands, options and values faster!
A small video of how this looks:
nuxi.mp4
π Checklist