We wanted to control the LIFX app from the command line and there was no API available so, we sniffed all the packets between app and reverse engineered the protocol essencially this code replays the packets the app does. To run just type python main.py
You also need to edit the script and set the IP Address of your lightbulb.