yq

Parse and transform YAML configuration files with structure-aware yq operations.

3|1|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/Cogni-AI-OU/cogni-ai-agent-skills --skill yq-cogni-ai-ou
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: yq
Source: https://github.com/Cogni-AI-OU/cogni-ai-agent-skills/tree/main/yq
Command: npx skills add https://github.com/Cogni-AI-OU/cogni-ai-agent-skills --skill yq-cogni-ai-ou

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill solves the problem of safely reading and editing YAML configuration files without corrupting structure, indentation, or quoting in manual text editing.

Core Features & Use Cases

  • Robust YAML parsing and querying: Extract values from deeply nested keys using selector expressions instead of brittle grep/sed patterns.
  • Safe in-place edits: Modify, add, delete keys and array items directly with predictable YAML-aware operations.
  • Transformation and merging: Convert YAML/JSON and merge multiple YAML files using yq’s eval-all capabilities for configuration composition.

Quick Start

Use the yq skill to extract a nested YAML value from config.yaml by running: yq '.path.to.key' config.yaml.

Frequently Asked Questions about yq

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely edit YAML configuration files without breaking indentation or quoting?

To safely edit YAML configuration files without breaking structure, you can apply structure-aware operations using YAML-aware selectors. This approach modifies, adds, or deletes keys and array items predictably, preventing the corruption common with manual text editing.

What is the best way to extract a value from a deeply nested YAML key?

The best way to extract values from deeply nested YAML keys is using selector expressions instead of brittle grep or sed patterns. This method robustly parses the YAML structure and queries specific paths to retrieve your desired data accurately.

Can I convert YAML to JSON and merge multiple YAML inputs for CI/CD configuration?

Yes, you can convert YAML to JSON and merge multiple YAML inputs for CI/CD configuration. Using eval-all capabilities, you can compose configuration files by merging multiple sources while preserving structural correctness across transformations.

Does in-place YAML editing require special syntax to avoid corrupting the file structure?

In-place YAML editing requires mikefarah/yq command-line syntax with YAML-aware selectors to avoid corrupting file structure. Using the safe in-place editing flag, modifications are applied directly to the file while preserving correct indentation and quoting.

Why should I use YAML-aware query selectors instead of grep or sed for configuration changes?

You should use YAML-aware query selectors instead of grep or sed because text-based pattern matching is brittle and easily corrupts YAML structure. Selectors apply structure-aware edit operations that safely parse and transform nested configuration data.