xAI 开源 Grok CLI 代码库中发现 Mermaid 转 Unicode 框图工具
Mermaid to Unicode box art (grok-mermaid)
xAI 开源的 Grok CLI 编码智能体代码库中包含一个用 Rust 编写的 Mermaid 图表示例终端渲染器 `xai-grok-markdown/src/mermaid.rs`。开发者通过 Claude Code for web (Fable 5) 将其编译为 WebAssembly,实现在浏览器中运行该工具。
Simon 从 Grok 源码里扒出终端 Mermaid 渲染器,用 Wasm 带到浏览器,生成 Unicode 图,开发者画流程图的轻量选择。
Simon Willison’s Weblog
Sponsored by: Atlassian — Give your agents a plan. Not a prompt. New Jira capabilities unlock full-context for AI-native software development. Assign tasks to Claude, Cursor, or GitHub Copilot, now directly from Jira. Learn more
ToolMermaid to Unicode box art (grok-mermaid)— Convert Mermaid diagram syntax into terminal-style Unicode box-drawing art rendered entirely in your browser using WebAssembly. The tool supports flowcharts, sequence, state, class, and ER diagrams, with other diagram types falling back to a framed source listing. You can adjust the output width, copy the rendered diagram as text, or generate a shareable link to your diagram.
While exploring the codebase for the newly open-sourced Grok CLI coding agent I came across xai-grok-markdown/src/mermaid.rs, a "self-contained terminal renderer for Mermaid diagrams" written in Rust.
I figured it would be fun to try that out in a browser via WebAssembly. Here's the prompt I ran in Claude Code for web (Fable 5), and this is what the resulting tool looks like:
Posted 16th July 2026 at 12:33 am
来源:Simon Willison 博客 · simonwillison.net