Files
uutils.github.io/content/playground.md
T
Sylvestre Ledru ddd1a9237d Playground: add "How It Works" technical documentation page
Explains the architecture (xterm.js, JS shell, WASI shim, WASM binary),
command lifecycle, pipeline execution, WASM loading, command parsing,
and the Rust side (feat_wasm, multicall binary, WASI adaptations,
locale embedding). Also adds Weblate link for missing translations.
2026-04-04 12:43:52 +02:00

5.1 KiB
Raw Blame History

+++ title = "Playground" template = "page.html" +++

Try uutils coreutils directly in your browser! This interactive terminal runs Rust coreutils via WebAssembly — no installation needed.

English (en-US) Missing a translation or your language? Help translate on Weblate
<script src="/wasm/locales.js" defer></script> <script src="/js/wasm-terminal.js" defer></script> <script defer> document.addEventListener("DOMContentLoaded", function() { initPlayground("wasm-playground"); // Populate the locale dropdown from the build-generated list if (typeof WASM_LOCALES !== "undefined") { var sel = document.getElementById("locale-select"); WASM_LOCALES.forEach(function(loc) { if (loc === "en-US") return; // already the default option var opt = document.createElement("option"); opt.value = loc; opt.textContent = loc; sel.appendChild(opt); }); } }); </script>

Try it out

Click an example to run it in the terminal:

seq 1 20 | factor sort fruits.txt | uniq -c | sort -rn cut -d, -f2 csv.txt | tail -4 | sort -n echo 'rust coreutils in the browser' | tr a-z A-Z echo 'こんにちは世界' | base64 | base64 -d echo 'Hello, world!' | sha256sum shuf -n3 names.txt | nl seq 100 | shuf -n5 | sort -n paste -d: names.txt numbers.txt | head -5 echo 'مرحبا بالعالم' | wc -c -w printf '🐑\n🐑\n🐑\n🐑\n🐑\n' | nl echo '🍎,🍌,🍒,🥝' | cut -d🍌 -f2 printf '🍒 cherry\n🍎 apple\n🍌 banana\n' | sort -k2 date uname -a
<script> document.querySelectorAll('.playground-example').forEach(function(btn) { btn.addEventListener('click', function() { var cmd = btn.textContent; document.getElementById('wasm-playground').scrollIntoView({ behavior: 'smooth' }); if (window.runInTerminal) { window.runInTerminal(cmd); } }); }); </script>

Sharing commands via URL

You can pre-fill the terminal with a command using the ?cmd= URL parameter. The command runs automatically when the page loads — great for sharing examples or linking from documentation.

Examples:

Multiple commands can be separated by newlines (%0A in the URL):

Available commands

The following commands run as real Rust coreutils compiled to WebAssembly:

arch b2sum base32 base64 basenc basename cat cksum comm cp csplit cut date dir dircolors dirname echo expand expr factor false fmt fold head join link ln ls md5sum mkdir mv nl nproc numfmt od paste pathchk printenv printf pr ptx pwd readlink realpath rm rmdir seq sort split tail touch tr tsort sha1sum sha224sum sha256sum sha384sum sha512sum shred shuf sleep sum tee true truncate uname unexpand uniq unlink vdir wc

The following are shell builtins implemented in JavaScript:

  • help — list available commands and examples
  • clear — clear the terminal screen

Some commands (ex: chcon, runcon, etc) are not yet available in the WASM build because they depend on platform-specific syscalls not fully supported by WebAssembly/WASI yet.

We are actively working on adding more commands as we improve WASI compatibility in uutils coreutils.

Curious about how this all works under the hood? Read the technical deep-dive on the playground architecture.