<?php use App\Console\Application; use App\Console\Command\ServeCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; $console = new Application($app, 'My Silex Application', 'n/a'); $console->getDefinition()->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'The Environment name.', 'dev')); $console->setDispatcher($app['dispatcher']); $console->add(new ServeCommand()); // Add commands here return $console;