Download the PHP package lawondyss/parex-commander without Composer
On this page you can find all versions of the php package lawondyss/parex-commander. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package parex-commander
Parex Commander
Parex Commander is a lightweight PHP library designed to simplify the creation of interactive CLI applications. It provides a structured and intuitive way to define commands, handle input/output, and manage the overall flow of your application.
Built on top of the Parex library.
Key Features
- Command-Based Structure: Organize your CLI application into logical commands, each with its own set of arguments and options.
- Simplified Input/Output: Easily handle user input and format output using the built-in IO system.
- Extensible: Easily extend the core functionality with your own custom commands and features.
- Clean and Readable Code: Designed with a focus on code clarity and maintainability.
Installation
You can install Parex Commander via Composer:
Core Components
ParexCommander
The ParexCommander
class is the heart of your CLI application. It's responsible for:
- Registering and managing commands.
- Parsing user input and routing it to the appropriate command.
- Handling the overall execution flow.
Example:
See example for more.
Command
The Command
class represents a single command within your application. It allows you to:
- Define the command's name, description, and version.
- Specify the arguments and options that the command accepts.
- Implement the command's logic in a handler function or invokable class.
Example:
Or you can use the class on its own, see example for more.
IO
The IO
class provides a simple and consistent way to interact with the user. It handles:
- Writing output to the console.
- Asking questions.
- Requires confirmation.
- Offers a selection of.
Better see example.
Note
All examples are executable, just try them out 😉