# Simon Willison — grok-mermaid ports Grok CLI's Rust renderer to the browser

> A Rust Mermaid renderer buried in Grok Build's source, ported to WebAssembly and turned into a shareable browser tool.

- Org: Simon Willison
- Date: 2026-07-16
- Category: article, tool, showcase
- Source: https://simonwillison.net/2026/Jul/16/grok-mermaid/
- Canonical page: https://ai-tldr.dev/releases/simonw-grok-mermaid-jul16/

## In short

Simon Willison found a self-contained Mermaid-to-Unicode renderer in xAI's newly open-sourced Grok Build repo and used Claude Fable 5 to compile the Rust code to WebAssembly, shipping it as a browser tool.

## What it is

grok-mermaid is a browser tool that renders Mermaid diagram syntax as terminal-style Unicode box art. Simon Willison spotted the underlying renderer inside `xai-grok-markdown/src/mermaid.rs` when xAI open-sourced Grok Build under Apache-2.0, then wrapped it for the web.

## How it works

The Rust source ships with no external dependencies, so it compiles cleanly to WebAssembly. Simon fed the file and a target prompt to Claude Code for web (Fable 5), which produced the wasm build plus a page with a textarea for input, a width slider, and share links. Everything runs client-side.

## Why it matters

grok-mermaid is a small but telling artifact of open-sourcing frontier tooling: within a day of the Grok Build release, a useful piece was extracted, ported to a new runtime, and shipped as its own product. It also validates that Fable 5 can drive a non-trivial Rust-to-WASM port end-to-end from a single prompt.

## Who it's for

developers who want diagram-friendly output in terminals or docs

## Try it

https://tools.simonwillison.net/grok-mermaid

## Links

- [Simon's Writeup](https://simonwillison.net/2026/Jul/16/grok-mermaid/)
- [Live Tool](https://tools.simonwillison.net/grok-mermaid)
- [Grok Build Repo](https://github.com/xai-org/grok-build)
- [Port PR](https://github.com/simonw/tools/pull/293)
