ali-eltaweel / cli-app
There is no license information available for the latest version (0.8.0) of this package.
CLI application skeleton for PHP projects.
0.8.0
2026-03-03 01:08 UTC
Requires
- php: ^8.1
- ali-eltaweel/command-parser: ^1.2.0
README
CLI application skeleton for PHP projects
Installation
Install cli-app via Composer:
composer require ali-eltaweel/cli-app
Usage
Defining Application
use App\CLI\CliApplication; use CommandParser\Specs\Command; class MyApp extends CliApplication { protected static function getCommandSpecs(): Command { return new Command('my-app'); } protected function setup(): void { // this code runs once at the start } protected function loop(): void { // this code runs repeatedly } }
Running Application
MyApp::main(...$argv);
Run as Daemon
class MyApp extends CliApplication { protected function setup(): void { $this->daemonize(); } }