Skip to content

Latest commit

 

History

History
59 lines (43 loc) · 1.76 KB

README.md

File metadata and controls

59 lines (43 loc) · 1.76 KB

ubibot-cli

Command Line Interface for ubibot.

Currently alpha code

installation

npm install @numical/ubibot-channel-cli

usage

A channel package that provides a Command Line Interface (CLI) to a single-user implementation of ubibot.
This is not a standalone library.
It must be used as a dependency in an application such as @numical/echobot:

const { startCLI } = require("@numical/ubibot-channel-cli");
const { config } = require("an ubibot domain package");

startCLI(config);

This will result in:

CI screenshot

testing

This also offers a test runner for the CLI channel:

const { testCLI } = require("@numical/ubibot-channel-cli");
const { config } = require("an ubibot domain package");

const scriptsDir = path.resolve(...);

testCLI("My Domain Tests", config, scriptDir);

See @numical/ubibot-test for more on using this test runner.

api

This module exports 2 functions:

###startCLI(config)

  • instantiates a single-user ubibot and starts a command line interface
    arguments
    - config (Object) : configuration object created by a domain package; returns
    undefined - but a side effect is a spawned repl process

###testCLI(config)

  • instantiates a single-user ubibot and runs a test runner for use with @numical/ubibot-test
    arguments
    - name (String): display name for the test
    - config (Object) : configuration object created by a domain package; - scriptsDir (String) : the fully resolved path of the scripts directory. returns
    undefined