v2.10.3 2016-11-08 10:12 UTC


Build Status Build status Scrutinizer Code Quality Code Coverage Latest Stable Version License

Genesis is lightweight, smart and easy to use CLI tool, for building (mainly) PHP applications. Usage is similar to Phing, but Genesis is much easier. For configuration is used an .neon file, which is very similar to YAML.


Preferred installation is with Composer.

composer require genesis-php/genesis


This software is developed primarily for UNIX systems (Linux, OSX), but it works also on Windows.

Quick example

Look at the example which gives you quick introduction.
Don't worry, it will take only minute.

Getting started

Initialize build directory in your project: (path to your vendor directory may differ!)
../vendor/bin/genesis self-init

An 'build' directory will be created, with these files:

  • Build.php
    • PHP class with runXyz() methods
      • every public method starting with 'run' is an "Task"
      • in task you can run any code you want
      • there is public method 'setup', it runs slightly after Build class is constructed
    • for example
  • config.neon
    • config in NEON format (very similar to YAML)
    • define parameters and services
    • you can include another configs directly in NEON file:
      - include.neon
    • if you don't want to merge any config variable, add ! (exclamation mark), eg:
      myParam!: unoverrided value
    • for example
  • bootstrap.php (optional)
  • build (optional)
    • shell script which is only shortcut into vendor directory with genesis

Look at the skeleton, how can build directory looks like.


This tool is intended to use via CLI only.

Run it by (path to your vendor directory may differ!):
../vendor/bin/genesis mytask

OR via shortcut, which creates self-init (you may need to edit path to vendor dir in file 'build/build'):
./build/build mytask

You can use any working directory with parameter "--working-dir":

Supported options:

  • --working-dir /var/www/myproject - use specified working directory
  • --colors 0 - disable colored output
  • --config myconfig.neon - use specified config

All arguments are passed to build:

../vendor/bin/genesis mytask foo

Arguments mytask and foo will be available in your build class (property $arguments)


Commands are intended to use them in Tasks. In namespace Genesis\Commands are default commands and of course you can create and use your own commands.


- [Exec]( - executes shell command - returns an [ExecResult]( including return code and output - [Git]( - executes Git command & can clone any repository - returns an [ExecResult]( including return code and output - [Help]( - prints list of available tasks to output - list is given in simple array - [NodeJs]( - can install packages (npm install) in any directory - [PhpUnit]( - can run PHPUnit tests in any directory & provides some setup - [NetteTester]( - can run Nette Tester tests in any directory & provides some setup


- [Assets\Gulp]( - Running gulp, usually to build frontend - You can setup gulpfile location - [Assets\Less]( - if you want only compile LESS files on build, you can use this command - using NodeJs lessc tool


- [Filesystem\Filesystem]( - configurable object, intended to use as service - [Filesystem\Directory]( - provides set of methods for manipulating with directories - creating, cleaning (purging), reading - [Filesystem\File]( - provides set of methods for manipulating with files - creating, copying - [Filesystem\Symlink]( - creating symlinks


This set of commands may be useful, if you want to check system some system requirements, usually at the beginning of the build. - [Test\NodeJs]( - tests NodeJs version - [Test\Php]( - tests PHP ini settings - tests if desired extension present - [Test\NodeJs]( - tests if desired programs is installed (on UNIX)


An bootstrap.php in build directory can return instance of Genesis\Config\Container which will be merged into Container created from config.neon