SYNOPSIS

dnk [options] get key
dnk [options] set key value key value ...

Set or get values from a structured data object.

 # set a value in a JSON file (output to STDOUT)
 dnk -i my-config.json set config.password foo

 # set a value in a JSON file (in replace file) 
 dnk -b bak -i my-config.json set config.password foo

 # pretty print a JSON file
 cat policy.json | dnk get .

 # retrieve a value from a JSON file
 cat alb-listener-rule.json | dnk get .ListenerArn

OPTIONS

--help, -h                this help message
--error-on-undefined, -u  throws an exception if the result of the expression is undefined 
--infile, -i              input file
--format, -f              xml, json, yml (default: input format)
--replace, -r             replace file
--backup, -b              backup extension, make a backup of the file before replacing

Notes

1. Input format is determined by trying various deserializers (json, yml)
2. You can set multiple values on the command line
3. --backup implies --replace

Example:

dnk -i infile.json set foo.bar buz foo.buz bar

dnk -i infile.json -b bak set foo.bar buz