This looks like it really wants to integrate https://github.com/asciinema/asciinema to record and replay interactions. It might also be useful to check out https://github.com/oilshell/oil/wiki/Headless-Mode