← 返回
未分类

harrylabsj-json-formatter

yjkj999999
未分类 community v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 21
下载
💾 0
安装
1
版本
#latest

概述

json-formatter-pro

Format and validate JSON files with pretty-printing and validation modes.

Description

A utility skill for formatting JSON files with proper indentation and validating JSON syntax. Supports reading from files or stdin, outputting to files or stdout.

Usage

# Format a JSON file (pretty-print to stdout)
python ~/.openclaw/skills/json-formatter/json_formatter.py format input.json

# Format and save to a new file
python ~/.openclaw/skills/json-formatter/json_formatter.py format input.json -o output.json

# Validate JSON syntax without formatting
python ~/.openclaw/skills/json-formatter/json_formatter.py validate input.json

# Read from stdin, format and output to stdout
cat input.json | python ~/.openclaw/skills/json-formatter/json_formatter.py format -

# Validate JSON from stdin
cat input.json | python ~/.openclaw/skills/json-formatter/json_formatter.py validate -

Options

  • format: Pretty-print JSON with proper indentation
  • validate: Check if JSON is valid without formatting output
  • -o, --output: Specify output file (default: stdout)
  • -i, --indent: Number of spaces for indentation (default: 2)
  • --sort-keys: Sort JSON keys alphabetically

Examples

# Format with 4-space indentation
python ~/.openclaw/skills/json-formatter/json_formatter.py format data.json -i 4

# Format and sort keys
python ~/.openclaw/skills/json-formatter/json_formatter.py format data.json --sort-keys

# Validate a JSON file
python ~/.openclaw/skills/json-formatter/json_formatter.py validate config.json
# Output: Valid JSON or error message with line number

Exit Codes

  • 0: Success
  • 1: Invalid JSON syntax
  • 2: File not found or permission error
  • 3: Other error

版本历史

共 1 个版本

  • v1.0.0 从ClawHub迁移发布 当前
    2026-06-07 11:47 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 196 📥 67,964
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 681 📥 329,454
dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 76 📥 182,455