Lucid Train compared with D2.
D2 is a language you write. Lucid Train reads the code and writes the graph for you.
D2 is an open-source language that turns declarative text into diagrams, with a CLI that has a watch mode, works offline and exports SVG, PNG and PDF, and a choice of three layout engines. It is one of the better diagram-as-code options precisely because layout quality was a design goal rather than an afterthought. Lucid Train is not a diagram-as-code tool at all: there is no language you write. An agent reads your repository and emits a semantic graph, and a constraint solver draws it.
What a text source genuinely buys you
A D2 file lives in the repository, diffs in a pull request and is versioned with the code it describes. A reviewer can see exactly what changed about the architecture in the same review as the code change. That property is real and valuable, and it is the strongest argument for diagram-as-code over any canvas tool including this one.
The cost is authorship
Somebody writes and maintains the D2 file. That is the same maintenance burden every hand-authored diagram carries, and it is why diagram-as-code files drift too: nothing fails when the code changes and the diagram does not. Generating from the codebase moves that from a discipline to a command.
Layout, from two directions
D2 offers a choice of layout engines and takes layout quality seriously, which is a genuine differentiator among text diagram languages. Lucid Train runs ELK over a graph that has no coordinates in it anywhere, so overlaps are not merely rare but cannot be expressed. Both are choosing a solver over manual placement; they differ in who writes the input.
Offline and open source
D2 is fully open source and its CLI runs with no network, which puts it in the same bracket as Lucid Train's CLI for teams with restrictions. Lucid Train's own CLI is free and open source, and the desktop app runs offline against local models. Neither of these requires you to send anything anywhere.
Side by side
| Lucid Train | D2 | |
|---|---|---|
| Diagram source | Generated from the repo | A .d2 file you write |
| Diffs in a pull request | SVG output does | Yes, the source |
| Layout | ELK solver | Three engines to choose from |
| Runs offline | Yes | Yes |
| Open source | The CLI is | Fully |
| Exports | SVG, 2x PNG, Markdown, Excalidraw | SVG, PNG, PDF |
| Diagram to code as a specification | Yes | No |
| Price | CLI free and open source; desktop $3/month, 7-day trial, no card | Free |
Questions
Related
- Lucid Train vs MultiplayerMultiplayer starts from a production incident. Lucid Train starts from the shape of the code.
- Lucid Train vs ClineBoth are provider-agnostic and both run local. One lives in your editor; one draws your architecture.
- Lucid Train vs OpenCodeNot either-or. Lucid Train can run OpenCode as its engine.
- Lucid Train vs the Codex CLILucid Train drives the Codex CLI rather than competing with it.
Last updated