Caviar cli tool
$ npm i -g @caviar/cli
> 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.
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
bin.js
#!/usr/bin/env node
const {Command} = require('@caviar/cli')
new Command({
defaultCaviarConfig: '/path/to/default/caviar.config.js'
}).start()