Grunzer Logo (Piggy Nose) grunzer

Creating CLI Tools with Node.js

Packages

When creating your own cli tool based on node.js you should really not implement everything yourself, because this wheel is already implemented and more stable than your own one will ever be.

In the following list I put some packages which might be useful in order to built CLI tools on top:

commander

The classic library for reading command line parameters, arguments, flags and so forth. It should be a suitable choice in general, although this library is already a dinosaur with the first versions being released 10 years ago.

npm: commander

promptly

Promptly is a simple tool to get user input. Multiple dialog types are possible this includes:

  1. confirm
  2. prompt: Classic text input
  3. choose: select from a list of options

npm: promptly

inquirer

Extensible CLI prompt framework, a lot more powerful than promptly.

npm: inquirer

enquirer

Similar to inquirer but with fancier look.

npm: enquirer