cli-ator
A cli tool to create cli tools FASTER 🚀
Install
npm i cli-ator
Usage
const cli = require('cli-ator')
const insta = cli({
printer: console.log,
log: 'info',
helpPath: 'man/',
help: 'README.md',
helpArg: 'help',
autoloadPath: 'commands/',
commands: [
{
command: 'demo',
commandPath: 'command/',
help: 'README.md',
handler: (args, logger) => {
logger.info('My output')
return 42
},
inputArguments: { }
}
]
})
insta.on('start', (command, parsedArgs) => {
})
insta.on('end', (command, result) => {
})
insta.on('error', (error, command) => {
})
insta.on('not-found', (args) => {
})
insta.execute(process.argv.splice(2))