setPromptStyle(new Style(Style::BR_GREEN, Style::GREEN)); $myShell->setInputStyle(new Style(Style::BR_CYAN)); // Add a listener to update the prompt $myShell->addListener(Shell::EVT_UPDATE_PROMPT, function ($e) { $e->shell->setPrompt(date("H:i:s").">"); }); // Set the initial prompt, not really needed. $myShell->setPrompt("test>"); // Create an anonymous context and add a command $ctx = $myShell->createContext("root"); $ctx->addCommand("hello", function () { echo "Hello World!\n"; }); // Run the shell $myShell->run();