In #152, the following has been very helpful:
php -r 'require "Patchwork.php"; echo Patchwork\CodeManipulation\transformString(file_get_contents("path/to.php"));'
It would be nice to turn it into something more convenient, like the following:
php Patchwork.php path/to.php
By the way, Patchwork already has a rudimentary CLI, intended mostly for warming up the preprocessor cache. I think it could be easily remade to also serve this debugging-related purpose.