fidry/console
Lightweight, robust wrapper around symfony/console. Uses a single IO object (SymfonyStyle-like, with access to Input/Output) plus typed, validated args/options. Prefer explicit interfaces over inheritance; works with Symfony or standalone CLI apps.
Console component, making it a natural fit for Laravel applications that rely on Symfony’s console tools (e.g., Artisan commands). It maintains compatibility with Laravel’s service container and command registration patterns.Console while avoiding the "god class" anti-pattern (e.g., SymfonyStyle). This aligns with Laravel’s preference for modular, composable components.Input/Output objects and service container integration. The FidryConsoleBundle (Symfony) can be adapted for Laravel via manual service registration or a custom bundle.asStringNonEmptyList(), asNullablePositiveInteger()), which improves command robustness. Laravel’s PHP 8+ support makes this a low-risk addition.Console. Benchmarking may be needed for high-frequency commands.Console for Laravel’s use case?IO interface? Will a wrapper or adapter be needed?Console?Command interface replaces Laravel’s Illuminate\Console\Command.Input/Output objects, so existing Symfony-based CLI tools (e.g., Doctrine commands) can integrate with minimal changes.IO interface.SymfonyStyle and IO during transition.console.command tag (Laravel’s equivalent of Symfony’s fidry.console_command).// app/Providers/AppServiceProvider.php
public function register()
{
$this->app->bind(
\Fidry\Console\Command\Command::class,
\App\Console\Commands\CreateUserCommand::class
);
}
Artisan class to recognize Fidry\Console\Command implementations.SymfonyStyle methods not supported by IO. A migration tool could auto-generate adapters.symfony/console (already a Laravel dependency), so no additional vendor bloat.Handle trait or Command facade, but these can be replicated with interfaces.SymfonyStyle with IO in new commands.IO inputs).theofidry/console) to monitor, but minimal overhead.Console will adapt quickly, but Laravel’s Artisan users may need training on the IO interface.null").IO interface is stateless.Console.SymfonyStyle. Test thoroughly with edge cases (e.g., ANSI color codes, multi-line output).Bus for queued commands).IO interface, focusing on:
asString(), asPositiveInteger()).SymfonyStyle alternatives.php artisan make:fidry-command) to scaffold commands with the new interface.How can I help you explore Laravel packages today?