Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A CLI to pretty-data with file and stdin support

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .npmignore
Octocat-spinner-32 package.json


pretty-data-cli is a command-line interface (CLI) to pretty-data with file and stdin support. As such, it supports pretty printing of JSON, XML, CSS and SQL.

You can also minify (-m switch) instead of pretty print (also a pretty-data feature).

It uses mime to detect file types based on file extensions. If no explicit type was given and no file extension was recognizable, it will fail.

When reading from stdin, the type option is required.

Below is the command-line usage help:

usage: pretty <files>... [options]

files     Read from FILE(s). Optional.

   -t TYPE, --type TYPE   Data TYPE. If not present, will guess from file extension. Required if no FILE(s) given.
   -m, --minify           Minify instead of pretty print.
   -v, --version          Show version.

(*nix) Examples

  • Page through the *in*human-readable GData API
curl -s "" | pretty -t xml | less

PS: I think almost all GData APIs have a prettyprint parameter available

  • Read Twitter's global trends
curl -s "" | pretty -t json
Something went wrong with that request. Please try again.