home / dev-tools / figma-code-connect

Figma Code Connect

Official · Figma
1.4k

Official Figma CLI for generating, parsing, and publishing Code Connect mappings between code components and Figma components.

$npm install -g @figma/code-connect
Language
TypeScript
Stars
1,400
Category
Dev Tools
Agent
Ready
Agent Compatibility
JSON Output
Agent Skill
MCP Support
AI Analysis

Figma Code Connect is Figma's CLI for linking code components in a design system to Figma components so Dev Mode can show production snippets instead of autogenerated examples. It also handles the local parsing, publishing, unpublishing, and migration steps behind those mappings.

What It Enables
  • Generate starter Code Connect files from a Figma node URL and detect the right parser or config for React, HTML, SwiftUI, Jetpack Compose, or custom setups.
  • Parse local Code Connect files into JSON, validate them against Figma, and publish or unpublish mappings so Dev Mode reflects the code your team actually ships.
  • Migrate parser-based mappings to parserless .figma.js templates and keep component, source, and label metadata tied back to your repo.
Agent Fit
  • Works reasonably in scripted repo workflows because commands are explicit, config-driven, and figma connect parse produces machine-readable JSON for follow-up checks.
  • Automation fit is mixed: the default figma connect entrypoint launches an interactive wizard with prompts, and mutating commands require Figma API access plus project-specific source layout.
  • Best for agents maintaining an existing design-system handoff pipeline, not for broad Figma automation or general design editing from the shell.
Caveats
  • Code Connect is limited to Figma Organization and Enterprise plans and requires a full Design or Dev Mode seat.
  • The scope is narrow by design: it links code components to Figma Dev Mode rather than exposing the broader Figma product as a general-purpose CLI control plane.