Skip to content

A simple CLI framework "build-my-own" with cero dependencies.

Notifications You must be signed in to change notification settings

emanuelosva/build_my_own_cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CLI

A simple CLI framework "build-my-own" with cero dependencies.

Todos:

  • Add no only boolean options

Usage

  const Cli = require('cli')

  const cli = new Cli()

  cli
    .command('hello', 'display a gretting')
    .arguments('name', { type: String, description: '' })
    .arguments('age', { type: Number, required: false })
    .option('-c, --colorized, show gretting with color')
    .action((args, options, command) => {
      if (options.colorized) console.info(chalk.blue(`Hello ${args.name}`))
      else console.log(`Hello ${args.name} from: cli-${command}`)
    })

  cli.run()

About

A simple CLI framework "build-my-own" with cero dependencies.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published