ESP-IDF: How to build, flash & monitor in one single command

Use the following command to build, flash and monitor your ESP-IDF project in one single command:

idf.py -p /dev/ttyACM0 build flash monitor

This command will only flash the project if the build succeeded.