← 返回 Skills 市场
shenghoo123-png

JSON Query Tool

作者 shenghoo123-png · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
97
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install json-query-tool-kay
功能描述
Quickly extract and filter JSON fields using simple path expressions with optional output as raw, JSON, or tables, without complex syntax or extra dependencies.
使用说明 (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"
安全使用建议
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.
功能分析
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.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install json-query-tool-kay
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /json-query-tool-kay 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: path-based JSON query, array indexing, wildcard, type filtering, table output
元数据
Slug json-query-tool-kay
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

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. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 97 次。

如何安装 JSON Query Tool?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install json-query-tool-kay」即可一键安装,无需额外配置。

JSON Query Tool 是免费的吗?

是的,JSON Query Tool 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

JSON Query Tool 支持哪些平台?

JSON Query Tool 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 JSON Query Tool?

由 shenghoo123-png(@shenghoo123-png)开发并维护,当前版本 v1.0.0。

💬 留言讨论