kv
is a tiny CLI tool for getting and setting key value pairs from Consul
go get -v github.com/deepthawtz/kv
create a $HOME/.kv.yaml
file
---
consul:
host: myconsulhost.somewhere.com
scheme: https
get ALL key/value pairs at a given key prefix
kv get --prefix env/myapp/stage
get specific key/value pair(s) at a given key prefix
kv get --prefix env/myapp/stage THING_TOKEN
get key/value pair(s) matching pattern at a given key prefix
kv get --prefix env/myapp/stage THING_*
set provided key/value pair(s) at a given prefix (NOTE: in Consul 0.7 this can be performed in a single transaction)
kv set --prefix env/myapp/stage YO=123 THING_TOKEN=xcnvbxcmhdf COOL_FACTOR=9000
delete provided key(s) at a given prefix (NOTE: in Consul 0.7 this can be performed in a single transaction)
kv del --prefix env/myapp/stage YO THING_TOKEN COOL_FACTOR