curly: A wrapper for `curl` which pretty-prints JSON output
Switch branches/tags
Nothing to show
Pull request Compare This branch is even with kyledrake:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


curly: A replacement for curl which pretty-prints JSON output


Use this like you would normally use curl. By default this script adds the -i flag which includes the HTTP headers in the output, which is useful when debugging REST services that return different HTTP codes depending on the response.

Any command line arguments you pass to this script will be handed off to cURL.


curly -d "foo=bar"


  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   786  100   786    0     0   2259      0 --:--:-- --:--:-- --:--:--  3144
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Cache-Control: private, no-cache, no-store, must-revalidate
Content-Type: text/javascript; charset=UTF-8
ETag: "04806e95d2cf191a0e231f2559757767da774bf7"
Expires: Sat, 01 Jan 2000 00:00:00 GMT
Pragma: no-cache
X-FB-Rev: 579367
X-FB-Debug: 8mgUjMq1LsuQS8tjNekLjIOR9uzgIrtkNadqxJGqyFQ=
Date: Sat, 23 Jun 2012 19:44:38 GMT
Connection: keep-alive
Content-Length: 786

  "id": "19292868552",
  "name": "Facebook Platform",
  "picture": "",
  "link": "",
  "likes": 4781431,
  "cover": {
    "cover_id": "10150835335278553",
    "source": "",
    "offset_y": 32
  "category": "Product/service",
  "is_published": true,
  "website": "",
  "username": "platform",
  "founded": "2007",
  "company_overview": "Facebook Platform enables anyone to build social apps on Facebook and the web.",
  "mission": "To make the web more open and social.",
  "about": "We're building the social web. Get the latest here: ",
  "were_here_count": 1,
  "talking_about_count": 20095


The easiest way to use curly is to create a bash alias from curly to this script. After cloning this repository, add a line like the following to your bash profile.

alias curly="/Users/aaronpk/Code/curly/curly.rb"

Then you'll need to reload your bash profile:

. ~/.bash_profile

This script also requires the 'json' gem, which you can easily install by running

gem install json