· via Hacker News – Front Page (native)
Lazydraw is a terminal editor for ASCII diagrams with export and clipboard support
Lazydraw, an open-source terminal editor for ASCII diagrams that surfaced on Hacker News, ports ASCIIFlow's drawing engine to the terminal and exports to text files or the clipboard.
An open-source tool called lazydraw reached the front page of Hacker News on September 24, giving developers a way to sketch ASCII diagrams without leaving the terminal. According to the project's README on GitHub, the editor covers boxes, arrows, lines, text and an eraser, and can export the result to a text file or straight to the clipboard.
ASCIIFlow's engine, rebuilt for the terminal
The README is unusually open about the project's lineage. It credits ASCIIFlow by Lewis Hemens as the original web-based editor that lazydraw aims to replicate in a terminal, and lazydraw's core drawing code — glyph connection, snapping, line routing, and the box, line, select and move tools — is ported from ASCIIFlow's client code. termDRAW by Ben Vinegar is credited with showing that this class of editor can work in a terminal and with shaping the rendering approach, while the front end is built on OpenTUI, a terminal UI engine by SST.
What the editor does
The toolbar offers six tools. Boxes are drawn by dragging corner to corner, arrows and lines by dragging from start to end, with a mid-drag flip for the elbow, and the select tool moves boxes while keeping attached arrows connected. Text works as click-and-type, and the eraser detaches lines it touches. Undo and redo, plus copy, cut and paste of selections with bracketed-paste support, round out the basics.
The export dialog is where the tool earns its keep for documentation work: extended or basic character sets, 11 comment styles, an optional Markdown fence, and a preview before copying or saving. There is also a headless path — lazydraw export architecture --basic --comment hashes --fenced -o diagram.txt — which produces a diagram without opening the UI at all, making scripted or repository-checked-in diagrams possible.
Drawings autosave 500 ms after each change and again on quit, stored as .ld. files under the XDG data directory, and a manager handles switching, renaming, forking, importing and deleting them. Visually, the grid comes in lattice, checker, dot or off styles, and the default theme queries the terminal's own color palette so the app blends in; ten IDE themes such as dracula, nord and tokyo-night are available, with nord as the fallback.
Setup and known quirks
lazydraw runs on the Bun runtime, so Bun 1.3 or later is required, along with a terminal with mouse support. Installation is bun install -g lazydraw, and npm works too. The project also ships a plugin manifest for the herdr multiplexer, letting the canvas live as a pane split beside whatever you are working on, with keybindings added in herdr's own configuration file.
The README documents the rough edges: tmux needs set -g mouse on, and clipboard copies through OSC 52 need set -g set-clipboard on; on macOS, Alt+digit shortcuts require enabling the Option-as-Meta terminal setting.
Validated against the original
The codebase separates src/core, pure TypeScript with no terminal code, from src/tui, the OpenTUI front end. That split lets the test suite go beyond ordinary checks: fixture files are golden outputs generated by replaying scenarios through ASCIIFlow's own code, and the suite also runs ASCIIFlow's spec files against lazydraw's core through a compatibility shim. The project effectively grades itself against the tool it imitates.
Why it matters
ASCII diagrams remain one of the few diagram formats that travel well — they render in terminals, code comments, commit messages, diffs and plain Markdown. The usual workflow of hopping to a browser tool and pasting the result back breaks flow, and lazydraw keeps that entire loop inside the terminal. The export options aim squarely at where these diagrams land, with comment styles and Markdown fences for documentation and a basic-character mode for restrictive contexts. Because the drawing engine is a port tested against ASCIIFlow's own specs, users of the original get familiar behavior rather than an approximation. The trade-offs — a Bun dependency and some terminal-specific setup — are documented up front, which is more than many side projects manage.
- #terminal
- #ascii
- #diagrams
- #open-source
- #developer-tools