Use yargs npm project for the command line

I took some time to study some cli npm packages. We did many hacks and tricks to adopt commander.js and I think we should move to yargs (https://github.com/yargs/yargs). It seems promising and it is quite active.

Pro:

  • It has support for sub commands
  • We can have one file for each command or sub-command
  • it has support for alias

Cons:

  • It has not native support yarn help, but it has native support for yarn --help/-h
  • For some command we still can’t force some flags (like we do for the global commands), but maybe we can resolved this with https://github.com/yargs/yargs#coerce.

Do someone see any other reasons why we should not move to this? Please let me know 🙂

Author: Fantashit

1 thought on “Use yargs npm project for the command line

Comments are closed.