Add `getCommandPath()` method to `Compiler` to simplify the code