on('prompt', function ($shell) { $shell->setPrompt(date("H:i:s> ")); }); // Input handler, parse the commands. $shell->on('input', function (array $input) use ($shell) { $shell->write("You entered: ".join(" ", $input)."\n"); }); // The shell is an OutputStream, and writing to it will handle hiding the prompt // and redrawing it afterwards! $shell->write("Hello World!\n\n"); // So output can be writen while you are typing! Loop::addPeriodicTimer(5, function () use ($shell) { $shell->write(date(DATE_ATOM)."\n"); });