Query
Select, filter, map, reduce, and combine values across files and YAML documents.
Release v1.17.0 · one readable executable
Query, transform, validate, and edit YAML with one portable sh + awk file. It has no business working this well.
1books:
2 - title: Piranesi
3 read: true
4 - title: Dune
5 read: false
6 - title: Kindred
7 read: true
Built for the whole job
Run expressions over YAML structure, preview the result, and write it back without needlessly reformatting the file.
Select, filter, map, reduce, and combine values across files and YAML documents.
Build, update, delete, validate, patch, and convert while YAML types and relationships stay intact.
Check or diff first. Write only when ready, and require preservation when formatting must stay put.
Small command. Deep YAML.
Combine two YAML files with one expression.
$ ysh ea 'select(fileIndex == 0) * select(fileIndex == 1)' defaults.yml production.yml
{"replicas":3,"region":"west"}
Validate a file, apply a standard patch, and preview the result.
$ ysh --schema deploy.schema.json --apply-patch promote.json --diff deploy.yml
--- a/deploy.yml
+++ b/deploy.yml
@@ -4 +4 @@
- tag: old
+ tag: stable
Preview exactly what will change. Keep the comments. Then write.
$ ysh --preserve-only --diff '.image.tag = "stable"' services/api.yml
--- a/services/api.yml
+++ b/services/api.yml
@@ -3,1 +3,1 @@
- tag: old # keep this comment
+ tag: stable # keep this comment
Open the hood whenever the YAML gets weird.
$ ysh --type '.release.date' config.yml
timestamp
$ ysh --ast config.yml
node 1 mapping line=1
01 / PORTABLE
Query with /bin/sh and AWK. Check and write with ordinary host file utilities. No extra language runtime required.
02 / PRECISE
Use .["key.with.dots"] when punctuation belongs to the YAML—not the query.
03 / DOCUMENTED
See the supported YAML syntax, query language, schema profile, patches, formats, and security limits.
See YAML support04 / HACKABLE
The shipped executable contains the complete shell launcher and AWK engine. Read it, copy it, bend it.
05 / CAREFUL
Common scalar, collection, block, comment, and reorder edits leave unrelated text alone. --preserve-only refuses the rest.
Field note · August 2026
An old Bash experiment grew into one improbably capable shell file in one increasingly unreasonable day. This is how the constraint shaped the tool, and what building it with Codex made possible.
Read the storyInstall the current release
The installer downloads and checksum-verifies a pinned release, then places ysh in /usr/local/bin. Set YSH_INSTALL_DIR to choose another location.
curl -fsSL https://yaml.azohra.com/install | sh
Homebrew: brew install azohra/tools/ysh
Prefer to inspect first? Read the installer source.