Skip to content

Latest commit

 

History

History
1043 lines (645 loc) · 33.5 KB

CHANGELOG.md

File metadata and controls

1043 lines (645 loc) · 33.5 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Added

  • New plain output format for writing a scalar as an unquoted string, e.g. dasel -i json -o plain 'name' prints world rather than "world". Maps and slices have no plain representation and are rejected with an error. Output only - there is no plain reader, since plain text carries no structure. Multi-document input writes one value per line.

Changed

  • Updated github.com/pelletier/go-toml/v2 to v2.4.3, which includes the fixes from GHSA-frc4-6h9q-39fq (#550).
  • Upgrade go-yaml from rc.3 to rc.7.

Fixed

  • The TOML writer no longer drops or renames top-level keys that need quoting. Keys such as -, a,b, q"x and the empty key were skipped, truncated at the comma, cut at the quote or renamed to F<n>, e.g. {"-":1,"a,b":2} was written as a = 2.
  • The JSON writer no longer escapes <, > and & as \u003c, \u003e and \u0026. That escaping is only needed when embedding JSON in HTML, so e.g. dasel -i toml -o json now emits "setuptools>=77.0.3" rather than "setuptools\u003e=77.0.3" (#552). The previous behaviour can be restored with the json-escape=html write flag.
  • The TOML writer no longer relies on go-toml encoding a bare value as a document root, which go-toml v2.4 rejects. Selecting a scalar or list and writing it as TOML (e.g. dasel -i json -o toml 'hello') works again.
  • Writing a list of tables as the top level value now emits a valid inline array of tables (e.g. [{a = 1}, {a = 2}]) instead of table headers with an empty key.
  • The JSON reader accepts numbers written in exponent notation without a fraction, e.g. 1e3 or 1E-2. These are valid JSON but the reader only treated a number as a float when it contained a ., so it tried to parse the exponent form as an integer and failed with strconv.ParseInt: invalid syntax.
  • A multi-byte csv-delimiter is decoded as a rune rather than a byte. --rw-flag csv-delimiter=§ used to take the first byte of the encoding, so nothing split on read and the write side emitted a mangled separator. A delimiter that isn't exactly one character is now rejected instead of silently truncated.

Security

  • Fixed stack overflow (unrecoverable fatal error) in the KDL reader when parsing deeply nested children blocks (GHSA-v72w-jh9m-fv4r). The KDL parser is mutually recursive over children blocks (parseDocument -> parseNode -> parseNodeEntries -> parseDocument) and was missed when the JSON and XML readers gained depth caps. It now enforces the same 10,000-level nesting limit and returns a clean error (ErrKDLMaxDepthExceeded) instead of crashing the process. Both recursion sites are covered, including the slashdashed (/-{ }) children block.

v3.11.2 - 2026-06-27

Security

  • Fixed panic (index out of range) in the selector lexer when the input ends with whitespace, e.g. dasel query 'a ' (GHSA-65gg-g7rw-6cpc). The whitespace-skip loop could advance the position to the end of input, after which the next character access had no bounds check.

v3.11.1 - 2026-06-20

Security

  • Fixed stack overflow (unrecoverable fatal error) in the JSON and XML readers when parsing deeply nested input (GHSA-cqxr-jxr2-85pq). Both readers now enforce a 10,000-level nesting depth limit and return a clean error (ErrJSONMaxDepthExceeded / ErrXMLMaxDepthExceeded) instead of crashing the process.

v3.11.0 - 2026-05-19

Added

  • Support for newline-delimited JSON (NDJSON) input. Multiple JSON values in a single input are now parsed as a multi-document branch, matching the existing YAML multi-document behaviour.

Fixed

  • Strip leading "v" from version output for consistency across build methods (Docker vs Homebrew).

v3.10.1 - 2026-05-13

Fixed

  • Fixed a non-terminating loop in the selector lexer when tokenizing unterminated regex patterns (e.g. r/abc). The tokenizer now returns an error instead of looping indefinitely.
  • Fix panic when selector query contains a trailing backslash in a quoted string (GHSA-m5j3-4634-c2vq).

v3.10.0 - 2026-05-13

Added

  • KDL format support (-i kdl / -o kdl) for reading and writing KDL configuration files (#504). Supports both v1 and v2 syntax with automatic version detection. Output version is configurable via --write-flag kdl-version=1 or --write-flag kdl-version=2 (default).

v3.9.0 - 2026-05-13

Added

  • groupBy(expr) function to group array elements by a derived key expression, producing a map of key to matching elements.
  • reduce(expr, init, update) function for folding arrays into a single value using an accumulator ($acc).
  • mapValues(expr) function for transforming all values of a map/object while preserving keys.
  • $key variable available in all iteration expressions (filter, map, each, sortBy, groupBy, any, all, count, reduce, mapValues, search, recursive descent). Provides the current index (for slices) or key name (for maps).

v3.8.1 - 2026-04-30

v3.8.0 - 2026-04-26

Added

  • dasel completion <shell> subcommand to generate shell completion scripts for bash, zsh, fish, and powershell (#497).
  • dasel man subcommand to generate a man page (#497).

Fixed

  • YAML string quote style (double, single, literal, folded) is now preserved on round-trip (#452).

v3.7.0 - 2026-04-25

Changed

  • merge function now performs deep merge, recursively merging nested maps (#133).

v3.6.0 - 2026-04-25

Added

  • --compact flag for compact output (no indentation/newlines).

Changed

  • stringify function now produces compact output.

Fixed

  • Compact/pretty output support for JSON, TOML, YAML, and XML writers (#457).

v3.5.0 - 2026-04-25

Added

  • split function that splits a string by a separator into an array of strings.
  • toLower function that converts a string to lowercase.
  • toUpper function that converts a string to uppercase.
  • trim function that trims whitespace from both ends of a string.
  • trimPrefix function that trims a prefix from a string.
  • trimSuffix function that trims a suffix from a string.
  • startsWith function that checks if a string starts with a given prefix.
  • endsWith function that checks if a string ends with a given suffix.
  • indexOf function that returns the index of the first occurrence of a substring, or -1 if not found.
  • abs function that returns the absolute value of a number.
  • floor function that returns the largest integer less than or equal to the input.
  • ceil function that returns the smallest integer greater than or equal to the input.
  • round function that rounds a number to the nearest integer.
  • avg function that returns the average of the given numbers.
  • flatten function that flattens a nested array by one level.
  • unique function that removes duplicate values from an array.
  • first function that returns the first element of an array.
  • last function that returns the last element of an array.
  • values function that returns the values of a map as an array.
  • entries function that converts a map into an array of {key, value} objects.
  • fromEntries function that converts an array of {key, value} objects into a map.
  • toBool function that converts a value to a boolean.
  • any expression that returns true if any element in an array matches the predicate.
  • all expression that returns true if all elements in an array match the predicate.
  • count expression that counts the number of elements in an array that match the predicate.
  • stringify function that serializes a structured value into a format string (inverse of parse).
  • Ternary operator (condition ? then : else).

Fixed

  • Fixed a bug in YAML and TOML parsers that caused them to fail when parsing non-base10 numbers (e.g. hex, binary, octal).
  • Fixed a bug in the toInt function that caused it to fail when parsing non-base10 numbers (e.g. hex, binary, octal).
  • XML child element ordering now has more comprehensive round-trip handling. Thanks @takeokunn.
  • XML writer now validates element and attribute names per the XML 1.0 spec, returning a clear error for invalid names instead of producing malformed XML. Thanks @lawrence3699.

v3.4.1 - 2026-03-30

Fixed

  • Escape characters in query strings now work as expected, e.g. \n will be treated as a newline character instead of the literal string \n.
  • Fixed a typo in the <= token that could cause a display issue.

v3.4.0 - 2026-03-19

Added

  • keys func that returns the keys or indices of a node. See docs.

v3.3.2 - 2026-03-18

Fixed

  • Fixed a bug that caused the get function to return false instead of an error when doing an invalid lookup.
  • Fixed an issue with reading/writing null values in YAML.
  • Fixed a nil pointer dereference when reading/writing null YAML documents.
  • Fixed a security issue allowing unbounded YAML expansion. Thanks to @kq5y.

v3.3.1 - 2026-02-26

Fixed

  • Fixed query selector parsing issue that incorrectly parsed array accessors when they followed a filter or map call.

v3.3.0 - 2026-02-25

Added

  • replace function to replace occurrences of a substring in a string with another string. See docs.

v3.2.3 - 2026-02-23

Added

  • XML parser now preserves comments and processing instructions during round-trip (#175).

Fixed

  • Spread operator within array construction is now honoured.

v3.2.2 - 2026-02-13

Changed

  • Swapped to use goccy/go-json for improved performance. Thanks @imix
  • Updated model IsScalar internals to improve efficiency. Thanks @imix
  • General dependency updates.

Fixed

  • TOML parser sub table parsing. Thanks @pmeier

v3.2.1 - 2026-01-05

Fixed

  • XML parser now correctly handles empty CDATA.

v3.2.0 - 2025-12-26

Added

  • join function to join array elements into a single string with a specified separator. See docs.

v3.1.4 - 2025-12-18

Fixed

  • Select func in the exposed go API now correctly maps return values to the respective types.

v3.1.3 - 2025-12-18

Fixed

  • XML documents no longer create redundant root or item elements.
  • Dasel no longer loses value metadata when reading/writing to internal models.

v3.1.2 - 2025-12-17

Fixed

  • Fix XML reading/writing when XML processing instructions are present.

v3.1.1 - 2025-12-16

Fixed

  • Homebrew release.

v3.1.0 - 2025-12-16

Added

  • sum function to sum numeric values in an array. See docs.

v3.0.0 - 2025-12-15

Added

  • Major new version release.
  • INI support.
  • HCL support.
  • Dasel syntax now supports variables and expressions.
  • Files can now be read and parsed inside a dasel query.
  • Variables can now be passed to dasel from the command line.
  • Support for comments in queries.
  • Dasel config file to define default file format.
  • Interactive mode for dasel CLI (alpha).

Changed

  • Go module path changed to github.com/tomwright/dasel/v3.
  • Internal changes to support new version.
  • Query/selector syntax revamp. See docs for more information.
  • Majority of read/write operations will now maintain ordering.
  • Migrated from Cobra to Kong for CLI parsing/processing.
  • Removed put and delete commands. Instead, modify within the query and use --root flag.

Fixed

  • File redirect now works in the same way as piped input.
  • Various other bug fixes and improvements.
  • Whitespace in query syntax is now handled correctly.

v2.8.1 - 2024-06-30

Fixed

  • Fixed a bug related to yaml aliases.

v2.8.0 - 2024-06-28

Fixed

  • Fixed a bug that could cause a panic.
  • type() now returns null instead of unknown for null values.
  • Added YAML support for merge tag/aliases. Thanks to pmeier. Issue 285.

v2.7.0 - 2024-03-14

Added

Fixed

  • Dasel now correctly handles null values.

v2.6.0 - 2024-02-15

Added

  • Support for --indent flag.
  • More descriptive errors when dasel fails to open a file.

Changed

  • Docker build improvements in workflows.

v2.5.0 - 2023-11-28

Added

  • Add man that generates manpages for all dasel subcommands.

Fixed

v2.4.1 - 2023-10-18

Fixed

  • JSON output now acts as expected regarding the EscapeHTML flag.

v2.4.0 - 2023-10-18

Added

  • orDefault() function. See docs
  • --csv-comma flag to change the csv separator.
  • --csv-write-comma flag to change the csv separator specifically for writes.
  • --csv-comment flag to change the csv comment character.
  • --csv-crlf flag to enable or disable CRLF output when working with csv files.

Fixed

  • Resolved an issue with YAML parser that was causing strings to be read as booleans.
  • Fix a parsing issue with CSV types that forced you to expand and merge in order for it selects to work Issue 364.

v2.3.6 - 2023-08-30

Fixed

  • XML is now formatted correctly. (#354)

v2.3.5 - 2023-08-29

Changed

  • Small internal optimisation (#341)
  • Update to go 1.21
  • Upgrade dependencies

Fixed

  • Resolved an issue with YAML parser that was causing strings to be read as numbers.
  • Timestamps can now be resolved as expected in YAML.

v2.3.4 - 2023-06-01

Fixed

  • len function now works with new map type.
  • keys function now works with new map type.

v2.3.3 - 2023-05-31

Fixed

  • Errors when selecting data are now correctly handled.

v2.3.2 - 2023-05-31

Fixed

  • Restored previous octal, binary and hex number parsing support in YAML and put command.

v2.3.1 - 2023-05-29

Fixed

  • version command now outputs correct version information (only affected v2 onwards)

v2.3.0 - 2023-05-29

Changed

  • Maps are now ordered internally.
  • JSON and YAML maps maintain ordering on read/write.
  • all() func now works with strings.
  • index() func now works with strings.

Fixed

  • Multi-document output should now be displayed correctly.
  • Index shorthand selector now works with multiple indexes.
  • Null values are now correctly handled.

v2.2.0 - 2023-04-17

Added

  • keys() function.

v2.1.2 - 2023-03-27

Added

  • Join function.
  • String function.

Fixed

  • Null error caused by null values in arrays. See PR 307.

v2.1.1 - 2023-01-19

Fixed

  • Changed go module to github.com/tomwright/dasel/v3 to ensure it works correctly with go modules.

v2.1.0 - 2023-01-11

Added

  • Ability to jump to a parent x levels up with parent(x). Defaults to 1 level.

v2.0.2 - 2022-12-07

Fixed

  • Argument parsing issue that caused files to be written to the wrong place. See discussion 268.

v2.0.1 - 2022-12-07

Added

  • float type in put command.

Fixed

  • Output values are now correctly de-referenced. This fixed issues with encoded values not appearing correctly.
  • Escape characters in selector strings now work as expected.

v2.0.0 - 2022-12-02

See documentation for all changes.

  • Selector syntax

v1.27.3 - 2022-10-18

Fixed

  • The compact flag now works with the XML parser.

v1.27.2 - 2022-10-18

Fixed

  • Help text for select and delete commands now contain all available parsers.
  • Errors now implement the Is interface so they are easier to use from go.
  • Floats are now formatted in decimal format instead of scientific notification when writing to CSV (Issue 245, Issue 229)

v1.27.1 - 2022-09-28

Fixed

  • Improved selector comparison parsing to allow matching on values containing special characters.

v1.27.0 - 2022-09-26

Added

  • New value-file flag allows you to put values read from a file (Issue 246)

v1.26.1 - 2022-08-24

Fixed

  • Make the completion command available for use (Issue 216)
  • Make the __complete command available for use

v1.26.0 - 2022-07-09

Added

  • Search optional selector - (#:key=value)

v1.25.1 - 2022-06-29

Added

  • Pre-commit hooks for validate command.

v1.25.0 - 2022-06-26

Added

  • Support for struct type usage in go package.
  • Validate command.

v1.24.3 - 2022-04-23

Added

  • Gzip compressed binaries on releases.

v1.24.2 - 2022-04-22

Fixed

  • Update a package to avoid a High Vulnerability in golang.org/x/crypto with CVE ID CVE-2022-27191

v1.24.1 - 2022-03-28

Changed

  • storage package has been moved outside the internal package.

Fixed

  • New funcs added in v1.24.0 can now be used as expected since you can now access the storage.ReadWriteOption.

v1.24.0 - 2022-03-18

Added

  • Node.NewFromFile func to load a root node from a file.
  • Node.NewFromReader func to load a root node from an io.Reader.
  • Node.WriteToFile func to write results to a file.
  • Node.Write func to write results to an io.Writer.

v1.23.0 - 2022-03-10

Fixed

  • Update github.com/pelletier/go-toml to consume fix for #191.

Added

  • Sprig functions to output formatter template.

v1.22.1 - 2021-11-09

Fixed

  • Cleaned up error output

v1.22.0 - 2021-11-09

Added

  • Type selector [@].

Fixed

  • Errors are now written to stderr as expected.

v1.21.2 - 2021-10-21

Added

  • Linux arm32 build target.

v1.21.1 - 2021-09-30

Changed

  • --escape-html flag now defaults to false.

v1.21.0 - 2021-09-29

Added

  • --escape-html flag.

Fixed

  • put document and put object are now aware of the --merge-input-documents flag.

v1.20.1 - 2021-09-28

Added

  • buster-slim and alpine tags to built docker images.

Fixed

v1.20.0 - 2021-08-30

Added

Fixed

  • Fixed an issue in which unicode characters could cause issues when parsing selectors.

v1.19.0 - 2021-08-14

Added

  • --colour,--color flag to enable colourised output in select command.

v1.18.0 - 2021-08-11

Added

  • --format flag to select command.

v1.17.0 - 2021-08-08

Added

  • Support for != comparison operator in dynamic and search selectors.
  • Support for -/keyValue key in dynamic selectors.

v1.16.1 - 2021-08-02

Fixed

  • Fixed a bug that stopped the delete command editing files in place.

v1.16.0 - 2021-08-01

Added

  • Delete command.

v1.15.0 - 2021-05-06

Added

  • --merge-input-documents flag.

Changed

  • Optional noupdater build tag to disable the self-update command.

Fixed

  • Empty XML documents are now parsed correctly.

v1.14.1 - 2021-04-15

Added

  • arm64 build support.

v1.14.0 - 2021-04-11

Added

  • .[#] length selector.
  • > comparison operator.
  • >= comparison operator.
  • < comparison operator.
  • <= comparison operator.

v1.13.6 - 2021-03-29

Changed

  • Development versions of dasel will now include more specific version information where possible.

Fixed

  • Fix an issue that stopped dasel being able to output CSV documents when parsed from JSON.

v1.13.5 - 2021-03-22

Fixed

  • Empty map values are now initialised as map[string]interface{} rather than map[interface{}]interface{}.

v1.13.4 - 2021-03-11

Fixed

  • Empty document input is now treated different in select and put commands.

v1.13.3 - 2021-03-05

Fixed

  • Blank YAML and CSV input is now treated as an empty document.

Changed

  • Blank JSON input is now treated as an empty document.

v1.13.2 - 2021-02-25

Changed

  • Improved information provided in UnsupportedTypeForSelector errors.
  • Upgrade to go 1.16.

Fixed

  • Make sure the -n,--null flag has an effect in multi-select queries.

v1.13.1 - 2021-02-18

Fixed

  • Added CGO_ENABLED=0 build flag to ensure linux_amd64 builds are statically linked.

v1.13.0 - 2021-02-11

Added

  • --length flag to select command.

v1.12.2 - 2021-01-05

Fixed

  • Fix a bug that stopped the write parser being properly detected when writing to the input file.

v1.12.1 - 2021-01-05

Changed

  • Build workflows now updated to run on ubuntu-latest and use a matrix to build assets for linux, darwin and windows for both amd64 and 386.

Fixed

  • Release asset for macos/darwin is now named dasel_darwin_amd64 instead of dasel_macos_amd64.
  • Self-updater now identifies dev version as development.

v1.12.0 - 2021-01-02

Added

  • Add -c, --compact flag to remove pretty-print formatting from JSON output.
  • Defined storage.IndentOption(indent string) ReadWriteOption.
  • Defined storage.PrettyPrintOption(enabled bool) ReadWriteOption.

Changed

  • Changed storage.Parser funcs to allow the passing of ...ReadWriteOption.

v1.11.0 - 2020-12-22

Added

  • Benchmark info now contains graphs.
  • update command to self-update dasel.

Changed

  • Benchmark info now directly compares dasel, jq and yq.

v1.10.0 - 2020-12-19

Added

  • Add dasel put document command.
  • Benchmark information.

Fixed

  • -r,--read and -w,--write flags are now used in dasel put object.
  • Fix issues that occurred when writing to the root node.

Changed

  • Command names and descriptions.

v1.9.1 - 2020-12-12

Fixed

  • Stopped parsing XML entities in strings.

v1.9.0 - 2020-12-12

Added

  • Add keys/index selector in multi queries.
  • Add -n,--null flag.

v1.8.0 - 2020-12-01

Added

  • Add ability to use ANY_INDEX ([*]) and DYNAMIC ((x=y)) selectors on maps/objects.

v1.7.0 - 2020-11-30

Added

  • Add -r,--read and -w,--write flags to specifically choose input/output parsers. This allows you to convert data between formats.

v1.6.2 - 2020-11-18

Added

  • Add support for multi-document JSON files.

v1.6.1 - 2020-11-17

Changed

  • Remove some validation on dasel put object to allow you to put empty objects.

v1.6.0 - 2020-11-17

Added

  • Add search selector to allow recursive searching from the current node.

v1.5.1 - 2020-11-14

Fixed

  • Fixed an issue that stopped new values being saved.

v1.5.0 - 2020-11-12

Added

  • Add ability to use \ as an escape character in selectors.

v1.4.1 - 2020-11-11

Fixed

  • Fix an issue when parsing dynamic selectors.

v1.4.0 - 2020-11-08

Added

  • Add -m,--multiple flag to deal with multi-value queries.
  • Add ANY_INDEX or [*] selector.
  • Add NextMultiple property to the Node struct - this is used when processing multi-value queries.
  • Add Node.QueryMultiple func.
  • Add Node.PutMultiple func.

v1.3.0 - 2020-11-08

Added

  • Add support for CSV files.

[v1.2.0] - 2020-11-07

Added

  • Add support for multi-document YAML files.
  • Add CodeQL step in github actions.

Changed

  • Docker image is now pushed to ghcr instead of github packages.

v1.1.0 - 2020-11-01

Added

  • Add sub-selector support in dynamic selectors.

v1.0.4 - 2020-10-30

Added

  • Add --plain flag to tell dasel to output un-formatted values.

v1.0.3 - 2020-10-29

Changed

  • Command output is now followed by a newline.

v1.0.2 - 2020-10-28

Added

  • Docker image is now built and pushed when a new release is tagged.

v1.0.1 - 2020-10-28

Added

  • Add support for XML.

Changed

  • Add - as an alias for stdin/stdout in --file and --output flags.
  • Selector can now be given as the first argument making the flag itself optional.
  • select is now the default command.

v1.0.0 - 2020-10-27

Added

  • Add lots of tests.
  • Add docs.
  • Got accepted to go-awesome.

v0.0.5 - 2020-09-27

Added

  • Add support for TOML.

v0.0.4 - 2020-09-27

Added

  • Ability to check against the node value in a dynamic selector.
  • Code coverage.

Changed

  • Use reflection instead of fixed type checks.

v0.0.3 - 2020-09-24

Changed

  • Use reflection instead of fixed type checks.
  • Extract commands into their own functions to make them testable.

v0.0.2 - 2020-09-23

Added

  • Add ability to pipe data in/out of dasel.
  • Add dasel put command.

v0.0.1 - 2020-09-22

Added

  • Everything!