This is shish itself, compiled to WebAssembly (188 KB), running in your browser. Nothing is sent anywhere — the shell, its in-memory filesystem and your commands never leave the tab.
Each run is one shish -c <script>. The
filesystem persists between runs on this page; reloading resets it.
There are no processes in a browser, so pipelines between two external
commands and background jobs cannot work — everything that runs
in-process does. See WebAssembly.
This is shformat (the same parser as
shish, reused for pretty-printing) in a separate,
~70 KB WASM module with no interpreter in it at all — it only
parses and re-prints. A syntax error is reported here instead of
reformatted output.
This is shparse2ast's JSON tree — node
names are POSIX Shell Command Language grammar rules, not shish's
internal C enum names. "rename" is a visitor over this same JSON:
it finds the declaring assignment and every $name/
${name} reference (using each node's loc),
then splices the new name into the original source text —
nothing is re-generated from the tree, so formatting outside the
renamed spans is untouched.
A visitor is a plain JS function (ast, source, shish)
run against the script parsed above: ast is its JSON tree
(same shape as the explorer above), source is the
original text, and shish exposes walk
(visits every node with a kind) and spliceEdits.
Return either a whole new source string, or an array of
{offset, length, text} edits into the original text --
either way the result is re-parsed to check it's still valid shell.