JSONPath Query for Openclaw

An advanced command-line tool for navigating, filtering, and extracting data from JSON structures using complex JSONPath expressions.

charlie-morrison
v1.0.1
May 1, 2026
0
817
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install jsonpath-query

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install jsonpath-query using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is JSONPath Query?

The JSONPath Query tool is a high-performance utility designed for developers and data analysts who need to interact with deeply nested JSON data. As part of the Openclaw Skills ecosystem, it provides a robust alternative to jq, enabling users to perform recursive descent, array slicing, and complex filter expressions directly from the terminal or within automated workflows.

Whether you are processing API responses or managing large configuration files, this skill simplifies data discovery. It allows for precise targeting of values using standard JSONPath syntax, making it an essential component for any modern devops or data processing toolkit.

JSONPath Query Use Cases

  • Extracting specific fields from large API response payloads
  • Filtering JSON objects based on logical conditions (e.g., price < 10)
  • Mapping and listing all available paths within an unknown JSON structure for exploration
  • Transforming JSON data into CSV or line-delimited formats for downstream processing
  • Validating JSONPath expressions before implementing them in production code

How JSONPath Query Works

  1. The user provides JSON input via a file flag (-f) or by piping data through standard input (stdin).
  2. A JSONPath expression is evaluated against the root of the JSON document.
  3. The engine performs recursive searches, filtering, or slicing based on the specific syntax used.
  4. Matching elements are captured and formatted according to the requested output type (JSON, CSV, or lines).
  5. The tool returns the processed data or provides a specific exit code for CI/CD pipeline integration.

JSONPath Query Setup

To integrate this tool into your environment, ensure you have Python 3 installed. You can run the script directly from your Openclaw Skills directory:

# Navigate to your scripts folder
cd scripts/

# Basic query to test installation
echo '{"status": "ok"}' | python3 jsonpath.py query '$.status'

JSONPath Query Data Schema & Taxonomy

The JSONPath Query tool supports various output structures depending on the flags used. By default, it returns valid JSON, but it can be configured for flatter data structures.

Format Description Best For
json Returns a standard JSON array of matches Default programmatic use
lines Outputs each match on a new line Shell scripting and grep
csv Flattens objects into comma-separated values Spreadsheet imports

Metadata such as match counts or path validation status can also be toggled via CLI flags.

JSONPath Query Advanced Features

  • Recursive descent searches using the .. operator to find keys at any nesting level
  • Named extractions to perform multiple queries in a single pass and label the output
  • CI/CD friendly modes including --exit-empty to trigger pipeline failures on missing data
  • Array slicing with step support (e.g., [0:10:2]) for advanced sampling
  • Interactive path discovery to map out the entire schema of complex JSON files

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*