rudra / cli
Cli Application
v26.7
2026-06-23 11:40 UTC
Requires
- php: ^8.3
- rudra/container: v26.7
- rudra/exception: v26.7
README
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.
Install
composer require rudra/cli
Usage
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);
Run via PHP:
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!!!
Or make it executable and run directly:
chmod +x rudra
./rudra spongebob
License
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/