Interactive checkbox prompt for selecting multiple options in CLI
Inquirer checkbox prompt
$ import { checkbox } from '@inquirer/checkbox'; const answer = await checkbox({ message: 'Select items', choices: [{name: 'Option 1', value: '1'}, {name: 'Option 2', value: '2'}] });$ import { checkbox } from '@inquirer/checkbox'; const answer = await checkbox({ message: 'Pick features', choices: [{name: 'Feature A', value: 'a', checked: true}, {name: 'Feature B', value: 'b'}] });$ import { checkbox } from '@inquirer/checkbox'; const answer = await checkbox({ message: 'Select at least one', choices: [...], validate: (ans) => ans.length > 0 || 'Pick something' });$ import { checkbox } from '@inquirer/checkbox'; const answer = await checkbox({ message: 'Choose', choices: [{type: 'separator'}, {name: 'Group 1 Item', value: 'g1'}, {type: 'separator'}, {name: 'Group 2 Item', value: 'g2'}] });$ import { checkbox } from '@inquirer/checkbox'; const selected = await checkbox({ message: 'What to install?', choices: ['npm', 'git', 'docker'].map(x => ({name: x, value: x})) });