mnapoli / silly
Silly CLI micro-framework based on Symfony Console
Installs: 9 392 544
Dependents: 138
Suggesters: 3
Security: 0
Stars: 922
Watchers: 19
Forks: 52
Open Issues: 4
Requires
- php: >=7.4
- php-di/invoker: ~2.0
- psr/container: ^1.0|^2.0
- symfony/console: ~3.0|~4.0|~5.0|~6.0|~7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.12
- mnapoli/phpunit-easymock: ~1.0
- phpunit/phpunit: ^6.4|^7|^8|^9|^10
README
Silly CLI micro-framework based on Symfony Console.
Professional support for Silly is available via Tidelift
Installation
$ composer require mnapoli/silly
Usage
Example of a Silly application:
use Symfony\Component\Console\Output\OutputInterface; $app = new Silly\Application(); $app->command('greet [name] [--yell]', function ($name, $yell, OutputInterface $output) { $text = $name ? "Hello, $name" : "Hello"; if ($yell) { $text = strtoupper($text); } $output->writeln($text); }); $app->run();
Running the application is the same as running any other Symfony Console application:
$ php application.php greet Hello $ php application.php greet john --yell HELLO JOHN $ php application.php greet --yell john HELLO JOHN
Silly\Application
extends Symfony\Console\Application
and can be used wherever Symfony's Application can.
Documentation
Do more
Silly is just an implementation over the Symfony Console. Read the Symfony documentation to learn everything you can do with it.
Example applications
Interested in seeing examples of Silly applications? Have a look at this short selection:
Contributing
See the CONTRIBUTING file.