Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Encapsulated commands for managing configuration in flatiron CLI apps
Latest commit aa3e124 @jcrugzz jcrugzz [dist] Version bump. 0.1.5


Encapsulated commands for managing configuration in flatiron CLI apps


At its core flatiron-cli-config is a broadway-compatible plugin which can be used by any flatiron application:

  var flatiron = require('flatiron'),
      app =;

  // Configure the Application to be a CLI app with
  // a JSON configuration file `test-config.json`
  // = 'app.js';
  app.config.file({ file: 'test-config.json' });
  app.use(flatiron.plugins.cli, {
    usage: 'A simple CLI app using flatiron-cli-config'

  // Expose CLI commands using `flatiron-cli-config`

  if (!module.parent) {
    // Start the application

If you run the above script:

  $ node app.js config set foo bar
  $ node app.js config get foo

The output will be:

  data: foo bar

And the contents of test-config.json will be:

  { "foo": "bar" }

API Documentation

Commands exposed

  $ node examples/app.js help config
  help:   `app.js config *` commands allow you to edit your
  help:   local app.js configuration file. Valid commands are:
  help:   app.js config list
  help:   app.js config set    <key> <value>
  help:   app.js config get    <key>
  help:   app.js config delete <key>


    // Name of the store in `app.config` to use for `config list`. [Default: all config]
    store: 'file'

    // Set of properties which cannot be deleted using `config delete <key>`
    restricted: ['foo', 'bar'],

    // Set of functions which will execute before named commands: get, set, list, delete
    before: { list: function () { ... } }


Installing npm (node package manager)

  curl | sh

Installing flatiron-cli-config

  [sudo] npm install flatiron-cli-config

Run Tests

Tests are written in vows and give complete coverage of all APIs and storage engines.

  $ npm test

Author: Charlie Robbins

License: MIT

Something went wrong with that request. Please try again.