Register Services in CLI Modules

Hello, I have a Project which is divided in Modules. The Project can be run over web and additionaly over cli. My problem is, that the cli-verison doesnt set shared dependencies which are defined in my Module.php


$di = new CliDI();
$console = new ConsoleApp($di);

require __DIR__ . '/../app/config/services.php';
require __DIR__ . '/../app/config/servicesCli.php';

$namespace = "Xxx\\Tasks\\Tasks\\";


        'xxxTasks' => [
            'className' => 'Xxx\XxxTasks\Module',
            'path' => '../app/modules/xxx_tasks/Module.php'


     * @param DiInterface $di
    public function registerServices(DiInterface $di)

        $di->get('view')->setViewsDir(__DIR__ . '/views/');

        $di->setShared('proxyServerConfig', function() {
            return require APP_PATH . '/app/config/proxy_server_config.php';

So proxyServerConfig isn't set as dependency. If I add setShared("proxyServerConfig"... into servicesCli.php everything works.

Most likely CLI application just doesn't call those methods...