Pow is great. I don’t know why it’s taken me so long to make the switch from rails s. Pow is short on management utilities though; probably for good reason. Ideally, you never have to touch your Pow instance. It ‘just works’. I like to dig around under the hood though, so I put together this quick Python script that outputs the running Pow config in a format I can read.

#!/usr/bin/env python

# filename: powconfig

#############################################################################
# Print POW config with nice formatting #####################################
# 
# Works as is with Python 2.6. For Python 2.7, 'import simplejson as json'
# instead. Save this file to a location in your PATH and make sure it is
# executable. Then you can call 'powconfig' from anywhere and see the active
# POW configuration.
#############################################################################

import sys
import json as json
import httplib as http

conn = http.HTTPConnection("localhost")
conn.request("GET", "/config.json", '', {"Host":"pow"})
resp = conn.getresponse()
data = resp.read()
print json.dumps(json.loads(data), indent=4)
sys.exit(0)

Save this script somewhere in your path and you can run powconfig from anywhere to see your running config, which looks like this:

[email protected]:~$ powconfig
{
    "bin": "/Users/bradland/Library/Application Support/Pow/Versions/0.3.2/bin/pow", 
    "rvmPath": "/Users/bradland/.rvm/scripts/rvm", 
    "workers": 2, 
    "dnsPort": 20560, 
    "httpPort": 20559, 
    "logRoot": "/Users/bradland/Library/Logs/Pow", 
    "timeout": 900, 
    "domains": [
        "dev"
    ], 
    "dstPort": 80, 
    "hostRoot": "/Users/bradland/Library/Application Support/Pow/Hosts", 
    "extDomains": []
}

If you don’t care about formatting, you can simply add this snippet as a bash alias.

alias powconfig='curl -H host:pow localhost/config.json'