DEV Community

Cover image for 7 libraries to build Node.js CLI

7 libraries to build Node.js CLI

๐Ÿฆ Yvonnick FRIN on November 20, 2019

Last week, I wrote an article about building a Node.js CLI using yargs. I introduced it saying we use cli tools everyday to simplify common tasks i...
Collapse
 
saurabhdaware profile image
Saurabh Daware ๐ŸŒป • Edited

I absolutely love prompts! I recently switched from inquirer to prompts and it helped me reduce my dependency tree.

I love commander as well, It has 0 sub dependencies and since it is popular it has good resources available (there are a lot of articles available about commander).

Great article๐Ÿฆ„ I haven't heard about a lot of them before.. I'll give them a try :D!

Collapse
 
yvonnickfrin profile image
๐Ÿฆ Yvonnick FRIN

Thank you ๐Ÿ™Yesterday, I asked someone why using inquirer over prompts. Thank you for the dependency tree argument ๐Ÿ‘

Collapse
 
terkelg profile image
Terkel Gjervig

Thank you Saurabh, I'm glad you find Prompts useful!
Few dependencies are one of the main goals of Prompts - High five! ๐Ÿ–

Collapse
 
gomflo profile image
Hugo Gomez

inquirer and ora are also good

npmjs.com/package/inquirer

inquirer

npmjs.com/package/ora

ora

Collapse
 
yvonnickfrin profile image
๐Ÿฆ Yvonnick FRIN

I used them too but I did a choice for the article ๐Ÿ˜ข

Thank you for talking about them ๐Ÿ‘Œ

Collapse
 
adam_cyclones profile image
Adam Crockett ๐ŸŒ€

Might want to include some logging libraries next?

Segway: one thing I learned from other languages is your cli is just a client and you should keep the functionality in a separate libe that exposes bindings to this client or any future applications.

Collapse
 
yvonnickfrin profile image
๐Ÿฆ Yvonnick FRIN

I'm not familiar with the subject but it seems interesting (I might need this on an issue on gitmoji-changelog, since I want to use it on a website). Do you have some articles about it? Maybe a library you had in mind?

Collapse
 
tomekbuszewski profile image
Tomasz Buszewski

I am such a fan of Signale and Prompts. I love how simple, yet effective they are.

Collapse
 
terkelg profile image
Terkel Gjervig

Prompts is also a fan of you ๐ŸŽ‰

Collapse
 
millette profile image
Robin Millette
Collapse
 
djhi profile image
Gildas Garcia

Used it with pastel for several CLIs. Really nice :)

Collapse
 
fedekau profile image
Federico Kauffman • Edited

Nice write up! I didn't know about some of those packages.

If you are in the process of building NodeJS CLIs you definitely should check Oclif from Heroku, I wrote a post with an example some time ago here dev.to/fedekau/building-awesome-cl...

Collapse
 
vocab_king profile image
WhistlerIAM

How about OCLIF? Have you thought of Oclif.io?

Collapse
 
yvonnickfrin profile image
๐Ÿฆ Yvonnick FRIN

Didn't know this project, thank you for sharing ๐Ÿ™

Collapse
 
angelorubin profile image
angelo rogerio rubin

The gluegun framework is also incredible.
infinitered.github.io/gluegun

Collapse
 
steeve profile image
Steeve • Edited

Thanks for this article! I have to try everything ๐Ÿ˜

Collapse
 
yvonnickfrin profile image
๐Ÿฆ Yvonnick FRIN

Thank you ๐Ÿ˜

Collapse
 
terkelg profile image
Terkel Gjervig

Author of Prompts here! Thank you for featuring the prompts library โค๏ธ

Collapse
 
yvonnickfrin profile image
๐Ÿฆ Yvonnick FRIN

Thank you for your awesome work ๐Ÿ™

Collapse
 
beaussart profile image
Nicolas Beaussart

I've used gluegun to create a CLI, it's quite nice and have a lot of functionality out of the box, worth checking it out!

Collapse
 
evanhalley profile image
Evan

Nice! I've used command-line-args and command-line-usage in the past, but it looks likes yargs can replace those two. Awesome!

Collapse
 
room_js profile image
JavaScript Room

Commander.js seems to be another good option! github.com/tj/commander.js

Collapse
 
pacheco profile image
Thiago Pacheco

Very nice article!
I am going to try all of this for sure, thank you for sharing.

Collapse
 
therealarsam profile image
Arsam Sarabi

Commander is missing from the list ๐Ÿ˜

Collapse
 
yvonnickfrin profile image
๐Ÿฆ Yvonnick FRIN

Sorry, this is an opinionated list. I use yargs for this purpose ๐Ÿ˜‰

Collapse
 
jamesgeorge007 profile image
James George

ASCIIFIED banners can be a great addition to your CLI utilities bringing about stunning looks.

Check out node-banner

Collapse
 
yvonnickfrin profile image
๐Ÿฆ Yvonnick FRIN

Awesome!

Collapse
 
keivansf profile image
Keivan

Thanks a lot