jq_skill

This skill helps you extract, filter, and transform JSON efficiently using jq commands across large data sets and pipelines.
  • Python

2.6k

GitHub Stars

2

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill openclaw/skills --skill jq

  • _meta.json438 B
  • SKILL.md1.3 KB

Overview

This skill provides a command-line JSON processor for extracting, filtering, and transforming JSON data using concise, composable filters. It lets you query, reshape, and manipulate JSON directly from shells, scripts, and pipelines. The tool is lightweight, fast, and widely used in automation and data-processing workflows.

How this skill works

You apply jq filters to JSON input either by passing files or piping data via standard input. Filters traverse JSON structures (.key, .[]), perform selections (select(...)), reshape objects ({a: .x}), and produce transformed JSON or raw text using flags such as -r and -c. Complex operations combine simple filters into powerful pipelines for grouping, aggregating, and formatting data.

When to use it

  • Extract specific fields from large JSON files or API responses.
  • Filter arrays of objects by predicates (active users, inventory thresholds).
  • Reshape or enrich JSON for downstream tools or APIs.
  • Merge or aggregate multiple JSON files into a single structure.
  • Pretty-print or compact JSON for logs and storage optimization.

Best practices

  • Start with jq '.' to validate and pretty-print input JSON before transforming.
  • Use -r for raw string outputs when integrating with shell tools to avoid quotes.
  • Build filters incrementally: test simple expressions, then compose them.
  • Prefer small, focused filters and pipe them for readability and reuse.
  • Use -s to slurp files when you need to aggregate multiple JSON documents.

Example use cases

  • Extract all user emails: jq '.users[].email' data.json
  • Filter active records: jq '.[] | select(.active)' data.json
  • Merge multiple JSON files into one array: jq -s 'add' *.json
  • Add or remove fields: jq '. + {new: "val"}' and jq 'del(.key)'
  • Compute sums: jq '[.[] | .amount] | add' transactions.json

FAQ

Use Homebrew: brew install jq. For other platforms or binaries, see the official download page.

When should I use -r or -c flags?

-r outputs raw strings without quotes (good for shell use). -c produces compact JSON on a single line for logs or streaming.

How can I handle multiple JSON files together?

Use -s to slurp all inputs into an array, then apply operations like add to merge them: jq -s 'add' *.json.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational