π¦ ClawHub
JSON Toolkit
by @claudiodrusus
Swiss-army knife for JSON files. Pretty-print, validate, minify, sort keys, and query with dot-notation paths. Zero dependencies.
TERMINAL
clawhub install json-toolkitπ About This Skill
name: json-toolkit description: Swiss-army knife for JSON files. Pretty-print, validate, minify, sort keys, and query with dot-notation paths. Zero dependencies. triggers: - format json - pretty print json - validate json - query json - minify json - json tool
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
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 keydata.users β nested object keydata.users.0 β first element of an arraydata.users.0.email β field of the first array elementconfig.servers.2.host β deeply nested valueCommand 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