cac

Simple yet powerful framework for building command-line apps.

MIT License

Stars
2.6K
Committers
29

Bot releases are hidden (Show)

cac - v6.0.1

Published by egoist almost 6 years ago

6.0.1 (2018-11-25)

Bug Fixes

cac - v6.0.0

Published by egoist almost 6 years ago

Many breaking changes, so it's a new major release. But you don't need to upgrade to v6 if it's unnecessary for you :P

New Features

Support brackets in arguments

i.e. it works like commander.js now:

const cli = require('cac')()

cli.command('build <entry> [...more]')
.option('--target [target]', 'Build target', { default: 'web' })
.action((entry, more, options) => {
	console.log(entry, more, options)
})

cli.parse()

Options now can be used before command

node cli.js build --minimize
# equals to
node cli.js --minimize build

Smaller size

13kB in total, compiled file is about 400 SLOC, only one single tiny dependency.

More

Check out README

Notable Breaking Changes

  • Unknown options are not allowed by default.
  • --help and --version are not added by default.