https://github.com/adafruit/travis-ci-a ... install.sh
Edit: the formal documentation is here: https://github.com/arduino/Arduino/blob ... npage.adoc
Arduino.cc has also released a command line tool written in Go which will replace parts of the IDE. I haven't yet tried it with the esp8266 core but chances are it should also work:
https://github.com/arduino/arduino-builder