Readline is a great php library which is designed for CLI SAPI. It allows us to use history, backspaces and autocomplete our terminal service.