I'm not sure if this particular tool makes use of it but saws uses the python-prompt-toolkit - https://github.com/jonathanslenders/python-prompt-toolkit
Python Prompt Toolkit is pretty stellar, enough so to motivated writing a command line interface in Python instead of another language in my opinion.