For BlueSpice we have build a command line application for a variety of maintenance tasks (mainly connected to releases/builds). We are using the "symfony/console" library and are quite happy with it. Using BOX for creating a PHAR file that contains all the classes/dependencies.
Topic on Talk:Requests for comment/Proper command-line runner for maintenance tasks
Using symfony/console could be a follow-up project. This RfC makes it easier to get there, and eventually MaintenanceTask could just be a wrapper around symfony/console.