conf-cli
simple cli for configuration and key/value's
Last updated 4 months ago by natzcam .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install conf-cli 
SYNC missed versions from official npm registry.

conf-cli

  • simple cli interface for sindresorhus/conf
  • oclif plugin that adds a conf command that lets you manage state/configuration between commands
  • standalone key/value store

oclif Version Downloads/week License

Install

npm install -g conf-cli

conf [KEY] [VALUE]

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

Usage

as sindresorhus/conf cli interface

use sindresorhus/conf in your app

// simple-example/index.js
const Conf = require('conf');
const config = new Conf();
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-example

see it affect simple-example

$ node simple-example/index.js
hello world!

as an oclif plugin

create a new oclif project

$ oclif multi oclif-example

install conf-cli

$ npm install --save conf-cli

add to oclif plugins in package.json

 "oclif": {
    "plugins": [
      "conf-cli"
    ]
  },
$ oclif-example
VERSION
  oclif-example/0.0.0 win32-x64 node-v8.9.1

USAGE
  $ oclif-example [COMMAND]

COMMANDS
  conf   manage configuration <=========== yahoo! ;)
  hello  Describe the command here
  help   display help for oclif-example

When used as a plugin, -p will default to the parent cli package name.

$ oclif-example conf name daenarys
$ oclif-example hello
hello daenarys!
$ conf -p oclif-example name
daenarys
//src/commands/hello.js
class HelloCommand extends Command {
  async run() {
    this.log(`hello ${config.get('name')}!`);
  }
}

as a standalone key/value store

$ conf hello jonsnow
$ conf hi varys
$ conf hello
jonsnow
$ conf hi
varys
$ conf
hello
hi

Examples

here

Current Tags

  • 0.1.8                                ...           latest (4 months ago)

15 Versions

  • 0.1.8                                ...           4 months ago
  • 0.1.7                                ...           4 months ago
  • 0.1.6                                ...           6 months ago
  • 0.1.5                                ...           6 months ago
  • 0.1.4                                ...           6 months ago
  • 0.1.3                                ...           6 months ago
  • 0.1.2                                ...           6 months ago
  • 0.1.1                                ...           6 months ago
  • 0.1.0                                ...           6 months ago
  • 0.0.7                                ...           6 months ago
  • 0.0.6                                ...           7 months ago
  • 0.0.5                                ...           7 months ago
  • 0.0.3                                ...           7 months ago
  • 0.0.2                                ...           7 months ago
  • 0.0.1                                ...           7 months ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 3
Last Day 0
Last Week 0
Last Month 47
Dependencies (5)
Dev Dependencies (14)

Copyright 2014 - 2016 © taobao.org |