One of the things that bothers me about some cli/console packages is how the commands you write with them end up being tightly coupled to the “framework” the package provides. [...] Most of the time I don’t need a “full console application” - I just need to read some input for the command, run my actual command logic, and send some output from the command. The Leanpub Sampler from Matthias Noback is an example of the kind of thing I usually end up doing in small or one-off projects.
The script makes use of the Aura.Cli component for console interaction then a custom object for the actual work. This completely decouples the CLI handling from the code to produce the resulting document. You can find out more about the Aura framework on the project's main site.