You can use command line to erase a QSPI flash memory connected to the Active Serial interface of Intel® FPGA devices by following the steps below:
1) Create a JIC file for your QSPI device with Programming File Generator or Converting Programming Files tool in Intel® Quartus® Prime software.
2) Open a NIOSII command shell and change directory to: <Quartus_install_directory>/<version>/<quartus>/bin64/
3) Launch command: quartus_pgm -c <programming cable number> -mjtag -o ri;<name of the jic file>.jic
The ri operation is responsible for configuring a serial flash loader / helper image into the target FPGA and then erasing the QSPI memory.