add('help', function ($args, $shell) { $shell->write("This could be usage help :)\n"); $shell->write("Exit by pressing ^C\n"); }); $commands->on('command', function ($command, $args, $shell) { $shell->write("Bad command '{$command}', try help.\n"); $shell->write("Arguments passed: ".json_encode($args)."\n"); }); $shell->on('prompt', function ($shell) { $shell->setPrompt(">> "); }); $shell->on('input', $commands);