This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Bundle for generating Symfony2 commands

dev-master 2014-06-13 14:48 UTC

This package is auto-updated.

Last update: 2021-10-29 01:36:10 UTC


Install this bundle using Composer. Register the bundle in app/AppKernel.php, then run:

app/console generate:console-command

You will be asked to supply some information, after which a command class will be auto-generated for you.


The resulting console command would look like this:

namespace Matthias\Bundle\DemoBundle\Command;

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class CreatePostCommand extends ContainerAwareCommand
    protected function configure()
            ->addArgument('title', InputArgument::REQUIRED, null, null)

    protected function execute(InputInterface $input, OutputInterface $output)