@expo/commander

Build interactive command-line interfaces with Node.js easily

npmmacoslinuxwindows
Try with needOr install directly
Source

About

the complete solution for node.js command-line programs

Examples

create a new command line program with options and arguments$ npm init && npm install @expo/commander && node -e "const { Command } = require('@expo/commander'); new Command().name('myapp').version('1.0.0').parse()"
add subcommands to a CLI tool$ const program = new Command(); program.command('deploy').description('deploy app').action(() => console.log('Deploying...'))
parse command line arguments and options automatically$ program.option('-v, --verbose', 'verbose output').option('-p, --port <number>', 'port number').parse(process.argv)
display help text and usage information$ program.help() // or node myapp.js --help
handle required arguments with validation$ program.command('deploy <environment>').requiredOption('-k, --key <token>', 'API key').action((env, options) => {})