Interactive Drush Script
Drush has built-in functions to handle I/O. 

If you're using Drush &lt;9.x, there's the procedural drush_confirm() that will prompt a user for a response to a given message. If you're using 9.x+, any custom command class extending the DrushCommands class will have access to the $this-&gt;io()-&gt;confirm method which does the same thing with Symphony's CLI components.

See the latest Drush docs for more info on I/O.