1 2 3 4 5 6 7 8 9 10 11 12 13 | // commands/apps/add.js var AddApplication = Command.extend({ desc: 'Create new application', options: { verbose: 'boolean' }, run: function (verbose, name) { // verbose = true, name = "hello-world" } }); $ my-program apps add --verbose hello-world |
Ronin is building commands based on how you structure your project. Create add.js inside apps folder and apps add command is there.
Because Ronin depends on your project structure, it automatically forces you to structure your code in a comfortable way. Each namespace has its folder and all commands that belong to it are in that folder.
Avoid repeating yourself and specify middleware for each command. Useful for authentication, validation, etc.
Ronin generates help for a whole program, individual namespace or command. There is also ability to customize help output.
You can easily specify command and global options, their types, aliases and default values. Their values is passed to command as function arguments in the order they were defined.
Ronin ships with a Yeoman generator, that will get you started in less than a minute. It creates a base for your CLI program, installs dependencies and links it, so that it's accessible from $PATH.
Ronin's codebase is only 269 sloc. Every piece of Ronin is carefully tested.
More features coming soon. Open a github issue if you have suggestions.
Ronin will help you focus on building your CLI application, rather than on how to build a CLI application. To get you started, there is a Getting Started tutorial, where you will create your first CLI program with Ronin. There are also non-boring guides available, if you want to know more.
Yes, that's all it takes! Tweet, follow and star it on GitHub!