- simple cli interface for sindresorhus/conf
- oclif plugin that adds a
confcommand that lets you manage state/configuration between commands- standalone key/value store
npm install -g conf-cli
manage configuration
USAGE
$ conf [KEY] [VALUE]
ARGUMENTS
KEY key of the config
VALUE value of the config
OPTIONS
-d, --cwd=cwd config file location
-d, --delete delete?
-h, --help show CLI help
-k, --key=key key of the config
-n, --name=name config file name
-p, --project=project project name
-v, --value=value value of the config
- if [VALUE] is not provided, value of the key is printed
- if [KEY] and [VALUE] is not provided, all the keys will be printed
See code: src\commands\conf.ts
as sindresorhus/conf cli interface
use sindresorhus/conf in your app
// simple-example/index.jsconstConf=require('conf');constconfig=newConf();console.log(`hello ${config.get('name')}!`);use conf-cli to update name property from outside the app.
--project/-p flag sets the target project (package name).
$ conf name world -p simple-examplesee it affect simple-example
$ node simple-example/index.jshello world!as an oclif plugin
create a new oclif project
$ oclif multi oclif-exampleinstall conf-cli
$ npm install --save conf-cliadd to oclif plugins in package.json
"oclif": {"plugins": ["conf-cli"]},$ oclif-exampleVERSION oclif-example/0.0.0 win32-x64 node-v8.9.1USAGE $ oclif-example [COMMAND]COMMANDS conf manage configuration <=========== yahoo! ;) hello Describe the command here help display help for oclif-exampleWhen used as a plugin, -p will default to the parent cli package name.
$ oclif-example conf name daenarys
$ oclif-example hellohello daenarys!
$ conf -p oclif-example namedaenarys//src/commands/hello.jsclassHelloCommandextendsCommand{asyncrun(){this.log(`hello ${config.get('name')}!`);}}$ conf hello jonsnow
$ conf hi varys
$ conf hellojonsnow
$ conf hivarys
$ confhellohi