oclif / cli-ux

CLI IO utilities
MIT License
544 stars 44 forks source link

How to add default value for prompt #436

Open danielh-official opened 3 years ago

danielh-official commented 3 years ago

Let's say I want to show a greyed-out value next to the colon (in parenthesis) when prompting. Like how Node does it when you run npm init and it asks for the name of your directory. It automatically guesses based on folder or repo name and shows it in the aforementioned format. You don't have to manually enter it.

Example

npm init

name: (name-of-repo)

You can use the default name given to you or enter it manually.

Are we able to replicate that in this framework?