It would need to have a database of device ids, however this would stop a lot of headaches (specially for first timers) on setting the flash size and flash mode.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
This suggests that we can automate the flashing scripts to work out if dio mode is required, as the default it qio.
https://github.com/espressif/esptool#read-spi-flash-id
Manufacturer: e0
Device: 4016
Detected flash size: 4MB
It would need to have a database of device ids, however this would stop a lot of headaches (specially for first timers) on setting the flash size and flash mode.