🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

pico-cli

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pico-cli

Typescript first / zero dependencies CLI framework

latest
Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
14
7.69%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

cli

FAQs

Package last updated on 13 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts