Next time you have an idea 💡 "I know... Why don't I write a to automate this thing?" Actually, you should not, you should write a instead. script CLI CLI has better structure than scripts. And, CLI uses command flags and help text to prevent you from making silly mistakes. For example: $ moa -- Moa makes it easier to run your node.js apps. USAGE $ moa OPTIONS -c, --commands=commands [default: start] commands to run. -h, -- show CLI -r, --root=root [default: ../] root path to run. DESCRIPTION ... Have some fun help local help help Scripts are messy and can get out of control. At , we run a lot of node.js application. By the way, we make APIs for . And I recommend for creating and managing CLIs. Taggun receipt OCR scanning oclif: The Open CLI Framework by Heroku How to create a new CLI Install first. node.js Start by scaffolding the CLI $ npx oclif single moa ? npm package name (moa): moa $ moa cd Modify your flags in src\index.js MoaCommand.flags = { help: flags.help({ : }), : flags.string({ : , : , : }), : flags.string({ : , : , : }), } // add --help flag to show CLI version char 'h' commands char 'c' description 'commands to run. Comma-separated.' default 'start' root char 'r' description 'root path to run.' default '../' Modify your description in src\index.js MoaCommand.description = `Moa makes it easier to run your local node.js apps. Modify your command in src\index.js { run() { {flags} = .parse(MoaCommand) commands = flags.commands.split( ) {root} = flags find.file( , root, files => { files.forEach( file => { cwd = ( ).dirname(file) commands.forEach( command => { .log(cwd, ) npm = spawn( , [ , command], {cwd}) ( output npm.stdout) { .log( ) } }) }) }) } } class MoaCommand extends Command async const this const ',' const /(?<!node_modules\/.*)\/package\.json$/ async const require 'path' async this `npm run ` ${command} const 'npm' 'run' for await const of this ` : ` ${file} ${output} In this example, you will need to find to install find npm module. run npm i This simple CLI will look for all node.js application in the root folder and run . Great if you need to run multiple node.js application to start coding. npm run [command] Run it ./bin/run -c start -c ../taggun/ Publish and share your CLI See https://oclif.io/docs/releasing