Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Failed to load latest commit information.
Latest commit message
Commit time
December 6, 2022 15:00
April 25, 2016 13:24
September 22, 2023 07:42
April 30, 2023 14:50
April 30, 2023 13:54
November 23, 2021 17:17
April 30, 2023 13:54


Modern and simple PHP task runner inspired by Gulp and Rake aimed to automate common tasks:

Gitter Latest Stable Version Latest Unstable Version Total Downloads

ci scrutinizer codecov license

  • writing cross-platform scripts
  • processing assets (less, sass, minification)
  • running tests
  • executing daemons (and workers)
  • watching filesystem changes
  • deployment with sftp/ssh/docker


Branch Support Level Symfony League Container psr/log PHP Versions
4.x Stable 6 3 2 - 3 8.0 - 8.1
3.x Important fixes only 4 - 6 3 1 - 2 7.1 - 8.1
2.x Not recommended 4 - 5 2 1 - 2 7.1 - 7.4
1.x Not recommended 2 - 4 2 1 - 2 5.5 - 7.4

All three branches of Robo are currently supported, although the 2.x and 1.x branches receive minimum support. All versions are roughly compatible; the breaking changes introduced at each major version are fairly minor, and typically only affect classes that are not used by most clients.



Download robo.phar >


To install globally put robo.phar in /usr/bin. (/usr/local/bin/ in OSX 10.11+)

chmod +x robo.phar && sudo mv robo.phar /usr/bin/robo

OSX 10.11+

chmod +x robo.phar && sudo mv robo.phar /usr/local/bin/robo

Now you can use it simply via robo.


  • Run composer require consolidation/robo:^4
  • Use vendor/bin/robo to execute Robo tasks.


All tasks are defined as public methods in RoboFile.php. It can be created by running robo init. All protected methods in traits that start with task prefix are tasks and can be configured and executed in your tasks.


The best way to learn Robo by example is to take a look into its own RoboFile or RoboFile of Codeception project. There are also some basic example commands in examples/RoboFile.php.

Here are some snippets from them:

Run acceptance test with local server and selenium server started.


use Robo\Symfony\ConsoleIO;

class RoboFile extends \Robo\Tasks

    function testAcceptance(ConsoleIO $io, $seleniumPath = '~/selenium-server-standalone-2.39.0.jar')
       // launches PHP server on port 8000 for web dir
       // server will be executed in background and stopped in the end

       // running Selenium server in background
       $this->collectionBuilder($io)->taskExec('java -jar ' . $seleniumPath)

       // loading Symfony Command and running with passed argument
       $this->collectionBuilder($io)->taskSymfonyCommand(new \Codeception\Command\Run('run'))

If you execute robo you will see this task added to list of available task with name: test:acceptance. To execute it you should run robo test:acceptance. You may change path to selenium server by passing new path as a argument:

robo test:acceptance "C:\Downloads\selenium.jar"

Using watch task so you can use it for running tests or building assets.

class RoboFile extends \Robo\Tasks {

    function watchComposer(ConsoleIO $io)
        // when composer.json changes `composer update` will be executed
        $this->collectionBuilder($io)->taskWatch()->monitor('composer.json', function() use ($io) {

Cleaning logs and cache

class RoboFile extends \Robo\Tasks
    public function clean(ConsoleIO $io)


This task cleans app/cache and app/logs dirs (ignoring .gitignore and .gitkeep files) Can be executed by running:

robo clean

Creating Phar archive

function buildPhar(collectionBuilder $io)
    $files = Finder::create()->ignoreVCS(true)->files()->name('*.php')->in(__DIR__);
    $packer = $this->collectionBuilder($io)->taskPackPhar('robo.phar');
    foreach ($files as $file) {
        $packer->addFile($file->getRelativePathname(), $file->getRealPath());

We need more tasks!

Create your own tasks and send them as Pull Requests or create packages with "type": "robo-tasks" in composer.json on Packagist.


Follow @robo_php for updates.

Brought to you by Consolidation Team and our awesome contributors.