yq
brew install yq
v4.53.3
MIT
CLI tool for querying, parsing, and transforming YAML, JSON, XML, CSV, and other structured formats using jq-like syntax; written in Go.
Why you might care
Drop-in replacement for shell pipelines that need to manipulate YAML or JSON: supports update-in-place, streaming, and jq-compatible syntax with a single statically-linked binary. Covers more formats than jq alone (YAML, XML, CSV, properties, HCL, TOML) making it indispensable in DevOps and IaC tooling where YAML is ubiquitous. Fast and portable across Linux, macOS, Windows without runtime dependencies.
53.4k
30-day installs · #118
168.1k
90-day · #125
602.2k
365-day · #115
15.6k
★ GitHub stars · updated 3d ago
Build dependencies
GitHub topics
bash
cli
csv
devops-tools
golang
hcl
json
portable
properties
splat
terraform
toml
xml
yaml
yaml-processor
Links
- https://github.com/mikefarah/yq
- GitHub: mikefarah/yq
- Brew formula source: Formula/y/yq.rb
Blurb generated by claude-haiku-4-5 on today.
Raw metadata
{
"aliases": [],
"alternatives": [
"jq",
"yji",
"ymlpath",
"jyaml"
],
"build_dependencies": [
"go",
"pandoc"
],
"categories": [
"yaml-tool",
"json-tool",
"text-processor",
"cli"
],
"caveats": null,
"conflicts_with": [
"python-yq"
],
"dependencies": [],
"deprecated": 0,
"deprecation_reason": null,
"desc": "Process YAML, JSON, XML, CSV and properties documents from the CLI",
"disable_reason": null,
"disabled": 0,
"enrichment_fetched_at": "2026-06-20T23:40:40+00:00",
"first_seen": "2026-06-20T23:34:18+00:00",
"full_name": "yq",
"github_default_branch": "master",
"github_last_commit_at": "2026-06-18T03:52:27Z",
"github_readme_excerpt": "# yq\n\n    \n\n\nA lightweight and portable command-line YAML, JSON, INI and XML processor. `yq` uses [jq](https://github.com/stedolan/jq) (a popular JSON processor) like syntax but works with yaml files as well as json, kyaml, xml, ini, properties, csv and tsv. It doesn\u0027t yet support everything `jq` does - but it does support the most common operations and functions, and more is being added continuously.\n\nyq is written in Go - so you can download a dependency free binary for your platform and you are good to go! If you prefer there are a variety of package managers that can be used as well as Docker and Podman, all listed below.\n\n## Quick Usage Guide\n\n### Basic Operations\n\n**Read a value:**\n```bash\nyq \u0027.a.b[0].c\u0027 file.yaml\n```\n\n**Pipe from STDIN:**\n```bash\nyq \u0027.a.b[0].c\u0027 \u003c file.yaml\n```\n\n**Update a yaml file in place:**\n```bash\nyq -i \u0027.a.b[0].c = \"cool\"\u0027 file.yaml\n```\n\n**Update using environment variables:**\n```bash\nNAME=mike yq -i \u0027.a.b[0].c = strenv(NAME)\u0027 file.yaml\n```\n\n### Advanced Operations\n\n**Merge multiple files:**\n```bash\n# merge two files\nyq -n \u0027load(\"file1.yaml\") * load(\"file2.yaml\")\u0027\n\n# merge using globs (note: `ea` evaluates all files at once instead of in sequence)\nyq ea \u0027. as $item ireduce ({}; . * $item )\u0027 path/to/*.yml\n```\n\n**Multiple updates to a yaml file:**\n```bash\nyq -i \u0027\n .a.b[0].c = \"cool\" |\n .x.y.z = \"foobar\" |\n .person.name = strenv(NAME)\n\u0027 file.yaml\n```\n\n**Find and update an item in an array:**\n```bash\n# Note: requires input file - add your file at the end\nyq -i \u0027(.[] | select(.name == \"foo\") | .address) = \"12 cat st\"\u0027 data.yaml\n```\n\n**Convert between formats:**\n```bash\n# Conver",
"github_repo": "mikefarah/yq",
"github_stars": 15572,
"github_topics": [
"bash",
"cli",
"csv",
"devops-tools",
"golang",
"hcl",
"json",
"portable",
"properties",
"splat",
"terraform",
"toml",
"xml",
"yaml",
"yaml-processor"
],
"homepage": "https://github.com/mikefarah/yq",
"homepage_og_description": null,
"homepage_og_image": null,
"homepage_title": null,
"installs_30d": 53360,
"installs_365d": 602156,
"installs_90d": 168108,
"keg_only": 0,
"keg_only_reason": null,
"last_seen": "2026-06-20T23:34:18+00:00",
"license": "MIT",
"llm_generated_at": "2026-06-20T23:42:51+00:00",
"llm_model": "claude-haiku-4-5",
"name": "yq",
"oldnames": [],
"one_liner": "CLI tool for querying, parsing, and transforming YAML, JSON, XML, CSV, and other structured formats using jq-like syntax; written in Go.",
"optional_dependencies": [],
"rank_30d": 118,
"rank_365d": 115,
"rank_90d": 125,
"raw_hash": "9726c7995b2816d2",
"recommended_dependencies": [],
"revision": 0,
"ruby_source_path": "Formula/y/yq.rb",
"tap": "homebrew/core",
"test_dependencies": [],
"uses_from_macos": [],
"version_head": "HEAD",
"version_stable": "4.53.3",
"versioned_formulae": [],
"why_use_this": "Drop-in replacement for shell pipelines that need to manipulate YAML or JSON: supports update-in-place, streaming, and jq-compatible syntax with a single statically-linked binary. Covers more formats than jq alone (YAML, XML, CSV, properties, HCL, TOML) making it indispensable in DevOps and IaC tooling where YAML is ubiquitous. Fast and portable across Linux, macOS, Windows without runtime dependencies."
}