Day 11 : jq & yq — CLI Tools for JSON & YAML

Welcome to Day 11 of my 30 Days – 30 Tools for Developers series!

Today, we’re diving into jq and yq, two indispensable CLI tools for working with JSON and YAML data. Whether you’re automating configs, extracting values, or transforming formats, these tools make life a lot easier.


🔎 What is jq?

jq is a lightweight command-line processor for JSON.
It allows you to:

  • Slice and filter data

  • Map values across arrays

  • Transform entire JSON documents

👉 Perfect for APIs, logs, and structured data.


🔎 What is yq?

yq is the YAML equivalent of jq.
It enables you to:

  • Parse and extract YAML values

  • Update configs safely

  • Convert between YAML and JSON

👉 Ideal for Kubernetes configs, CI/CD pipelines, and DevOps workflows.


💡 Why Developers Use jq & yq

Automation → Integrate into shell scripts & CI/CD pipelines
📊 Data Extraction → Grab only what you need from complex files
✏️ Editing → Update configs programmatically (no risky manual edits)
🔄 Format Conversion → JSON ↔ YAML effortlessly


🖥️ Examples

jq: Extract usernames from JSON

jq '.users[].username' users.json

yq: Update a YAML config value

yq eval '.server.port = 8080' -i config.yaml

🏁 Conclusion

If you work with JSON or YAML, jq and yq are must-have CLI tools. They save time, reduce errors, and supercharge your automation workflows.


❓ Question for You

What’s the coolest jq or yq trick you’ve learned that others should know?

0
Subscribe to my newsletter

Read articles from Shaharyar Shakir directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Shaharyar Shakir
Shaharyar Shakir