I wish that xonsh took some inspiration from this, allowing "super commands" that return python objects, which can then be piped to normal commands. I want to be able to do things like
for file in ls:
if file.is_mount():
try: fusermount -u @(file)
except: print(f"Couldn't unmount {file}")
Or more complicated stuff involving piping actual live python objects around. Xonsh is great, but the lack of what you're calling "super commands" does limit things a fair bit.
Right now I can do similar stuff, but I often end up doing horrible things like
for file in $(ls).split("\n"):
file=Path(file)
which is not nearly as elegant, especially for more complicated stuff. Lots of places for issues to sneak in, like I'm pretty sure that splitting the output of ls like I did there gives me an extra null directory at the end of the output, not an issue here but it is one more spot for bugs to sneak in.
Of course the other problem with these "super commands" is that they all have to exist in your master shell process. I wonder if you could use something like RPyC to have live python objects that are fully interactable but which live in other processes.