go-bash-wasm is a Go implementation of GNU Bash and Coreutils for WebAssembly, featuring a fully isolated in-memory filesystem. It enables running a shell environment in browsers and other sandboxed environments.
Demo: https://bash.devops-playground.dev/
ls flag support).js/wasm and wasip1/wasm. Integrated with xterm.js for browser terminals.afero for total host isolation. Zero disk I/O.zerolog with browser console support.cmd/go-bash-wasm/: Entry points for native (main.go) and JS/WASM (main_js.go).internal/shell: Execution engine using mvdan.cc/sh/syntax.internal/commands: Coreutils implementation.ui: Svelte 5 frontend with xterm.js components.Dockerfile: Multi-stage builds for browser (Nginx) and CLI (Wasmtime).go run ./cmd/go-bash-wasm/
GOOS=js GOARCH=wasm go build -o ui/static/main.wasm ./cmd/go-bash-wasm/
cp $(go env GOROOT)/lib/wasm/wasm_exec.js ui/static/
cd ui && npm install && npm run dev
Accessible at http://localhost:5173.docker build -t go-bash-ui -f ui.Dockerfile .
docker run -it --rm -p 8080:80 go-bash-ui
docker build -t go-bash-cli -f Dockerfile .
docker run -it --rm go-bash-cli
go test -v ./...
cd ui && npm run test
docker build -f ui.Dockerfile .
Developed by the go-bash-wasm team. Aiming for 100% functional parity with GNU tools.