https://github.com/Freeyourgadget/Gadgetbridge/wiki/Pebble-Firmware-updates
Copy it to your working directory
virtualenv venv -p $(which python2.7)
source venv/bin/activate
pip install libpebble2 git+https://github.com/pebble/pebble-tool.git sourcemap
https://github.com/pebble-dev/wiki/wiki/Firmware%3A-Flashing-from-a-computer
https://gist.github.com/Katharine/af69eff12b7ccff6990d25ba8b299d2b
pebble repl --serial /dev/cu.PebbleA1F2-SerialPortSe
import sys
sys.path.append('.')
import install_firmware as fw
fw._install_firmware(pebble, FIRMWARE_FILENAME)