D
D
Dasel
v2
Search
K

Put

The put command allows you to modify data in any supported data structure.

Usage

$ echo '{"name":{"first":"Tom","last":"Wright"}}' |
dasel put -r json -t string -v Frank 'name.first'
{
"name": {
"first": "Frank",
"last": "Wright"
}
}
See the function documentation for information on the available selectors.

Flags/Args

Flag
Type
Description
Default
--colour
bool
Print colourised output.
false
--escape-html
bool
Escape HTML tags when writing output.
false
-f, --file
string
The file to query. If no file is given dasel reads from stdin.
-o, --out
string
The file to write results to. If no file is given dasel writes to --file. If --file is stdin, dasel writes to stdout.
--pretty
bool
Pretty print the output.
true
-r, --read
string
The parser to use when reading. If no parser is given dasel attempts to find a parser from the --file flag.
-s, --selector
string
The selector used to query the input data. If no flag is given dasel attempts to use the first argument as the selector.
-t, --type
string
The type of value we are writing. Can be string, int or bool. If it is not contained in that list dasel attempts to find a read parser of --type and if found will read the input value as a document.
-v, --value
string
The value to write. This must be a string input but dasel will parse/convert the value to the given --type internally.
-w, --write
string
The parser to use when writing. If no parser is given dasel attempts to find a parser from the --out flag. If no --out flag is given dasel uses the --read flag.