← Back to Skills Marketplace
shenghoo123-png

JSON Query Tool

by shenghoo123-png · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
97
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install json-query-tool-kay
Description
Quickly extract and filter JSON fields using simple path expressions with optional output as raw, JSON, or tables, without complex syntax or extra dependencies.
README (SKILL.md)

json-query-tool — JSON 查询工具

痛点

  • jq 语法复杂,学习成本高
  • 只想快速提取 JSON 中的某个字段,却要写一长串表达式
  • 需要在 shell 脚本中处理 JSON,但不想引入额外依赖
  • 不同格式输出(表格、纯文本)要手动转换

场景

  • 从 API 响应 JSON 中提取指定字段
  • 查询 JSON 配置文件中的某个值
  • 日志文件是 JSON Lines 格式,批量提取字段
  • 将 JSON 数据导出为易读的表格形式

定价

  • 免费:基础路径查询 + JSON/纯文本输出
  • Pro 19元:表格输出 + 类型过滤 + 通配符支持
  • Team 49元:批量文件处理 + 管道集成 + 自定义格式

指令格式

基本用法

jsonq \x3C文件> \x3C路径表达式>

输出格式

jsonq \x3C文件> \x3C路径> --format raw|json|table

查询语法

模式 说明 示例
key 对象属性访问 users.name
parent.child 嵌套访问 user.profile.email
[n] 数组索引 users[0]
[*] 全部数组元素 users[*]
* 通配符键名 users.*.name
:type 类型过滤 age:number

示例

示例 JSON

{
  "users": [
    {"name": "Alice", "age": 30, "email": "[email protected]"},
    {"name": "Bob", "age": 25, "email": "[email protected]"}
  ],
  "company": {
    "name": "TechCorp",
    "departments": [
      {"name": "Engineering", "head": "Carol"},
      {"name": "Sales", "head": "Dave"}
    ]
  }
}

查询示例

# 获取所有用户名
jsonq data.json "users[*].name"
["Alice", "Bob"]

# 获取第一个用户的邮箱
jsonq data.json "users[0].email"
[email protected]

# 获取部门名称列表
jsonq data.json "company.departments[*].name"
["Engineering", "Sales"]

# 表格形式输出
jsonq data.json "users[*]" --format table
name    age  email
Alice   30   [email protected]
Bob     25   [email protected]

# 类型过滤:只取数字字段
jsonq data.json "users[0]" --format json
{"name": "Alice", "age": 30, "email": "[email protected]"}

安装

# 本地安装
pip install -e .

# 或直接使用
chmod +x jsonq
./jsonq data.json "field"
Usage Guidance
This skill appears to be what it claims: a small, local JSON-query CLI implemented in Python with no networking or credential usage. Before installing or running, consider: 1) the SKILL.md's pip install -e . instruction expects packaging metadata that is not present in the manifest — if you run pip from this source, verify what will be installed or prefer running the script in a virtualenv; 2) the tool reads any file path you give it, so don't let an automated agent call the skill with sensitive file paths (it could print/expose secrets contained in JSON files); 3) as with any code from an unknown source, run the tests and inspect/run the script in an isolated environment (virtualenv or container) before using on sensitive data.
Capability Analysis
Type: OpenClaw Skill Name: json-query-tool-kay Version: 1.0.0 The skill bundle provides a legitimate JSON querying utility (jsonq.py) similar to a simplified jq. The code is well-structured, includes a comprehensive test suite (test_jsonq.py), and lacks any indicators of malicious behavior such as data exfiltration, unauthorized network access, or prompt injection. All file operations are restricted to reading the user-specified JSON file for processing.
Capability Assessment
Purpose & Capability
Name, description, SKILL.md examples, and the provided jsonq.py implementation are consistent: the tool reads a user-supplied JSON file and evaluates simple path expressions, returning raw/json/table output as described.
Instruction Scope
SKILL.md only instructs running the jsonq CLI against a specified <file> and query. The runtime code reads the single file path you pass, parses JSON, and formats output. There are no directives to read other system state, environment variables, or to transmit data externally.
Install Mechanism
This is instruction-only (no install spec), which is low-risk. SKILL.md suggests 'pip install -e .' or chmod +x ./jsonq, but the repository manifest does not include packaging metadata (setup.py/pyproject.toml) or a produced jsonq wrapper — minor mismatch between install instructions and included files.
Credentials
The skill requests no environment variables, credentials, or config paths. The code does not access os.environ or other secrets — requested privileges are minimal and appropriate for a file-based CLI tool.
Persistence & Privilege
The skill is not marked always:true and does not attempt to modify agent/system configuration. It does read files provided to it (expected for this tool), so normal caution about what file paths are passed by automated agents applies.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install json-query-tool-kay
  3. After installation, invoke the skill by name or use /json-query-tool-kay
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release: path-based JSON query, array indexing, wildcard, type filtering, table output
Metadata
Slug json-query-tool-kay
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is JSON Query Tool?

Quickly extract and filter JSON fields using simple path expressions with optional output as raw, JSON, or tables, without complex syntax or extra dependencies. It is an AI Agent Skill for Claude Code / OpenClaw, with 97 downloads so far.

How do I install JSON Query Tool?

Run "/install json-query-tool-kay" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is JSON Query Tool free?

Yes, JSON Query Tool is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does JSON Query Tool support?

JSON Query Tool is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created JSON Query Tool?

It is built and maintained by shenghoo123-png (@shenghoo123-png); the current version is v1.0.0.

💬 Comments