I’ve put a little script on PyPi that copies files onto a NodeMCU or other serial device running Micropython. To use it, install mipy with pip:

$ pip install mipy

Now you can copy files to the device:

$ mipy cp main.py

My typical workflow is to make a change, then copy it to the board with mipy -ir:

$ mipy -ir cp main.py

This interrupts the running script, copies the file, then does a soft-reset.

You can also set the port, baudrate and other options. See mipy --help.