🤖 AI Summary
fig2json is a new open‑source CLI that converts locally saved Figma .fig files into clean, optimized JSON specifically tailored for LLM-driven design implementation. Instead of dumping the full, noisy Figma payload to a model, fig2json extracts the design tree and applies intelligent transforms—stripping default values, internal IDs, thumbnails and other Figma metadata—while preserving geometry (SVG paths) and the essential style/layout properties needed for HTML/CSS generation. The goal is to make designs easier for LLMs to parse and turn into accurate front-end code.
Technically, fig2json is a Rust tool you can install via cargo install fig2json or build from source. Basic usage: fig2json design.fig output-dir (or fig2json design.fig -o output.json). Flags include --compact (minified JSON), --raw (also emit canvas.raw.json with untransformed data), and --verbose for debugging. Output is an extracted directory containing canvas.json (transformed) and optionally canvas.raw.json, ready to be piped into jq or sent to an LLM for implementation. The tool keeps only fields relevant to HTML/CSS conversion and is useful for automated design-to-code workflows, rapid prototyping with generative models, and debugging complex Figma files. MIT licensed and inspired by Evan Wallace’s Figma parser.
Loading comments...
login to comment
loading comments...
no comments yet