Generated Computers
Locals: an Apple Silicon engine that runs local LLMs up to 3x faster. A product of Generated Computers.
翻譯準備中
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Convert SVG files into native draw.io (mxGraph) diagrams — real shapes, edges and text you can edit
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 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.