-
Notifications
You must be signed in to change notification settings - Fork 629
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
suggestion: add interactive prompts to @std/cli
#4678
Comments
These additions are welcome in my opinion. Note to those who are interested in contributing in these areas: Please also consider contributing in Pseudo Terminal support in Deno ( denoland/deno#3994 ). Deno currently doesn't have a practical way to test terminal interactions (as far as I know) and testing these features are very difficult/tricky. |
cliffy already does this. Simple/basic CLI helpers make sense in the Standard Library, but there is a point when we should not go further. I'd prefer not to have this in the Standard Library. |
I tend to agree with @iuioiua here. I would generally like high quality and flexible building blocks in |
I would not exclude a commonly used feature as this that makes the tools list more complete just because the tools list is not complete (yet). |
This is my opinion of course, but let me try and clarify my stance. My concern here is figuring out the balance of what goes into When I choose libraries to use, I try to be cognizant of how well they will evolve with my project. If I'm starting a CLI project, I want to pick a feature rich library up front, so I can avoid limitations that might cause me to have to rewrite or switch out libraries later. My worry is that some tools like the input select, etc. could easily fall into the grey area describe above. Especially given they are opinionated in a way that is directly exposed to the end user versus internal code. Here is my current opinions on the existing cli tools:
To summarize, I'm not against having a full suite of CLI tools in |
Seems like implementing a selection prompt would not be too difficult. I made a draft here as a poc. I think something along those lines would be a nice addition to std. |
Since |
Hi.
When building CLI tools, there's often a need to ask the user about values.
Deno already provides functions such as
prompt
orpromptSecret
to gather simple strings.But there's currently no easy way to let the user interactively choose a value in a finite set.
In user land, popular libraries such as Inquirer (https://www.npmjs.com/package/inquirer) offer such advanced prompts.
Here's a screenshot from Inquirer's README that illustrates what it looks like in the terminal, where the user can use its keyboard to navigate between options:
So I guess my question boils down to the following:
Could such features (a.k.a. Inquirer clone) deserve to be builtin in
@std/cli
to avoid reaching for an external dependencies?Thanks.
The text was updated successfully, but these errors were encountered: