Files
uutils.github.io/content/playground.md
T
Sylvestre Ledru 5c22a5b3d6 Add interactive WASM playground for uutils coreutils
A browser-based terminal that runs real Rust coreutils compiled to
WebAssembly (wasm32-wasip1) using @bjorn3/browser_wasi_shim.

Features:
- xterm.js terminal with command history and line editing
- Pipe support (cmd1 | cmd2 | cmd3), file redirects (>)
- Persistent virtual filesystem across commands
- cd/pwd builtins with virtual working directory
- Locale support (locale builtin + selector)
- UTF-8/multibyte correct output (raw ConsoleStdout, fixed args_sizes_get)
- Click-to-run example buttons
- Inline wasm_example shortcode for blog posts
2026-04-03 21:47:38 +02:00

3.6 KiB

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

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

<script src="/js/wasm-terminal.js" defer></script> <script defer> document.addEventListener("DOMContentLoaded", function() { initPlayground("wasm-playground"); }); </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 seq 1 15 | fmt -w 40 echo '🍎,🍌,🍒,🥝' | cut -d🍌 -f2 printf '🍒 cherry\n🍎 apple\n🍌 banana\n' | sort -k2 date
<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>

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 are not yet available in the WASM build because they depend on platform-specific syscalls not fully supported by WebAssembly/WASI.
chcon and runcon are excluded as they require SELinux, which is not relevant in a browser environment.
We are actively working on adding more commands as we improve WASI compatibility in uutils coreutils.