Skip to content
/ silly Public

Silly CLI micro-framework based on Symfony Console

License

Notifications You must be signed in to change notification settings

mnapoli/silly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Oct 30, 2024
b56a167 · Oct 30, 2024
Jan 18, 2024
Oct 14, 2019
Oct 30, 2024
Jul 16, 2023
Apr 20, 2015
Feb 12, 2015
Dec 26, 2018
Jul 19, 2018
Jul 19, 2018
Dec 1, 2017
Apr 12, 2015
Apr 4, 2015
Oct 30, 2024
Aug 9, 2019
Jan 18, 2024
Dec 30, 2015
Feb 12, 2015

Repository files navigation

currentMenu
home

Silly CLI micro-framework based on Symfony Console.

Build Status Coverage Status Scrutinizer Code Quality Packagist

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.