A library for easily creating observable CLI tasks with support for commands, arguments, and options.
Go to file
2016-08-26 11:52:09 +02:00
dist start interaction module 2016-08-26 11:52:09 +02:00
test improve intellisense 2016-08-26 09:21:42 +02:00
ts start interaction module 2016-08-26 11:52:09 +02:00
.gitignore work in progress 2016-03-18 17:08:26 +00:00
.gitlab-ci.yml add gitlab ci 2016-06-09 14:02:21 +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 start interaction module 2016-08-26 11:52:09 +02:00
README.md start interaction module 2016-08-26 11:52:09 +02:00

smartcli

nodejs wrapper for CLI related tasks. TypeScript ready.

Status

Build Status Dependency Status bitHound Overall Score bitHound Code

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.question