Interactive checkbox prompt for Node.js CLI applications
Inquirer checkbox prompt
inquirer$ node -e "const { checkbox } = require('@inquirer/checkbox'); checkbox({ message: 'Select options', choices: [{name: 'Option 1', value: '1'}, {name: 'Option 2', value: '2'}] }).then(console.log)"$ node -e "const { checkbox } = require('@inquirer/checkbox'); checkbox({ message: 'Choose features', choices: [{name: 'Feature A', value: 'a', checked: true}, {name: 'Feature B', value: 'b'}], validate: (ans) => ans.length > 0 || 'Select at least one' }).then(console.log)"$ node -e "const { checkbox } = require('@inquirer/checkbox'); (async () => { const ans = await checkbox({ message: 'Pick items', choices: ['Item1', 'Item2', 'Item3'] }); console.log('Selected:', ans); })()"