yq

go
apache-2.0

A lightweight and portable command-line YAML, JSON, INI and XML processor.

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.

Related tools

Get Updates On Terminal Trove.

No spam, just updates on Terminal Trove. See an example update.