marwa-framework

Console Development

Extending Commands

Extend Marwa\Framework\Console\AbstractCommand when you want command classes to access the application base path, config repository, logger, and service container through helper methods.

final class CleanupCommand extends AbstractCommand
{
    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $this->logger()->info('Cleanup started');

        return Command::SUCCESS;
    }
}

Registration Options

Package Integration

ConsoleKernel attempts to register marwa-db console commands automatically when that package exposes a compatible console configurator or command namespace. The integration is optional and safely ignored when the package is not installed.

Framework-provided scaffolding stubs now live under src/Stubs/. If a consuming app wants custom AI helper stubs, override console.stubsPath in config/console.php.