https://github.com/mnapoli/silly
Silly CLI micro-framework based on Symfony Console
https://github.com/mnapoli/silly
cli micro-framework php symfony-console
Last synced: 4 days ago
JSON representation
Silly CLI micro-framework based on Symfony Console
- Host: GitHub
- URL: https://github.com/mnapoli/silly
- Owner: mnapoli
- License: mit
- Created: 2015-02-12T08:26:55.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2024-10-30T12:32:35.000Z (6 months ago)
- Last Synced: 2025-04-10T13:17:20.155Z (5 days ago)
- Topics: cli, micro-framework, php, symfony-console
- Language: PHP
- Homepage:
- Size: 543 KB
- Stars: 924
- Watchers: 18
- Forks: 52
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-cli-frameworks - Silly - framework based on Symfony Console. ([PHP](https://www.php.net/) / Useful awesome list for Go cli)
- awesome-php - Silly - A micro-framework for CLI applications. (Table of Contents / Micro Frameworks)
- awesome-projects - Silly - A micro-framework for CLI applications. (PHP / Micro Frameworks)
- awesome-php - Silly - A micro-framework for CLI applications. (Table of Contents / Micro Frameworks)
- awesome-php-cn - Silly - micro-framework CLI应用程序. (目录 / 微框架 micro-frameworks)
README
---
currentMenu: home
---
Silly CLI micro-framework based on Symfony Console.[](https://travis-ci.org/mnapoli/silly)
[](https://coveralls.io/r/mnapoli/silly?branch=master)
[](https://scrutinizer-ci.com/g/mnapoli/silly/?branch=master)
[](https://packagist.org/packages/mnapoli/silly)Professional support for Silly [is available via Tidelift](https://tidelift.com/subscription/pkg/packagist-mnapoli-silly?utm_source=packagist-mnapoli-silly&utm_medium=referral&utm_campaign=readme)
- [Video introduction in french](https://www.youtube.com/watch?v=aoE1FDN5_8s)
## Installation
```bash
$ composer require mnapoli/silly
```## Usage
Example of a Silly application:
```php
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:
```bash
$ 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
- [Command definition](docs/command-definition.md)
- [Command callables](docs/command-callables.md)
- [Console helpers](docs/helpers.md)
- [Dependency injection](docs/dependency-injection.md)
- [The PHP-DI edition](docs/php-di.md)
- [The Pimple edition](docs/pimple.md)## Do more
Silly is just an implementation over the Symfony Console. Read [the Symfony documentation](http://symfony.com/doc/current/components/console/introduction.html) to learn everything you can do with it.
## Example applications
Interested in seeing examples of Silly applications? Have a look at this short selection:
- [Bref](https://github.com/mnapoli/bref/blob/c11662125d3d6cf3f96ee82c9e6fc60d9bcbbfdd/bref)
- [Laravel Valet](https://github.com/laravel/valet/blob/7ed0280374340b30f1e2698fe85d7db543570f57/cli/valet.php)
- [Blacksmith](https://github.com/mpociot/blacksmith/blob/320e97b9677f9e885d1f478593143f329afb9510/blacksmith)
- [Documentarian](https://github.com/mpociot/documentarian/blob/34189ff3357aa3b013930b471410f135f09792de/documentarian)## Contributing
See the [CONTRIBUTING](CONTRIBUTING.md) file.