Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

yq

$ yq Community Low Risk
Mike Farah · Database & Data · MIT · macos / linux / windows

Mike Farah's yq is a single-binary Go processor for YAML, JSON, XML, TOML, INI, and properties files using jq-inspired expressions. Agents rely on yq -o=json to normalize Kubernetes/Helm/CI configs cleanly and yq -i for surgical YAML edits without breaking formatting.

FCRS-1.0 Score
95 /100
Excellent
Medium Confidence
Zero-Friction Install
brew install yq
CLI vs MCP Decision CLI Only

yq runs locally in milliseconds to query or patch YAML/TOML/XML files without wasting context tokens reading entire manifests.

Agent-Readiness Checklist

✓ JSON Output
✓ Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 25 / 25

Supports -o=json/yaml/toml/xml, -M (no-colors), -e exit status on null/false, and clean stdin/stdout streaming.

  • Supports -o=json, -p/-o multi-format conversion, -M monochrome, and -e
Trust & Safety 24 / 25

Read-only stdout by default; mutations require explicit -i (--inplace) and work strictly on local files.

  • Pure local stream processor; explicit -i required for file mutation
Setup & Portability 15 / 15

Zero-dependency static Go binary across macOS, Linux, and Windows.

  • Static Go binary via Homebrew, GitHub Releases, and go install
Utility & Efficiency 15 / 15

Essential companion to jq for YAML, TOML, XML, and INI configs while preserving comments on edits.

  • Multi-format query/patch with comment preservation
Maintenance & Lineage 8 / 10

Widely adopted mikefarah/yq v4 project under MIT license.

  • Active mikefarah/yq repository
Docs & Verifiability 8 / 10

Comprehensive GitBook documentation with operator recipes.

  • Official docs at mikefarah.gitbook.io/yq/

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None; operates purely on local files and stdin/stdout streams.

Side Effects
Read-Only Local Write
Cost & Quotas

100% free and MIT open-source.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# yq Agent Rules
- Preview expression output on stdout before adding `-i` (`--inplace`).
- Verify you are running Mike Farah's Go `yq` v4 (`yq --version`) rather than the Python `kislyuk/yq` wrapper.
- Pass `-o=json` when feeding extracted config into downstream tools or `jq`.

Agent-Ready Command Recipes

Safe Read-Only Queries

Convert a YAML config to JSON and extract keys
yq -o=json '.services | keys' docker-compose.yml

Reads only service names from a Compose file and emits clean JSON.

Evaluate multi-document Kubernetes manifests safely
yq -o=json '[.kind, .metadata.name]' manifests.yaml

Summarizes resource kinds and names across multi-document YAML streams.

Controlled Writes & Previews

Update a single YAML field in-place preserving comments
yq -i '.services.web.image = "nginx:1.27"' docker-compose.yml

Performs a targeted YAML mutation while preserving existing comments and structure.

Strengths for Agents

  • + Converts effortlessly between YAML, JSON, TOML, XML, and INI with -p / -o.
  • + Preserves YAML comments and formatting during -i surgical edits.
  • + Zero-dependency static Go binary with sub-10ms startup.

Caveats & Pitfalls

  • ! Distinct from Python's kislyuk/yq wrapper (which uses jq syntax); check yq --version in mixed environments.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI