cli-manager
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

CLI-MANAGER

github

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

Package Sidebar

Install

npm i cli-manager

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

12.3 kB

Total Files

7

Last publish

Collaborators

  • madieq