#!/usr/bin/php setHelp('A very minimal example that does nothing but print a version'); $options->registerOption('version', 'print version', 'v'); } // implement your code protected function main(Options $options) { if ($options->getOpt('version')) { $this->info('1.0.0'); } else { echo $options->help(); } } } // execute it $cli = new Minimal(); $cli->run();