Kumander (Alpha)
Simple, Express-style CLI framework for Node. Create CLI programs written in Typescript or in Javascript with no additional dependencies.
Install
NPM
$ npm install --save kumander@0.0.4
Yarn
$ yarn add kumander@0.0.4
Usage
- Import first the module
// For Typescript;const cli = ; // For NodeJSconst kumander = ;const cli = kumander;
- Start using it by adding commands and options.
cli; // Add CLI namecli; // Add CLI versioncli; // CLI descriptioncli; // Add default command to be executed // Adds "yolo" optioncli // Adds "name" optioncli; cli; cli; // Runs the CLI with the ARGV array;
- Run the program
$ node test.js print Joe --age=20Hello my name is JoeI\'m 20 years old. $ node test.js --yoloYou only live once.
Adding additional info
// You must insert them first before you add the commands/options. cli; // Add CLI namecli; // Add CLI versioncli; // CLI descriptioncli; // Add default command to be executed
--help
Generation
Kumander can auto-generate the list everytime you add a command or option.
$ node test.js --help
My CLI app
Just a normal command line program
Usage: my_cli app [options]
Options:
--version Displays CLI version
--yolo Prints the meaning of YOLO.
--help Displays the list of commands and options
--age Age option
-A Shortcut of 'age'
-v Shortcut of 'version'
-h Shortcut of 'help'
Commands:
print Prints a name
Development
Build
Kumander is written on Typescript from the ground-up and must install the tsc
compiler first before you start building this module. After that, you can start building it by executing:
$ npm build-dev
Roadmap
- Command argument support
- Shorthand option support
- Middleware / Plugin Support(?)
- JSDoc comments
-
--help
generation - Error handling
- Tests
Contribute
- Fork / Clone this repo. (
git clone https://github.com/nedpals/kumander.git
) - Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Copyright
- © 2018 Ned Palacios (nedpals)