Introduction

What Lifo is, why it exists, and how it differs from containers and WASM sandboxes.

Lifo is a tiny Linux-like VM written in pure TypeScript. It gives you a real filesystem, a bash-like shell, 60+ coreutils, a Node.js compatibility layer, and a package manager — running in a browser tab, server-side in Node, and even on the edge (Cloudflare Workers, Vercel Edge, Deno), with the same code.

It is not a Linux distribution, and it uses no WebAssembly. There is no kernel image, no emulator, and no native binaries. Instead, Lifo reimplements the Linux/POSIX APIs that real programs depend on — fs, http, child_process, a shell grammar, process semantics — directly in JavaScript.

Why that matters

Most "run X in the browser" projects ship a compiled Linux (or a language runtime) as WebAssembly and emulate a machine. That works, but it costs you a multi-megabyte WASM payload, a cold boot while it initializes, and a hard wall at the boundaries of what was compiled in.

Lifo takes the opposite bet: map the APIs, not the machine.

  • Instant boot. There's no image to download or VM to warm up — a box is a few JavaScript objects. Boot is sub-millisecond.
  • Tiny footprint. It's TypeScript that tree-shakes and minifies like any other dependency, not a WASM blob.
  • Runs anywhere JavaScript runs. Because it's pure JavaScript with an in-memory filesystem and no native dependencies, the same VM works in a browser tab, in Node, and in edge runtimes (Cloudflare Workers, Vercel Edge, Deno) — so agent code you sandbox client-side behaves the same server-side or at the edge.
  • Debuggable. When something breaks, it's a stack trace in your own code, not an opaque syscall inside an emulator.

The tradeoff is honest: Lifo can't run arbitrary native ELF binaries. What it can do is run real developer tooling — npm, git, Vite, Expo, Supabase (via tinbase) — unmodified, because that tooling is JavaScript talking to Node APIs, and those APIs are exactly what Lifo implements.

Note

Think of Lifo as the justbash idea taken all the way: a sandboxed userland in pure TypeScript, but with enough of Node and a virtual network that full dev servers run inside it.

What you can build with it

  • A sandbox for untrusted / agent-generated code — run it client-side or server-side with no container infrastructure.
  • A full-stack dev environment in the browser — real dev servers with live previews and HMR, for web and mobile (Expo).
  • A disposable box per agent, per project, or per request — spin one up and throw it away.
  • An edge-first bash — a shell and coreutils wherever JavaScript runs.

Where to go next

  • Quick start — boot a box and run your first commands.
  • Architecture — how the kernel, shell, and Node layer fit together (and a longer answer to "why not WASM?").
  • The Node runtime — how node script.js actually works inside the VM.