A library for easily creating observable CLI tasks with support for commands, arguments, and options.
Go to file
2016-10-15 01:01:25 +02:00
dist implement standardJS 2016-10-15 00:56:02 +02:00
docs improve typings and docs 2016-09-04 17:32:12 +02:00
test implement standardJS 2016-10-15 00:56:02 +02:00
ts implement standardJS 2016-10-15 00:56:02 +02:00
.gitignore update smartcli 2016-09-04 17:23:29 +02:00
.gitlab-ci.yml fix ci 2016-09-04 17:36:07 +02:00
LICENSE Initial commit 2015-10-04 23:06:36 +02:00
npmts.json update dependencies 2016-05-23 04:09:06 +02:00
package.json 1.0.11 2016-10-15 01:01:25 +02:00
README.md implement standardJS 2016-10-15 00:56:02 +02:00
tslint.json implement standardJS 2016-10-15 00:56:02 +02:00

smartcli

nodejs wrapper for CLI related tasks. TypeScript ready.

Availabililty

npm git git docs

Status for master

build status coverage report Dependency Status bitHound Dependencies bitHound Code TypeScript node

Install the package

npm install smartcli --save

Usage

this plugin tries to establish some logic in which CLI tools work.

take the following commandline input:

mytool function argument1 argument2 --option1 -o2 option2Value
  • 'mytool' obviously is the tool (like git)
  • function is the main thing the tool shall do (like commit)
  • argument1 and argument2 are arguments
  • option1 is a longform option you can add (like --message for message)
  • optionValue is the referenced option value (like a commit message)
import {Smartcli} from "smartcli"
mySmartcli = new Smartcli();
mySmartcli.standardTask()
  .then(argvArg => {
    // do something if program is called without an command
  });

mySmartcli.addCommand({commandname: 'install'})
  .then(argvArg => {
    // do something if program is called with command "install"
  })