π¨ jsonfizz
Fast, zero fuss JSON formatter and pretty printer for the terminal. β¨
β¨ Features
- π Blazing fast - Written in Rust
- π¨ Beautiful themes - 11 color schemes including anime themes
- π JSON path queries - Extract specific values
- π Depth limiting - Handle large JSON gracefully
- π― Multiple inputs - Files, stdin, or pipes
- βοΈ Configurable - TOML config file support
- π Format conversion - JSON β YAML β TOML, CSV output
- π CSV friendly - Read CSV and convert to JSON
- π Multiple formats - JSON and YAML output
- β Schema checks - Optional JSON Schema validation
- π Shell completion - Auto-completion for bash/zsh/fish
- π Performance benchmarks - Built-in performance testing
- π Progress indicators - Feedback for large file processing
π¦ Installation
π Library Usage
You can use jsonfizz as a Rust library in your own projects:
[]
= "0.2.0"
= "1.0"
use ;
use json;
π Usage
Basic formatting
# From API
|
# From file
# From stdin
|
Advanced features
# Watch file for changes and reformat on the fly
# Extract specific values with JSON path
# Limit depth for large files
|
# Compact output
# Custom indentation
# Sort object keys
# Format conversion (JSON β YAML β TOML β CSV)
# Read TOML, output as JSON
# Read YAML, output as TOML
|
# Convert JSON array to CSV
|
# Read CSV and output JSON
# Validate against a JSON Schema
# Control color output
# Read JSON, output as YAML
# Read JSON, output as TOML
# Run performance benchmarks
Color themes
# Rainbow theme π
# Ocean theme π
# Forest theme π²
# Pastel theme π¨
# Anime themes πΈπ€ποΈποΈ
# Generate shell completions
βοΈ Configuration
Create ~/.config/jsonfizz/config.toml or ~/.jsonfizz.toml to set persistent defaults.
Full Example:
# Indentation size (spaces)
= 2
# Sort keys alphabetically (true/false)
= true
# Default color theme
= "ocean"
# Default output format (json, yaml, toml, csv)
= "json"
# Max depth to recurse (0 = unlimited)
= 0
# Max string length before truncation (0 = unlimited)
= 0
# Optional: Path to a default JSON schema for validation
# schema = "/path/to/schema.json"
CLI flags override config.
π JSON Path Syntax
The --get flag supports a simple dot-notation syntax for extracting values:
key: Access a property of an object.array[index]: Access an element of an array.data.items[0].name: Nested access.
Examples:
users[0].idconfig.server.portrows[5]
β Schema Validation
Validate your JSON against a standard JSON Schema.
If validation fails, jsonfizz will print a clear error message indicating the location of the violation and exit with code 1.
β Troubleshooting
"Error: UTF-8"
jsonfizz currently only supports valid UTF-8 input. Ensure your files are encoded correctly.
"Watch limit reached"
If using --watch on Linux, you might hit the system's file watcher limit. Increase it with:
sysctl fs.inotify.max_user_watches=524288
π¨ Themes
| Theme | Description | Preview |
|---|---|---|
default |
Bright, balanced colors | Keys: π‘ Strings: π’ Numbers: π΅ |
solarized |
Muted, eye-friendly | Keys: π‘ Strings: π’ Numbers: π΅ |
mono |
No colors | Plain text |
rainbow π |
Vibrant rainbow | Keys: π΄ Strings: π’ Numbers: π‘ |
ocean π |
Cool blue tones | Keys: π΅ Strings: π΅ Numbers: π΅ |
forest π² |
Nature greens | Keys: π’ Strings: π’ Numbers: π‘ |
pastel π¨ |
Soft pastels | Keys: π©· Strings: π©· Numbers: π©· |
sakura πΈ |
Anime pink | Keys: π©· Strings: π΄ Numbers: π΅ |
cyberpunk π€ |
Neon cyber | Keys: π©· Strings: π’ Numbers: π΅ |
ghibli ποΈ |
Studio Ghibli | Keys: π’ Strings: π‘ Numbers: π΅ |
evangelion ποΈ |
Purple & teal | Keys: π©· Strings: π΅ Numbers: π΅ |
π Options
Usage: jsonfizz [OPTIONS] [FILE]...
Arguments:
[FILE]... Input files (use - for stdin)
Options:
-i, --indent <INDENT> [default: 2]
--sort-keys
-c, --compact
--max-depth <MAX_DEPTH>
--max-string-length <MAX_STRING_LENGTH>
--get <GET>
--raw
--format <FORMAT> Output format: json, yaml, toml, csv [default: json]
--input-format <INPUT_FORMAT> Input format: json, yaml, toml, csv [default: json]
--schema <SCHEMA> Path to a JSON Schema file for validation
--color <COLOR> Color output control: auto, always, never [default: auto]
--theme <THEME> Color theme (see available themes below) [default: default]
-h, --help Print help
-V, --version Print version
π€ Contributing
PRs welcome! Please format with cargo fmt and test with cargo test.
π License
Copyright Β© 2025 Lance. Licensed under MIT or Apache-2.0.