--- name: figma-use description: Control Figma via CLI — create shapes, frames, text, components, set styles, layout, variables, export images. Use when asked to create/modify Figma designs or automate design tasks. --- # figma-use CLI for Figma. Two modes: commands and JSX. ```bash # Commands figma-use create frame --width 400 --height 300 --fill "#FFF" --layout VERTICAL --gap 16 figma-use create icon mdi:home --size 32 --color "#3B82F6" figma-use set fill 1:23 "$Colors/Primary" # JSX (props directly on elements, NOT style={{}}) echo ' Hello ' | figma-use render --stdin --x 100 --y 100 ``` ## Before You Start ```bash figma-use status # Check connection ``` If not connected — start Figma with remote debugging: ```bash # macOS open -a Figma --args --remote-debugging-port=9222 # Windows "C:\Users\%USERNAME%\AppData\Local\Figma\Figma.exe" --remote-debugging-port=9222 # Linux figma --remote-debugging-port=9222 ``` Start Figma with `--remote-debugging-port=9222` and you're ready. ## Two Modes **Imperative** — single operations: ```bash figma-use create frame --width 400 --height 300 --fill "#FFF" --radius 12 figma-use set fill "#FF0000" figma-use node move --x 100 --y 200 ``` **Declarative** — render JSX trees: ```bash echo ' Title Description ' | figma-use render --stdin --x 100 --y 200 ``` stdin supports both pure JSX and full module syntax with imports: ```tsx import { Frame, Text, defineComponent } from 'figma-use/render' const Button = defineComponent( 'Button', Click ) export default () => (