Generated Computers
Locals: an Apple Silicon engine that runs local LLMs up to 3x faster. A product of Generated Computers.
Translation pending
Convert SVG files into .drawio diagrams whose cells are native draw.io shapes. One binary, no dependencies, MIT licensed.
Translation pending
Developer toolsGo · HTMLGitHub @bcollardOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
Convert SVG files into native draw.io (mxGraph) diagrams — real shapes, edges and text you can edit
Taken from the repository README
Loading the full README.
Read the full README ↗Convert SVG files into draw.io (mxGraph) XML from the command line.
The default output is a .drawio diagram in which every SVG element is a native
draw.io cell: rectangles are rectangles, circles are ellipses, connectors are
edges with draggable endpoints, text is a text cell with its own font settings.
Arbitrary paths become inline stencils (shape=stencil(...)), which draw.io
renders as first class shapes with editable fill and stroke.
Website: https://svg2drawio.runlocal.dev
brew tap bcollard/svg2drawio
brew install --cask svg2drawio
Or with a Go toolchain:
go install github.com/bcollard/svg2drawio/cmd/svg2drawio@latest
Or from a clone:
make build # ./bin/svg2drawio
svg2drawio [flags] <input.svg|directory>...
| Command | Purpose |
|---|---|
svg2drawio <input>... | Convert to .drawio — the default action |
svg2drawio convert <input>... | The same thing, explicit (alias: diagram) |
svg2drawio version | Version and build signature; --short for the number alone |
svg2drawio skill install | Install the Agent Skill for AI coding tools |
svg2drawio skill path | Where that skill is installed |
svg2drawio completion <shell> | bash, zsh, fish or powershell completions |
svg2drawio help [command] | Help for any command |
Flags for convert:
| Flag | Default | Meaning |
|---|---|---|
-o, --out | next to the input | Output file or directory; - writes to stdout |
--decimals | 2 | Rounding applied to coordinates; -1 keeps full precision |
--scale | 1 | Multiplies every coordinate |
--no-groups | off | Flattens SVG groups instead of keeping draw.io groups |
--no-edges | off | Converts lines and polylines to shapes instead of edges |
--name | file name | Name of the diagram page |
-q, --quiet | off | Suppresses the per-file output line |
Examples:
svg2drawio diagram.svg # writes diagram.drawio next to it
svg2drawio -o out/ icons/ # converts a tree of SVGs
svg2drawio -o all.drawio a.svg b.svg c.svg # one file, one page per SVG
svg2drawio -o - diagram.svg | pbcopy # paste into Extras > Edit Diagram
An -o value with no file extension (or an existing directory, or a trailing
/) is treated as a directory; anything else is a file.
The repo-root SKILL.md is embedded in the binary, so AI coding tools can learn
the CLI without a separate download:
svg2drawio skill install # → ~/.claude/skills/svg2drawio/SKILL.md
svg2drawio skill install --print # write it wherever you like
| SVG | draw.io |
|---|---|
rect | native rectangle, rounded=1;absoluteArcSize=1;arcSize=<rx> when rx/ry are set |
circle, ellipse | native ellipse |
line, open polyline, straight open path | edge with floating endpoints and waypoints |
polygon, curved or filled path | vertex with an inline stencil |
text, tspan | text cell with font family, size, colour, weight, style and alignment |
image | shape=image, data URIs rewritten the way draw.io stores them |
g | draw.io group, with children rebased on the group origin |
use, symbol | expanded before conversion |
linearGradient, radialGradient | fillColor + gradientColor + gradientDirection |
marker-start, marker-end | startArrow / endArrow block arrowheads |
<style> rules, class, style="" | resolved through the CSS cascade before conversion |
transform | baked into coordinates; rotations survive as rotation=, skews are baked into a stencil path |
viewBox, width, height | page size and the user-unit scale |
Opacity, stroke width, dash patterns, line caps and joins, display,
visibility and style inheritance through groups are all carried over.
clipPath, mask, filter, pattern fills — the element is drawn unclipped
and unfiltered; a pattern fill becomes no fill.fill-rule="evenodd" — mxGraph stencils have no fill rule.textPath, text on a curve — the text is placed at its anchor point.draw.io reads shape=stencil(<data>) with Graph.decompress: base64 decode,
raw inflate, decodeURIComponent. This tool writes exactly that — the stencil
XML is URI encoded, deflated raw and base64 encoded — so the shapes are the same
kind of object draw.io produces itself for custom shapes.
make check # gofmt, go vet, go test
make build # ./bin/svg2drawio
make snapshot # local goreleaser dry run
| Package | Responsibility |
|---|---|
internal/cli | cobra commands, file walking, output paths |
internal/svgdom | SVG parsing, use/symbol expansion, transforms, colours, the CSS cascade |
internal/svgpath | path data parsing, arcs to cubics, transforms, exact bounding boxes |
internal/stencil | mxGraph stencil XML and the draw.io style encoding |
internal/mxgraph | the .drawio file model |
internal/convert | the SVG to draw.io mapping |
website/ holds the static site published to
svg2drawio.runlocal.dev; see
website/README.md.
Tagging vX.Y.Z runs .github/workflows/release.yml: goreleaser builds macOS
and Linux binaries (amd64 + arm64) stamped with version, commit and build date,
attaches an SPDX SBOM and third-party licences, and pushes the Homebrew cask to
bcollard/homebrew-svg2drawio.
MIT — see LICENSE.