Skip to content

Add Figma Desktop Bridge plugin#1

Open
daltoniam wants to merge 1 commit into
mainfrom
add-figma-plugin-bridge
Open

Add Figma Desktop Bridge plugin#1
daltoniam wants to merge 1 commit into
mainfrom
add-figma-plugin-bridge

Conversation

@daltoniam

Copy link
Copy Markdown
Owner

Summary

  • Adds figma_bridge WASM plugin (15 tools) that connects to a companion Figma Desktop plugin via HTTP bridge
  • Provides write access to the Figma Plugin API: create frames, text, rectangles, components, instances, auto layout, fills/strokes, and arbitrary plugin code execution
  • Complements the core Switchboard Figma REST API integration (read-only) with canvas write capabilities

Architecture

The plugin sends JSON commands to a local HTTP server (http://127.0.0.1:9223/api/command) that a companion Figma Desktop Bridge plugin exposes. The bridge plugin runs inside Figma Desktop and forwards commands to the Plugin API sandbox.

Tools

Tool Description
figma_bridge_status Check bridge connection
figma_bridge_get_selection Get currently selected nodes
figma_bridge_get_page_nodes Get top-level page nodes
figma_bridge_create_frame Create a frame
figma_bridge_create_text Create text node
figma_bridge_create_rectangle Create rectangle
figma_bridge_set_node_property Set any node property
figma_bridge_delete_node Delete a node
figma_bridge_clone_node Clone/duplicate a node
figma_bridge_create_component Create or convert to component
figma_bridge_create_instance Instantiate a component
figma_bridge_set_auto_layout Apply auto layout
figma_bridge_set_fills Set fill colors
figma_bridge_set_strokes Set strokes
figma_bridge_execute Run arbitrary Plugin API code

Test plan

  • cargo clippy --target wasm32-wasip1 -- -D warnings passes
  • cargo fmt clean
  • Binary builds and is 172KB optimized
  • Manual test with Figma Desktop bridge plugin (requires companion plugin setup)

WASM plugin that connects to a companion Figma Desktop plugin via
WebSocket/HTTP bridge to access the Figma Plugin API. Provides 15 tools
for write operations: creating frames, text, rectangles, components,
instances, auto layout, fills, strokes, and arbitrary plugin code execution.

Requires the Figma Desktop app with a bridge plugin running on port 9223.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant