@clack/prompts

Build interactive command-line prompts and forms with beautiful UI.

npmmacoslinuxwindows
Try with needOr install directly
Source

About

Effortlessly build beautiful command-line apps 🪄 [Try the demo](https://stackblitz.com/edit/clack-prompts?file=index.js)

Examples

create an interactive yes or no question in terminal$ import { confirm } from '@clack/prompts'; const result = await confirm({ message: 'Continue?' });
build a multiple choice menu for user selection$ import { select } from '@clack/prompts'; const choice = await select({ message: 'Pick one', options: [{value: 'a', label: 'Option A'}] });
get text input from user in command line$ import { text } from '@clack/prompts'; const name = await text({ message: 'Enter your name' });
let user pick multiple items from a checklist$ import { multiselect } from '@clack/prompts'; const items = await multiselect({ message: 'Select items', options: [{value: '1', label: 'Item 1'}] });
display a password input field that hides typed characters$ import { password } from '@clack/prompts'; const pwd = await password({ message: 'Enter password' });