zx looks super interesting! I’m building something very similar, except using Python as the language instead of JS: https://github.com/yrahul3910/pysh
I’ll try out zx though, it looks cool, although I’d be worried about Google ditching it in the future.
I’m writing my own: https://github.com/yrahul3910/pysh
If you’re going to post a code example, at least check that it works. Here’s your example, with no type hints, giving me errors both from the LSP, and when trying to run via mypy: https://imgur.com/a/Hq5Y5Gt.