New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

jsonzen

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonzen

Privacy-first JSON toolbox in your terminal. Format, validate, diff, query, and convert JSON without leaving the shell.

beta
Source
npmnpm
Version
1.0.0-beta.2
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

jsonzen

npm version

Privacy-first JSON tools in your terminal — every JSON tool from jsonzen.dev, runnable as a Unix filter.

npm i -g jsonzen   # or: npx jsonzen --help

Works with stdin/stdout so it composes with jq, curl, xargs, and anything else in your shell.

curl -s https://api.example.com/users \
  | jsonzen jq '$.data[*].email' \
  | jsonzen format

Commands

  • jsonzen format [file] — Pretty-print JSON. --indent 2/--indent 4, --sort.
  • jsonzen minify [file] — Strip whitespace. Reports bytes saved on stderr.
  • jsonzen validate <data> <schema> — Validate JSON against a JSON Schema (Ajv). Exits 3 on validation failure.
  • jsonzen diff <left> <right> — Semantic diff between two JSON files. Exits 3 on differences.
  • jsonzen jq <query> [file] — Run a JSONPath expression.
  • jsonzen jp <query> [file] — Run a JMESPath expression.
  • jsonzen jwt decode <token> — Decode a JWT (header + payload, no signature verification).
  • jsonzen yaml [file] — Convert between JSON and YAML. --to (default) or --from.
  • jsonzen csv [file] — Convert between JSON arrays and CSV. --to (default) or --from.
  • jsonzen ts [file] — Generate TypeScript type declarations (quicktype).
  • jsonzen zod [file] — Generate a Zod runtime validator.
  • jsonzen pydantic [file] — Generate Pydantic v2 BaseModel classes.
  • jsonzen schema [file] — Infer a JSON Schema (Draft 2020-12 or 07).

[file] defaults to stdin. Pass - to be explicit.

Common flags

  • -o, --output <file> — write to file instead of stdout.
  • -q, --quiet — suppress non-error output (e.g. minify's bytes-saved report).
  • --json — machine-readable error envelope: {"error":{"kind":"...","message":"..."}} to stderr.
  • -h, --help — per-command help with examples.
  • -v, --version — print the CLI version.

Exit codes

  • 0 — success
  • 1 — usage / argument error
  • 2 — input error (missing file, can't read stdin)
  • 3 — convert / validate / diff produced a non-success result
  • 4 — runtime error (uncaught)

Examples

# Round-trip JSON through a sort + key-uniqueness pass.
echo '{"b":1,"a":[3,2,1]}' | jsonzen format --sort

# Generate a TypeScript declaration from an API response.
curl -s https://api.example.com/me | jsonzen ts -n MeResponse > me.types.ts

# Validate a config file in CI.
jsonzen validate ./app.config.json ./schemas/app.json --mode all-errors

# Diff two API responses, exit non-zero if they drifted.
jsonzen diff before.json after.json -o changes.json

Privacy

Every command runs entirely on your machine. The CLI has no auth, no network call, no vault. It never reads or writes anything in your JSONZen cloud account regardless of plan. Cloud sync is a web-app-only feature — see jsonzen.dev/pricing.

Free vs Pro

There is no CLI Pro tier. Every command works the same whether you've paid for a web Pro pass or not. No license key, no sign-in step, no plan check.

FeatureCLI FreeCLI Pro
All transforms (format, minify, validate, diff, query, jwt, yaml, csv, ts, zod, pydantic, schema)✅✅
Every flag in this README (--sort, --indent, --mode, --output, --json, --quiet, …)✅✅
Read from stdin / write to stdout / pipe composition✅✅
Exit codes for shell scripting✅✅

The web app at jsonzen.dev has a Free tier and a Pro tier with extras a browser session can offer that a shell pipe can't — see jsonzen.dev/pricing.

The CLI is great as a step in a shell pipeline; the web app is great for interactive exploration. They share the exact same engine (@jsonzen/core), so output from one drops into the other without surprise.

Keywords

json

FAQs

Package last updated on 17 May 2026

Related posts