json-toolkit

Swiss-army knife for JSON files. Pretty-print, validate, minify, sort keys, and query with dot-notation paths. Zero dependencies.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "json-toolkit" with this command: npx skills add claudiodrusus/json-toolkit

JSON Toolkit

A zero-dependency Python utility for working with JSON data. Validates, formats, minifies, queries, and inspects JSON files — all with Python's standard library.

Features

  • Pretty-print with configurable indentation (2, 4, or any number of spaces)
  • Minify JSON to reduce file size for APIs and storage
  • Validate JSON and get structural stats (type, key count, size)
  • Query nested data with dot-notation paths including array indices
  • Sort keys alphabetically for deterministic output and easier diffs
  • Stdin support for use in shell pipelines with other tools

Usage Examples

Pretty-print a JSON file:

python main.py data.json

Validate without output:

python main.py config.json --validate
# ✓ Valid JSON
#   Type: object (12 keys)
#   Size: 4832 bytes

Query a nested value:

python main.py users.json --query data.users.0.name
# "Alice"

Minify for production:

python main.py config.json --minify -o config.min.json

Sort keys for consistent diffs:

python main.py package.json --sort-keys -o package-sorted.json

Pipe from curl:

curl -s https://api.example.com/data | python main.py - --query results.0

Query Syntax

Use dot notation to navigate nested structures. Array indices are numbers:

  • name — top-level key
  • data.users — nested object key
  • data.users.0 — first element of an array
  • data.users.0.email — field of the first array element
  • config.servers.2.host — deeply nested value

Command Line Options

  • input — JSON file path, or - for stdin
  • -o, --output — Output file (defaults to stdout)
  • --indent N — Indentation spaces (default: 2)
  • --minify — Output minified JSON (no whitespace)
  • --query PATH / -q PATH — Extract a value at the given dot-notation path
  • --validate — Only validate and print stats, no output
  • --sort-keys — Sort object keys alphabetically
  • --json — (implicit) Output is always valid JSON

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

AIWolfPK - AI狼人杀

四个AI互相猜疑,你坐着看戏。每局30秒,到底谁是狼? Four AIs play Werewolf while you watch. 30s per round. Spot the wolf before they do.

Registry SourceRecently Updated
General

Project Analyzer

Analyze any project directory and produce a detailed report covering what the project does, its tech stack, folder structure, entry points, how to run it, an...

Registry SourceRecently Updated
General

Thought-Retriever

提炼对话回答中的核心洞察为高置信度知识晶体,存储于本体驱动记忆系统的自我进化与复用。

Registry SourceRecently Updated
General

Miaoji Bid Guard Pro

亚马逊广告护城河Pro版,90天ROI预测+多活动协同+季节性出价+关键词攻防矩阵。 从单次调价建议升级为完整的广告战役规划。基础功能可使用 miaoji-bid-guard 免费版。

Registry SourceRecently Updated