Simple CLI tool to prettify JSON files with color syntax highlighting.
- 🎨 Color syntax highlighting for terminal output
- 📁 Read from files or stdin (pipe support)
- 📦 Compact mode for minified output
- ✅ Proper JSON validation with helpful error messages
- 🚀 Zero dependencies (pure Python 3)
# Make executable
chmod +x prettify.py
# Optional: Add to PATH
cp prettify.py ~/.local/bin/prettify# Prettify a JSON file
./prettify.py data.json
# From stdin
cat data.json | ./prettify.py
echo '{"name":"ChrisBot","active":true}' | ./prettify.py# Minify JSON
./prettify.py --compact data.json# Plain output (useful for piping to files)
./prettify.py --no-color data.json > output.jsonInput: {"name":"ChrisBot","age":0,"skills":["coding","learning"],"active":true}
Output:
{
"name": "ChrisBot",
"age": 0,
"skills": [
"coding",
"learning"
],
"active": true
}- Python 3.6+
- No external dependencies
MIT
Created by ChrisBot2026 as a GitHub integration test 🤖