This gives you a few features for your app:
- action centric structure (
<app-name> <action> <other stuff>
) - automatic handling of commented JSON config files and setting values therein
- automatic handling of optional
~/.<app-name>
directories (and easy init) - automatic handling of classes of plugins installed in
~/.<app-name>
- simple require shim for plugin loading
- automated installation and (eventually) maintenance
- handle ansi configuration of
yargs
and adding some features/simplifications- handle flag collisions
- (eventually) formatting widths to terminal width
- (eventually) handle other libraries
- rights notifications & licensing information
- (eventually) man pages
- test harness (use common tests/data between CLI and Classes)
npm install app-term-kit
var app = new CLApp('app-name', {
copyright : 'Ed Beggler',
copystart : '2020',
defaults : `{
// This file was autogenerated by app-name
//
"name": "robble-rauser",
"type": "*",
"debug": false
}`
});
Define a command, with it's runtime logic
app.command({});
Define a flag or argument to be passed to one or more commands
app.argument({});
Enable help function via --help
or -h
app.help();
The prefix to all the documentation
app.header({});
The suffix to all the documentation
app.footer({});
Enable and load sets of plugins
app.plugins({}, cb);
allow the user to interactively alter the config file
app.useable(cb);
Get the app's current configuration
app.config(cb);
Execute based on the existing configuration.
app.run(cb);
using .on()
, .off()
, .emit()
and .once()
the user can interact with events that are generated from the object.
- `plugins-installed` : one or more plugins has been installed.
[More to come]