OK so how would this work? Say I'm doing filesystem operations, using git etc, and I want to do something related to that with an interactive UI. How do I "get from" the terminal into a web UI? Or am I doing filesystem operations and using git etc in the web UI from the start?
Look at the DEC SGR codes as a markup. Most CLI progs automatically include/exclude them depending on whether the output is a tty or not. Many also have flags to force enable/disable them. It is entirely do-able to add an HTML output mode for pretty-print, auto enable/disable it depending on $TERM, and use some browser thing as your terminal. That way, webshitters can get all of the webshit they want, and my VT220 stuff keeps working.