A command line tool for managing wifi connection in osx
$ npm install -g osx-wifi-cli
osx-wifi-cli shows you which network you are connected to, if you are.
osx-wifi-cli scan shows available networks.
osx-wifi-cli off, and
osx-wifi-cli restart control the wifi device state.
osx-wifi-cli NETWORK PASSWORD tries to connects to NETWORK with PASSWORD.
osx-wifi-cli networkname " "