A dead simple command line interface for managing remote configuration. Powered by etcd, inspired by heroku.
renv gives you:
- a heroku-inspired interface (
set
,unset
). - tools for managing your environment using JSON configuration files (
import
).
npm install renv -g
renv prefixes the configuration it stores with /:application/:environment
, where:
application
: is the application that you wish to store configuration for. (it tries to grab this out of a package.json).environment
: is the environment to store the configuration for, e.g.,development
,production
,test
.
this is opinionated, but it works dang it!
rather than serializing JSON to a single key, renv uses directories in
etcd
to store a representation of the imported JSON file.
This is cool because:
- you can listen for changes on individual keys.
- you can modify keys atomically.
Use a .renvrc to store information about your production etcd host:
hosts=etcd.example.com:443
ssl=true
List all configuration for a given application
, and environment
.
Use --output json
, to dump the configuration to disk:
renv config --environment production --output json > service.json
.
Set a single configuration variable:
renv set URL=http://www.example.com
Set multiple configuration variables:
renv set URL=http://www.example.com TIMEOUT=5000
Creating or updating an object:
renv set OBJ.x 33 OBJ.y 99
Creating or updating an array:
renv set ARR.0 33 ARR.1 99
Delete a single configuration variable:
renv unset OBJ
Delete multiple configuration variables:
renv unset OBJ ARR
Import a JSON file and create keys and directories recursively.
renv import ./test/fixtures/service.json
nuke all configuration for the current application
and environment
Danger, Will Robinson.
renv nuke
Dump configuration for all applications and environments:
renv dump
Merge two configuration environments, useful if production servers only vary slightly.
renv merge --application2 production-server-east