# JSON Tools

> Parse, query, and transform JSON data

- Skill: `gebruder/json-tools` (Agent Skill)
- Install (CLI): `npx skillmds@latest add gebruder/json-tools`
- Raw SKILL.md: https://api.skillmd.com/api/skills/gebruder/json-tools/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: gebruder (https://skillmd.com/u/gebruder)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/gebruder/json-tools

---


# JSON Tools

Parse and transform JSON using jq.

## Query

- Pretty print: `echo '<json>' | jq .`
- Get field: `echo '<json>' | jq '.field'`
- Nested field: `echo '<json>' | jq '.a.b.c'`
- Array element: `echo '<json>' | jq '.[0]'`
- Array length: `echo '<json>' | jq 'length'`

## Filter and transform

- Select fields: `echo '<json>' | jq '{name: .name, id: .id}'`
- Filter array: `echo '<json>' | jq '.[] | select(.status == "active")'`
- Map: `echo '<json>' | jq '[.[] | .name]'`
- Sort: `echo '<json>' | jq 'sort_by(.date)'`
- Group: `echo '<json>' | jq 'group_by(.type)'`
- Unique: `echo '<json>' | jq '[.[].category] | unique'`

## File operations

- Read and query: `jq '.key' file.json`
- Compact: `jq -c . file.json`
- Raw strings (no quotes): `jq -r '.name' file.json`
- Convert to CSV: `jq -r '.[] | [.name, .value] | @csv' file.json`

