jsonpath-query

Query JSON data using JSONPath expressions. Use when asked to extract, filter, search, or navigate JSON data. Supports recursive descent, wildcards, array slicing, filter expressions, and union selections. Triggers on "JSONPath", "JSON query", "extract from JSON", "JSON filter", "jq alternative", "json path", "query json".

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "jsonpath-query" with this command: npx skills add charlie-morrison/jsonpath-query

JSONPath Query Tool

Query JSON data using JSONPath expressions with recursive descent, wildcards, filters, and slicing.

Query

# From file
python3 scripts/jsonpath.py query '$.store.book[0].title' -f data.json

# From stdin
cat data.json | python3 scripts/jsonpath.py query '$.store.book[*].author'

# Recursive descent (find all 'name' fields at any depth)
cat data.json | python3 scripts/jsonpath.py query '$..name'

# Array slicing
cat data.json | python3 scripts/jsonpath.py query '$.items[0:5]'

# Filter (price < 10)
cat data.json | python3 scripts/jsonpath.py query '$.store.book[?(@.price < 10)]'

# Wildcard
cat data.json | python3 scripts/jsonpath.py query '$.store.*'

# Count matches
cat data.json | python3 scripts/jsonpath.py query '$.users[*]' --count

# First match only
cat data.json | python3 scripts/jsonpath.py query '$.items[*].id' --first

# Exit 1 if no matches (CI-friendly)
cat data.json | python3 scripts/jsonpath.py query '$.missing' --exit-empty

List Paths

# Show all available paths in JSON data
cat data.json | python3 scripts/jsonpath.py paths

# Limit depth
cat data.json | python3 scripts/jsonpath.py paths --depth 3

Extract Multiple Values

# Named extractions
cat data.json | python3 scripts/jsonpath.py extract 'name=$.user.name' 'emails=$.user.emails[*]'

Validate Expression

python3 scripts/jsonpath.py validate '$.store.book[?(@.price > 10)]'

Output Formats

python3 scripts/jsonpath.py query '$.items[*]' -f data.json --format json    # default
python3 scripts/jsonpath.py query '$.items[*].id' -f data.json --format lines # one per line
python3 scripts/jsonpath.py query '$.items[*]' -f data.json --format csv      # CSV for objects

JSONPath Syntax

ExpressionDescription
$Root object
.keyChild key
[0]Array index
[0:5]Array slice (start:end)
[0:10:2]Array slice with step
[*]All elements
..keyRecursive descent
[?(@.price<10)]Filter expression
['key']Bracket notation
[0,1,2]Union (multiple indices)

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

公文格式转换

公文格式排版工具。将 doc/docx/wps/txt/md 文档按照公文排版习惯自动格式化,输出标准 docx。支持智能识别标题层级(一、/(一)/1./(1))、题目/副标题、附件格式化、图表标题识别、页面边距、页码、行距、字体字号、TXT/MD 空行模式、自定义配置和目录批量处理。当用户需要排版公文、格式化...

Registry SourceRecently Updated
General

Postzee Skill

Generate AI images/videos and post to 30+ social media platforms with Postzee. Use when the user wants to create AI media, generate images or videos, optimiz...

Registry SourceRecently Updated
General

Chart Splat (x402)

Generate beautiful charts by paying per request with x402 micropayments (USDC on Base) instead of an API key. Use when the user wants a chart and has no CHAR...

Registry SourceRecently Updated
General

Mimotts25 Plus

🚀 小米 MiMo TTS 2.5 Plus — 基于 mimotts25 深度优化增强。升级到 v2.5-tts 模型,新增声音设计(文字定制音色)、声音克隆(音频复刻)、导演模式等高级功能。支持 v2.5 新音色:冰糖、茉莉、苏打、白桦等。

Registry SourceRecently Updated