06.11.2025

How to use oxdraw: a visual editor for Mermaid diagrams with CLI and Rust support

oxdraw is a tool for creating and editing diagrams using a declarative syntax and with the ability for visual editing through a web interface. It is based on Mermaid, but allows not only writing diagram code, but also adjusting the appearance (positions, colors, lines, styles) directly in the interface, while all changes are automatically saved back to the original .mmd file as comments.
Thanks to this, diagrams remain deterministic, versionable, and compatible with other Mermaid tools.

Links

oxdraw Features

Installation

1. Clone the repository

git clone https://github.com/RohanAdwankar/oxdraw.git cd oxdraw

2. Install dependencies

Rust (for CLI)

Make sure Rust is installed. If not:

curl https://sh.rustup.rs -sSf | sh

Build the CLI:

cargo build --release

Node.js (for the web interface)

Install frontend dependencies:

cd web npm install

Usage

1. Create a diagram

Create a Mermaid file:

echo "graph TD; A-->B; B-->C;" > example.mmd

2. Run the web interface

npm run dev

Open in your browser: http://localhost:5173

Load example.mmd and start editing — you can move nodes, change colors, styles, and connections.
All changes are automatically saved as comments in the file, for example:

graph TD
A-->B
B-->C
%% position: A(100,200), B(200,300)

Diagram Compilation

After editing, you can generate images:

cargo run --release -- example.mmd --output diagram.svg

Supported formats: SVG, PNG, and PDF.

Advantages of oxdraw

Example Use Case

  1. Create a system architecture diagram in Mermaid
  2. Open it in oxdraw and visually arrange the blocks
  3. Save the file and commit it to Git
  4. Use the CLI to generate final images for documentation

Conclusion

oxdraw is a tool that combines the convenience of visual editing with the flexibility of a declarative approach. It is especially useful for engineers, DevOps professionals, and technical writers who want to document infrastructure, system architecture, or CI/CD pipelines in clear and reproducible diagrams. With oxdraw, you can use the power of Mermaid together with the simplicity of a drag-and-drop interface without losing control over the code or compatibility with other tools. If you value determinism, transparency, and version control, oxdraw will be an excellent addition to your toolkit.

FAQ