jq

Parse and transform JSON data from command-line inputs using jq filters.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/led8/.codex --skill jq-led8
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: jq
Source: https://github.com/led8/.codex/tree/main/skills/jq
Command: npx skills add https://github.com/led8/.codex --skill jq-led8

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Quickly parse, extract, filter, and transform JSON from the command line so that developers and automation scripts can handle API responses, logs, and other JSON payloads without heavy tooling or custom parsing code.

Core Features & Use Cases

  • Lightweight CLI parsing: Use concise filters to extract fields, navigate nested objects, and produce compact or pretty output.
  • Stream and transform: Process large JSON streams, map and aggregate records, sort and group data, and convert arrays into structured outputs for downstream tooling.
  • Shell integration: Integrate with curl, CI pipelines, and shell scripts to extract IDs, validate JSON, and generate tabular outputs for reporting.
  • Real-world example: extract the first result id from an API response in a CI job, fail the job on missing fields, and produce a compact JSON summary for downstream steps.

Quick Start

Pipe the API response into jq and extract the first result id using a filter like .results[0].id with -r to return raw text.

Frequently Asked Questions about jq

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

FAQPage Schema
How do I parse and extract fields from a JSON API response in a shell script?▼

To parse JSON API responses in shell scripts, pipe the payload into a command-line JSON processor and apply concise filters like .results[0].id to extract specific fields. You can use the -r flag to return raw text values directly for downstream shell variables.

What is the best way to process large JSON streams without loading everything into memory?▼

Processing large JSON streams efficiently requires a CLI tool that supports streaming parsing and compact output generation. This allows you to map, aggregate, and transform massive JSON records sequentially in shell pipelines without heavy memory overhead or custom parsing code.

Can I use command-line JSON parsing in CI pipelines to validate API responses and fail jobs on missing fields?▼

Yes, you can integrate command-line JSON parsing into CI pipelines to extract IDs, validate payloads, and generate compact summaries. By checking extracted fields and exiting with an error on missing data, you can reliably fail CI jobs when API responses are invalid.

How do I convert nested JSON arrays into tabular outputs for log processing and reporting?▼

To convert nested JSON arrays into tabular outputs for log processing, apply selection, mapping, and aggregation filters to transform array structures. You can sort, group, and output raw or compact text formats suitable for downstream reporting tooling.

Does lightweight JSON transformation require any dependencies or heavy tooling?▼

Lightweight JSON transformation from the command line requires no heavy tooling or custom parsing code, provided the jq CLI is available in your environment. It serves as a standalone utility for shell integration, field extraction, and lightweight ETL tasks.

When should I not use command-line JSON filters for data transformation?▼

You should avoid command-line JSON filters for data transformation if your environment lacks the required CLI utility, or if your task requires complex stateful processing that exceeds simple streaming, selection, mapping, and aggregation operations.