- What is innmind/cli used for?
- innmind/cli is a PHP framework for building command-line applications. You define commands declaratively, parse arguments and options, and handle input/output through small composable interfaces. It is part of the Innmind ecosystem and favors explicit objects over magic so console apps are easier to test and extend.
- How do I install innmind/cli?
- Install it with Composer using composer require innmind/cli. Composer will resolve the package and its dependencies from Packagist. Then include Composer's autoloader in your CLI entry point.
- Does innmind/cli work with Laravel?
- innmind/cli is framework-agnostic PHP, so it can be installed in a Laravel application via Composer. It does not appear to depend on Laravel, so you would wire commands into your own console entry point rather than expecting Artisan integration. For Laravel-native commands, Artisan remains the default choice.
- How do I define a command in innmind/cli?
- Commands are defined declaratively, typically by describing the command name, arguments, options, and handler as explicit objects. The framework then parses input and routes it to the matching command. Check the package documentation for the exact interfaces and composition style.
- How are arguments and options parsed in innmind/cli?
- innmind/cli handles parsing of command-line arguments and options as part of its command definition and dispatch flow. You declare the expected inputs, and the framework maps raw CLI input to them. This keeps parsing separate from business logic and makes commands easier to test.
- Can I test CLI applications built with innmind/cli?
- Yes, the design favors small composable interfaces and explicit objects, which makes commands easier to unit test. You can test command behavior by supplying inputs and checking outputs through the interfaces rather than relying on magic. This testability is a key goal of the framework.
- How does innmind/cli handle input and output?
- Input and output are handled through small composable interfaces. That means you can swap or wrap I/O implementations, making console apps easier to test and integrate with other components. It avoids hard-coding global stdin and stdout behavior into command logic.
- Is innmind/cli a replacement for Laravel Artisan?
- No, innmind/cli is a general PHP CLI framework, not a Laravel console component. Artisan is Laravel's built-in command runner and provides framework-specific integration. You could use innmind/cli alongside Laravel for standalone CLI tooling, but it does not replace Artisan's Laravel hooks.
- What PHP versions or Laravel versions does innmind/cli support?
- The provided overview does not specify PHP or Laravel version constraints. Check the package's composer.json and Packagist metadata for the exact PHP requirement and dependency constraints. Because it is framework-agnostic, Laravel version support depends on your application's PHP and Composer compatibility.
- What are good alternatives to innmind/cli?
- Common PHP CLI options include Symfony Console, Laravel Artisan for Laravel-native commands, and lightweight tools such as Minicli or Laravel Zero for standalone apps. innmind/cli differentiates itself through declarative command definitions, composable I/O interfaces, and explicit objects. Choose based on how much framework integration versus minimal composition you want.