yq
Share on:
Enter Your Mastodon Instance
Copy the link below to share to Mastodon
https://terminaltrove.com/yq/
A lightweight and portable command-line YAML, JSON, INI and XML processor.
Script Preview
Review this script before executing in your terminal.

yq is a command-line tool for querying and editing YAML, XML and TOML documents using jq filters.
It converts YAML into JSON before passing it to jq for filtering and transformation. Results appear as JSON by default or YAML with the -y option. Filters accept files or standard input, and in-place editing writes changes directly to YAML files.
Round-trip mode preserves YAML tags, styles and comments, although the extra metadata can affect filters that inspect collections. It also supports multiple streams through sdin and via large documents, while TOML has a separate mode for retaining formatting and comments.
Developers can use yq to inspect configuration files, update Kubernetes manifests and extract structured data in shell scripts.



