Rudra-Cli | API
The CLI component of Rudra Framework. Lightweight, straightforward, built on the KISS principle. No hidden dependencies, no magic — just clean, predictable command routing.
composer require rudra/cli
Create a file named rudra:
#!/usr/bin/php
<?php
if (php_sapi_name() !== 'cli') {
exit;
}
require __DIR__ . '/vendor/autoload.php';
use Rudra\Cli\Console;
use Rudra\Cli\Tests\App\Command\TestCommand;
parse_str(implode('&', array_slice($argv, 1)), $inputArgs);
$console = new Console();
$console->addCommand('spongebob', [TestCommand::class]);
$console->addCommand('second', [TestCommand::class, 'actionSecond']);
$console->invoke($inputArgs);php rudra spongebob
- Are you ready, kids? Say AYE, captain: yes
- I can't hear you!!!
php rudra spongebob
- Are you ready, kids? Say AYE, captain: AYE
- Who lives in a pineapple under the sea?! SPONGEBOB SQUAREPANTS!!!
chmod +x rudra
./rudra spongebob
This project is licensed under the Mozilla Public License 2.0 (MPL-2.0) — a free, open-source license that:
- Requires preservation of copyright and license notices,
- Allows commercial and non-commercial use,
- Requires that any modifications to the original files remain open under MPL-2.0,
- Permits combining with proprietary code in larger works.
📄 Full license text: LICENSE
🌐 Official MPL-2.0 page: https://mozilla.org/MPL/2.0/