yq is a Portable Command-line YAML Processor

yq is a Portable Command-line YAML Processor
Photo by Pedro Lastra / Unsplash

yq is a powerful and versatile command-line YAML processor. It is similar to renowned projects like jq (a command-line JSON processor) or sed, but specifically tailored for YAML files. With yq, you have the confidence to effortlessly perform a wide range of tasks, including deep reading a YAML file using a path expression, comparing YAML files, updating a YAML file based on a path expression or script file, and much more.

Furthermore, yq empowers you with the capability to merge multiple YAML files, with flexible options for overriding and appending.

Developed in efficient and portable Go, yq grants you the assurance of downloading a binary that is completely self-contained and requires no additional dependencies.

Features

  • Written in portable Go programming language, ensuring compatibility across different platforms.
  • Allows for colorization of output, enhancing readability and visual appeal.
  • Enables deep reading of YAML files using a given path expression, providing easy access to specific data within the file.
  • Can match and list paths that match a given path expression, allowing for efficient data retrieval.
  • Provides the ability to return the lengths of arrays, objects, and scalars, giving insights into the size and structure of the data.
  • Allows for updating of YAML files using a path expression or script file, making it easy to modify the contents of the file.
  • Creates any missing entries in the specified path on the fly, ensuring that the desired data structure is maintained.
  • Facilitates deep comparison of YAML files, allowing for easy identification of differences between two files.
  • Retains the original formatting and comments of YAML files during updates, preserving the integrity and context of the data.
  • Provides validation of YAML files, ensuring that they adhere to the specified structure and format.
  • Allows for the creation of YAML files with a deep path and value, or the creation of a script file for more complex data generation.
  • Supports the prefixing of a path to a YAML file, enabling easy integration of data from different sources.
  • Offers seamless conversion between JSON and YAML formats, providing flexibility in data interchange.
  • Allows for piping of data using the '-' symbol, facilitating easy integration with other command-line tools.
  • Enables the merging of multiple YAML files, with options for overriding and appending data as needed.
  • Supports the handling of multiple documents within a single YAML file, providing efficient reading, writing, and merging capabilities.
  • Provides general shell completion scripts for popular shell environments such as bash, zsh, fish, and powershell, enhancing user experience and productivity.
  • Decode/Encode base64 data
  • Load content from other files
  • Convert to/from json/ndjson
  • Convert to/from xml
  • Convert to/from properties
  • Convert to/from csv/tsv

Platforms

  • Windows
  • Linux
  • macOS
  • Docker

License

MIT License

Resources & Download

GitHub - mikefarah/yq: yq is a portable command-line YAML, JSON, XML, CSV, TOML and properties processor
yq is a portable command-line YAML, JSON, XML, CSV, TOML and properties processor - GitHub - mikefarah/yq: yq is a portable command-line YAML, JSON, XML, CSV, TOML and properties processor
yq
Download yq for free. Portable command-line YAML processor. yq is a portable and lightweight command-line YAML processor. It can be likened to projects like jq (a command-line JSON processor) or sed but for YAML files.

Read more