Skip to content

caviarjs/caviar-cli

Repository files navigation

Build Status Coverage

@caviar/cli

Caviar cli tool

Install

$ npm i -g @caviar/cli

Usage

> caviar --preset /path/to/preset.js --configFile /path/to/config.js

CLI options

Options required default value type description
--cwd NO process.cwd() path specify the working directory
--dev, --no-dev NO false boolean whether in dev mode
--sandbox, --no-sandbox NO false boolean whether use sandbox or not
--phase NO 'default' string what kind of phase should caviar run as
--preset Depends - path the javascript file path of the caviar preset
--configFile Depends - path the javascript file path of the caviar config

At least one of preset and configFile should be specified.

Use caviar.config.js to simply the cli options

If a --caviar.config option has been specified,

caviar.config.js

module.exports = {
  preset: '@my/caviar-layer',
  configFile: require.resolve('./config')
}

argv options > phase options (caviar.config) > profile options (caviar.config)

> caviar

For details,

> caviar --help

Create your own caviar cli with default profile settings

bin.js

#!/usr/bin/env node

const {Command} = require('@caviar/cli')

new Command({
  defaultCaviarConfig: '/path/to/default/caviar.config.js'
}).start()

License

MIT