-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Tab completion? #385
Comments
It would be great to have shell auto-completion for already generated program help without write much code. Suggestions? I can't find anything suitable at npm. |
Interesting. PR about this feature is welcome~ |
E.g.:
|
This would be a great feature. =D |
I looked into this in the past and had a working prototype (not using a third party module). However, getting it working for windows is a whole other ballgame. I'd like to see a powershell solution so commander can continue to be multi-platform |
I have found commander-auto-complete, but which is not good enough to use for product. |
Windows support has been one of the reasons in the past that I never pursued this personally. That, and the fact that I think a solid usage doc with a levenshtein distance check on attempted command executions (like git) usually covers the case. IMHO, I feel like if you're leaning on autocomplete for your CLI, you might have a design issue with it. Not to say that they're aren't real cases that could use it, but I'm of the opinion they should be rare. |
Just an update on this – those looking for CLI auto-completion might want to consider switching to Vorpal. Vorpal is a bit more involved, but it has a lot of the more advanced features built-in. |
@bitjson Vorpals autocompletion is quite awesome, yet the lack of typescript typings is a dealbreaker for me. Yet commander has them. I wished commander would also support autocompletion :) |
@tonylukasavage don't dismiss autocompletion as being a quick fix for poor design decisions. It can also be user for values for example: addpermission user@... system.admin system.... Many database CLIs implement this kind of autocomplete for table names and fields. @bitjson Vorpal works great as a shell, however due to some bugs, it's pretty much impossible to invoke a single command from command line and quit |
An alternative is also Yargs: https://github.com/yargs/yargs |
For anyone following this issue, I strongly recommend you check out oclif. It's extremely well-designed, and the autocompletion is fantastic. |
Not currently planning to build tab completion into Commander itself, so closing this issue. I am interested in this as a problem, so please let us know about packages which integrate well with Commander. |
Leaving breadcrumbs for anyone who is wanting to get this up and running simply: hello.js
to make it work source omelette output to your shell and alias as explained in omelette documentation
Then just |
This was very helpful to get things started, thank you! I'd like to point out one thing in case others are initially unable to get this example working. First, add a comma after hello() {
node index.js $@
} |
Hi, |
Revisiting this problem again and it appears there is still no well-supported solution. See:
And as a potential alternative: |
Has anyone implemented tab completion with commander? Complete looks like a working module, but it seems like this would be perfect territory for commander.
Another module: completion
The text was updated successfully, but these errors were encountered: