The [cmd module](https://docs.python.org/3/library/cmd.html) in the python standard lib would be good for creating a new CAOS repl.