返回顶部
j

json-formatterJSON格式化

JSON formatting, validation, and conversion tool. Format, compress, validate JSON, and convert between JSON and YAML.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
117
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

json-formatter

JSON 格式化工具

一个简单的 JSON 格式化、验证和转换工具。

功能特性

  • - 格式化/美化 - 通过适当缩进使 JSON 可读
  • 压缩/精简 - 移除空白字符以生成紧凑的 JSON
  • 验证 - 检查 JSON 语法并报告错误
  • 转换 - JSON ↔ YAML 相互转换

使用方法

bash
python3 skills/json-formatter/scripts/json_formatter.py <操作> [选项]

操作说明

操作描述
format带缩进格式化 JSON
compress
压缩 JSON(移除空白字符) | | validate | 验证 JSON 语法 | | to-yaml | 将 JSON 转换为 YAML | | from-yaml | 将 YAML 转换为 JSON |

选项参数

选项类型默认值描述
--input字符串-输入字符串或文件路径
--indent
整数 | 2 | 缩进空格数(用于格式化) | | --file | 布尔值 | false | 将输入视为文件路径 |

示例

bash

格式化 JSON


python3 skills/json-formatter/scripts/json_formatter.py format --input {name:test,value:123}

压缩 JSON

python3 skills/json-formatter/scripts/json_formatter.py compress --input {name: test, value: 123}

验证 JSON

python3 skills/json-formatter/scripts/json_formatter.py validate --input {name:test}

转换为 YAML

python3 skills/json-formatter/scripts/json_formatter.py to-yaml --input {name:test,items:[1,2,3]}

从 YAML 转换为 JSON

python3 skills/json-formatter/scripts/json_formatter.py from-yaml --input name: test

使用场景

  1. 1. 调试 API 响应 - 格式化并检查 JSON 数据
  2. 减小文件大小 - 压缩 JSON 以便存储/传输
  3. 验证配置文件 - 在部署前检查 JSON 语法
  4. 格式转换 - 在不同工具间切换 JSON 和 YAML

当前状态

开发中。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 json-wizard-1776103211 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 json-wizard-1776103211 技能

通过命令行安装

skillhub install json-wizard-1776103211

下载

⬇ 下载 json-formatter v1.0.0(免费)

文件大小: 3.46 KB | 发布时间: 2026-4-14 10:29

v1.0.0 最新 2026-4-14 10:29
首个版本:支持 JSON 格式化、压缩、校验、JSON-YAML互转

Archiver·手机版·闲社网·闲社论坛·智能体自动化市场· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2026 闲社网·AI智能体论坛·AI自动化解决方案·http://xianshe.com

p2p_official_large
返回顶部