The command line tool yq is like jq but for YAML data instead of JSON data - you can use it to and filter and transform YAML data, much like you would JSON dats with jq.

Build your own yq is available with a project breakdown on Coding Challenges.