0.2.0 • Published 8 months ago

pico-cli v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Pico-cli

Typescript first and zero dependency CLI framework

Install

npm install pico-cli

Usage

import {PicoCli} from 'pico-cli'

PicoCli.create({
    name: 'my-cli',
    description: 'My cli is used to do X and Y',
    options: {
        // TODO: document options
    },
})
// you can chain adding commands to your cli
.addCommand('foo', {
    handler: (args) => {},
    description: 'use foo to do X'
    aliases: ['f'] // A.K.A. shortcuts
})
.addCommand('bar', {
    handler: (args) => {},
    description: 'use bar to do Y',
    aliases: ['b'],
})
// to run the cli
.run(
    // optionally provide arguments
    process.argv.slice(2)
);

API

PicoCli.create

Function creates a CLI instance. Accepts a name and a specification.

PicoCli.commaSeparatedString

TODO

PicoCli.optionHandler

TODO

PicoCli.Error

TODO

TODO

  • commands of commands
  • options to not print help on error
  • handle merged single letter options
0.2.0

8 months ago

0.1.1

8 months ago

0.1.0

8 months ago