cli-manager
v1.0.0
Published
Simple CLI manager with STATE and help
Downloads
5
Readme
CLI-MANAGER
Simple CLI manager with STATE and help
Features
- State with self commands
- Commands have self callback
- Commands change state instance
- Simple Builder usage
- Output help for each command
Usage
import CLI from 'cli-manager'
import { ICbInput, ICliListener } from 'cli-manager'
let cli = new CLI()
cli.setState('abc')
.add('change', (input: ICbInput) => {
console.log(input.state)
cli.setState('idle')
console.log(input.cli.INIT_MESSAGE)
}, 'change\thelp for some command')
.setState('idle')
.add('change', (input: ICbInput) => {
console.log(input.state)
input.cli.setState('abc')
console.log(input.cli.INIT_MESSAGE)
})
cli.run() //starting listen console input