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
Tomek 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
 
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
 
angelorubin profile image
angelo rogerio rubin

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

Collapse
 
yvonnickfrin profile image
🦁 Yvonnick FRIN

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

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

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

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
 
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
 
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
 
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
 
arsamsarabi 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
 
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
 
keivansf profile image
Keivan

Thanks a lot