{"id":37096242,"url":"https://github.com/taigrr/yq","last_synced_at":"2026-01-14T11:51:14.371Z","repository":{"id":57519636,"uuid":"373252469","full_name":"taigrr/yq","owner":"taigrr","description":"yq is a portable command-line YAML processor","archived":false,"fork":true,"pushed_at":"2021-06-01T00:52:21.000Z","size":9383,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-15T13:56:43.670Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://mikefarah.gitbook.io/yq/","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"mikefarah/yq","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taigrr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"mikefarah"}},"created_at":"2021-06-02T17:33:52.000Z","updated_at":"2021-06-02T17:33:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/taigrr/yq","commit_stats":null,"previous_names":[],"tags_count":87,"template":false,"template_full_name":null,"purl":"pkg:github/taigrr/yq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taigrr%2Fyq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taigrr%2Fyq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taigrr%2Fyq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taigrr%2Fyq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taigrr","download_url":"https://codeload.github.com/taigrr/yq/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taigrr%2Fyq/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28419272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T11:51:13.611Z","updated_at":"2026-01-14T11:51:14.360Z","avatar_url":"https://github.com/taigrr.png","language":null,"funding_links":["https://github.com/sponsors/mikefarah"],"categories":[],"sub_categories":[],"readme":"# yq\n\n![Build](https://github.com/mikefarah/yq/workflows/Build/badge.svg)  ![Docker Pulls](https://img.shields.io/docker/pulls/mikefarah/yq.svg) ![Github Releases (by Release)](https://img.shields.io/github/downloads/mikefarah/yq/total.svg) ![Go Report](https://goreportcard.com/badge/github.com/mikefarah/yq)\n\n\na lightweight and portable command-line YAML processor. `yq` uses [jq](https://github.com/stedolan/jq) like syntax but works with yaml files as well as json. It doesn't 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, all listed below.\n\n## V4 released!\nV4 is now officially released, it's quite different from V3 (sorry for the migration), however it is much more similar to ```jq```, using a similar expression syntax and therefore support much more complex functionality! \n\nIf you've been using v3 and want/need to upgrade, checkout the [upgrade guide](https://mikefarah.gitbook.io/yq/v/v4.x/upgrading-from-v3).\n\nSupport for v3 will cease August 2021, until then, critical bug and security fixes will still get applied if required.\n\n## Install\n\n### [Download the latest binary](https://github.com/mikefarah/yq/releases/latest)\n\n### wget\nUse wget to download the pre-compiled binaries:\n\n#### Compressed via tar.gz\n```bash\nwget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY}.tar.gz -O - |\\\n  tar xz \u0026\u0026 mv ${BINARY} /usr/bin/yq\n```\n\n#### Plain binary\n\n```bash\nwget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY} -O /usr/bin/yq \u0026\u0026\\\n    chmod +x /usr/bin/yq\n```\n\nFor instance, VERSION=v4.2.0 and BINARY=yq_linux_amd64\n\n### MacOS / Linux via Homebrew:\nUsing [Homebrew](https://brew.sh/)\n```\nbrew install yq\n```\n\nor, for the (deprecated) v3 version:\n\n```\nbrew install yq@3\n```\n\nNote that for v3, as it is a versioned brew it will not add the `yq` command to your path automatically. Please follow the instructions given by brew upon installation.\n\n### Linux via snap:\n```\nsnap install yq\n```\n\nor, for the (deprecated) v3 version:\n\n```\nsnap install yq --channel=v3/stable\n```\n\n#### Snap notes\n`yq` installs with [_strict confinement_](https://docs.snapcraft.io/snap-confinement/6233) in snap, this means it doesn't have direct access to root files. To read root files you can:\n\n```\nsudo cat /etc/myfile | yq e '.a.path' - \n```\n\nAnd to write to a root file you can either use [sponge](https://linux.die.net/man/1/sponge):\n```\nsudo cat /etc/myfile | yq e '.a.path = \"value\"' - | sudo sponge /etc/myfile\n```\nor write to a temporary file:\n```\nsudo cat /etc/myfile | yq e '.a.path = \"value\"' | sudo tee /etc/myfile.tmp\nsudo mv /etc/myfile.tmp /etc/myfile\nrm /etc/myfile.tmp\n```\n\n### Run with Docker\n\n#### Oneshot use:\n\n```bash\ndocker run --rm -v \"${PWD}\":/workdir mikefarah/yq \u003ccommand\u003e [flags] [expression ]FILE...\n```\n\n#### Run commands interactively:\n\n```bash\ndocker run --rm -it -v \"${PWD}\":/workdir --entrypoint sh mikefarah/yq\n```\n\nIt can be useful to have a bash function to avoid typing the whole docker command:\n\n```bash\nyq() {\n  docker run --rm -i -v \"${PWD}\":/workdir mikefarah/yq \"$@\"\n}\n```\n\n### Go Get:\n```\nGO111MODULE=on go get github.com/mikefarah/yq/v4\n```\n\n## Community Supported Installation methods\nAs these are supported by the community :heart: - however, they may be out of date with the officially supported releases.\n\n# Webi\n\n```\nwebi yq\n```\n\nSee [webi](https://webinstall.dev/)\nSupported by @adithyasunil26 (https://github.com/webinstall/webi-installers/tree/master/yq)\n\n### Windows:\n[![Chocolatey](https://img.shields.io/chocolatey/v/yq.svg)](https://chocolatey.org/packages/yq)\n[![Chocolatey](https://img.shields.io/chocolatey/dt/yq.svg)](https://chocolatey.org/packages/yq)\n```\nchoco install yq\n```\nSupported by @chillum (https://chocolatey.org/packages/yq)\n\n### Mac:\nUsing [MacPorts](https://www.macports.org/)\n```\nsudo port selfupdate\nsudo port install yq\n```\nSupported by @herbygillot (https://ports.macports.org/maintainer/github/herbygillot)\n\n### Alpine Linux\n- Enable edge/community repo by adding ```$MIRROR/alpine/edge/community``` to ```/etc/apk/repositories```\n- Update database index with ```apk update```\n- Install yq with ```apk add yq```\n\nSupported by Tuan Hoang\nhttps://pkgs.alpinelinux.org/package/edge/community/x86/yq\n\n\n### On Ubuntu 16.04 or higher from Debian package:\n```sh\nsudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CC86BB64\nsudo add-apt-repository ppa:rmescandon/yq\nsudo apt update\nsudo apt install yq -y\n```\nSupported by @rmescandon (https://launchpad.net/~rmescandon/+archive/ubuntu/yq)\n\n## Features\n- [Detailed documentation with many examples](https://mikefarah.gitbook.io/yq/)\n- Written in portable go, so you can download a lovely dependency free binary\n- Uses similar syntax as `jq` but works with YAML and JSON files\n- Fully supports multi document yaml files\n- Colorized yaml output\n- [Deeply traverse yaml](https://mikefarah.gitbook.io/yq/operators/traverse-read)\n- [Sort yaml by keys](https://mikefarah.gitbook.io/yq/operators/sort-keys)\n- Manipulate yaml [comments](https://mikefarah.gitbook.io/yq/operators/comment-operators), [styling](https://mikefarah.gitbook.io/yq/operators/style), [tags](https://mikefarah.gitbook.io/yq/operators/tag) and [anchors and aliases](https://mikefarah.gitbook.io/yq/operators/anchor-and-alias-operators).\n- [Update yaml inplace](https://mikefarah.gitbook.io/yq/v/v4.x/commands/evaluate#flags)\n- [Complex expressions to select and update](https://mikefarah.gitbook.io/yq/operators/select#select-and-update-matching-values-in-map)\n- Keeps yaml formatting and comments when updating (though there are issues with whitespace)\n- [Convert to/from json to yaml](https://mikefarah.gitbook.io/yq/v/v4.x/usage/convert)\n- [Pipe data in by using '-'](https://mikefarah.gitbook.io/yq/v/v4.x/commands/evaluate)\n- [General shell completion scripts (bash/zsh/fish/powershell)](https://mikefarah.gitbook.io/yq/v/v4.x/commands/shell-completion)\n- [Reduce](https://mikefarah.gitbook.io/yq/operators/reduce) to merge multiple files or sum an array or other fancy things.\n\n## [Usage](https://mikefarah.gitbook.io/yq/)\n\nCheck out the [documentation](https://mikefarah.gitbook.io/yq/) for more detailed and advanced usage.\n\n```\nUsage:\n  yq [flags]\n  yq [command]\n\nAvailable Commands:\n  eval             Apply expression to each document in each yaml file given in sequence\n  eval-all         Loads _all_ yaml documents of _all_ yaml files and runs expression once\n  help             Help about any command\n  shell-completion Generate completion script\n\nFlags:\n  -C, --colors        force print with colors\n  -e, --exit-status   set exit status if there are no matches or null or false is returned\n  -h, --help          help for yq\n  -I, --indent int    sets indent level for output (default 2)\n  -i, --inplace       update the yaml file inplace of first yaml file given.\n  -M, --no-colors     force print with no colors\n  -N, --no-doc        Don't print document separators (---)\n  -n, --null-input    Don't read input, simply evaluate the expression given. Useful for creating yaml docs from scratch.\n  -P, --prettyPrint    pretty print, shorthand for '... style = \"\"' \n  -j, --tojson        output as json. Set indent to 0 to print json in one line.\n  -v, --verbose       verbose mode\n  -V, --version       Print version information and quit\n\nUse \"yq [command] --help\" for more information about a command.\n```\n\nSimple Example:\n\n```bash\nyq e '.a.b | length' f1.yml f2.yml \n```\n\n## Known Issues / Missing Features\n- `yq` attempts to preserve comment positions and whitespace as much as possible, but it does not handle all scenarios (see https://github.com/go-yaml/yaml/tree/v3 for details)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaigrr%2Fyq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaigrr%2Fyq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaigrr%2Fyq/lists"}