1. Go to this page and download the library: Download beauty-framework/cli library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
beauty-framework / cli example snippets
#!/usr/bin/env php
use Beauty\Cli\ConsoleKernel;
_DIR__ . '/config/cli.php';
$kernel = new ConsoleKernel($commands);
exit($kernel->run($argv));
class MyCommand extends AbstractCommand {
public function name(): string
{
return 'my:command';
}
public function description(): string
{
return 'Do something cool';
}
public function handle(array $args): int
{
CliOutput::success('It worked!');
return 0;
}
}