Skip to content
Cilex a lightweight framework for creating PHP CLI scripts inspired by Silex
PHP Puppet
Branch: develop
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.
bin Minor tweaks Nov 20, 2016
.gitignore Remove .idea from gitignore Jun 15, 2016
.travis.yml Update dependencies, bump to 5.5.9 to follow Silex and remove 5.3/5.4… Sep 2, 2015
LICENSE Initial commit Mar 23, 2012

Cilex, a simple Command Line Interface framework

Cilex is a simple command line application framework to develop simple tools based on Symfony2 components:

if (!$loader = include __DIR__.'/vendor/autoload.php') {
    die('You must set up the project dependencies.');

$app = new \Cilex\Application('Cilex');
$app->command(new \Cilex\Command\GreetCommand());
$app->command('foo', function ($input, $output) {
    $output->writeln('Example output');

Cilex works with PHP 5.5.9 or later and is heavily inspired by the Silex web micro-framework by Fabien Potencier.


  1. git clone this repository.
  2. Download composer: curl -s | php
  3. Install Cilex' dependencies: php composer.phar install


  • Create your new commands in src/Cilex/Command/
  • Add your new commands to bin/run.php
  • Run the commands as:
./bin/run.php demo:greet world
./bin/run.php demo:greet world -y
./bin/run.php demo:greet world --yell
./bin/run.php demo:info

Creating a PHAR

  • Download and install box:
curl -LSs | php
chmod +x box.phar
mv box.phar /usr/local/bin/box
  • Update the project phar config in box.json
  • Create the package:
box build
  • Run the commands:
./cilex.phar demo:greet world
./cilex.phar demo:greet world -y
./cilex.phar demo:greet world --yell
./cilex.phar demo:info
  • enjoy a lot.


Cilex is licensed under the MIT license.


Q: How do I pass configuration into the application?

A: You can do this by adding the following line, where $configPath is the path to the configuration file you want to use:

$app->register(new \Cilex\Provider\ConfigServiceProvider(), array('config.path' => $configPath));

The formats currently supported are: YAML, XML and JSON

You can’t perform that action at this time.