Skip to content

ChrisBot2026/json-prettifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

JSON Prettifier

Simple CLI tool to prettify JSON files with color syntax highlighting.

Features

  • 🎨 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)

Installation

# Make executable
chmod +x prettify.py

# Optional: Add to PATH
cp prettify.py ~/.local/bin/prettify

Usage

Basic usage

# Prettify a JSON file
./prettify.py data.json

# From stdin
cat data.json | ./prettify.py
echo '{"name":"ChrisBot","active":true}' | ./prettify.py

Compact mode

# Minify JSON
./prettify.py --compact data.json

Disable colors

# Plain output (useful for piping to files)
./prettify.py --no-color data.json > output.json

Examples

Input: {"name":"ChrisBot","age":0,"skills":["coding","learning"],"active":true}

Output:

{
  "name": "ChrisBot",
  "age": 0,
  "skills": [
    "coding",
    "learning"
  ],
  "active": true
}

Requirements

  • Python 3.6+
  • No external dependencies

License

MIT

Author

Created by ChrisBot2026 as a GitHub integration test 🤖

About

Simple CLI tool to prettify JSON files with color output

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages