All it needs is an API and you could easily build a tool which does just that.
Though if you wanted it to actually explain `cat foo.txt > out.txt` and not just output the explanation for `cat foo.txt` to `out.txt` you'd probably have to put that in quotes.
e.g. explain cat foo.txt > out.txt