How to turn any PHP class into cli commands without writing a line of code? Use cli-maker and you won't have to write any additional code, just simple config array.
Cli-maker is powerful and easy to use library that allows you to generate cli commands from given PHP classes. Before we move forward you must be aware that cli-maker works only with PHP 7 and above.
On the root level of your application create cli-maker.php file. Future version of this library will allow you to choose location of this file.
Add all class names you want to access from command line into this file. Currently library requires all class names to be unique (even if classes are using different namespaces). This will change in future version.
To list all available commands run
To run single command simply add it after cli-maker script.
If converted method accepts parameters, you can add them in the same order as they were defined in your method. If you want to check those parameters you can use --help option.
Last but not least. This is the very first version of cli-maker. Hence you will see rapid improvements in next weeks. It would be great if you would leave feedback.