local/tools
data / Native app / v1.0.4

YAML JSON Query

Query and edit YAML, JSON, XML, TOML and INI with yq expressions and apply RFC 6902 JSON Patch, keeping comments.

Install

  • install
    irm https://raw.githubusercontent.com/chayprabs/localtools/main/yaml-json-query/install.ps1 | iex
  • update
    localtools-yaml-json-query update
  • remove
    localtools-yaml-json-query uninstall

Opens at http://127.0.0.1:47110 in your browser. Run localtools-yaml-json-query --help for the command line. Set LOCALTOOLS_NO_OPEN=1 to install without opening it.

Direct download

PlatformFileSize
Linux ARM64yaml-json-query-1.0.4-linux-arm64.zip5.9 MB
Linux x64yaml-json-query-1.0.4-linux-x64.zip6.5 MB
macOS Apple Siliconyaml-json-query-1.0.4-macos-arm64.zip6.0 MB
macOS Intelyaml-json-query-1.0.4-macos-x64.zip6.5 MB
Windows x64yaml-json-query-1.0.4-windows-x64.zip6.6 MB

SHA-256 checksums are in the release notes; the install scripts verify them for you.

See it

How to use

  1. Paste YAML, JSON, TOML, XML, INI, CSV or .properties, or drop the file.
  2. Query mode: write a yq expression such as .spec.template.spec.containers[].image, or .version = "2.0" to edit. Use . with another output format to convert.
  3. Patch mode: paste an RFC 6902 JSON Patch (array) or an RFC 7386 merge patch (object).
  4. Press Run (Ctrl+Enter); copy or download the result. From a terminal: localtools-yaml-json-query eval|convert|patch.

FAQ

Are YAML comments kept when I edit or patch a file?

Yes. Expressions and patches work on yq's node tree, so comments, anchors, aliases, quoting and key order survive. Blank lines are not preserved (a yq limitation).

Which query syntax does it use?

yq's jq-style syntax by default (select, map, del, with_entries, multi-document selection and more). JMESPath is also available for read-only queries.

Why does a patch refuse to change a path under an alias?

The value is shared through a YAML anchor; changing it there would silently change every other place that uses the anchor. Patch the anchor itself instead.

How do I patch the second document of a multi-document YAML file?

Set the YAML document number to 1 in the UI, or pass --doc 1 on the command line. The other documents are written back unchanged.

Does my data leave my computer?

No. Everything runs in the local executable on 127.0.0.1; the page loads nothing from the network.