Use the 1.6.5 Arduino IDE (ignore 1.6.6 because it's buggy with esp8266 by now): https://github.com/esp8266/Arduino
If you prefer command line tools, you have an excellent option with platformio
Get started with: http://platformio.org/#!/get-started
And then, from this directory:
- platformio run
- platformio run -t upload [--upload-port IP]