smallcli

A small framework for rapid prototyping a command line interface for some software you want to use from the command line but does not have a cli

Usage no npm install needed!

<script type="module">
  import smallcli from 'https://cdn.skypack.dev/smallcli';
</script>

README

A small framework to write a basic recursive cli interface

usage:

const cli = require('smallcli');

cli({
    command_name (parameter1, parameter2, parameter3, ...) { //if you return a promise it will block executing until the promise is resolved (await)
        return new Promise( (resolve, reject) => {
            ...
            resolve( value );
        });
    },
    command_number_two (parameter1, parameter2, parameter3, ...) {
        ...
        return value;
    },
});