@dannote/figma-use 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -43
- package/package.json +1 -7
package/README.md
CHANGED
|
@@ -4,6 +4,25 @@ Control Figma from the command line. Like [browser-use](https://github.com/brows
|
|
|
4
4
|
|
|
5
5
|
Built for AI agents to create and manipulate Figma designs programmatically.
|
|
6
6
|
|
|
7
|
+
## Why not the official Figma MCP?
|
|
8
|
+
|
|
9
|
+
The [official Figma MCP server](https://developers.figma.com/docs/figma-mcp-server/) is **read-only** — it can extract design context and take screenshots, but cannot create or modify anything.
|
|
10
|
+
|
|
11
|
+
| Feature | Official MCP | figma-use |
|
|
12
|
+
|---------|-------------|-----------|
|
|
13
|
+
| Read node properties | ✓ | ✓ |
|
|
14
|
+
| Take screenshots | ✓ | ✓ |
|
|
15
|
+
| Extract variables/styles | ✓ | ✓ |
|
|
16
|
+
| **Create shapes** | ✗ | ✓ |
|
|
17
|
+
| **Create text** | ✗ | ✓ |
|
|
18
|
+
| **Create frames & components** | ✗ | ✓ |
|
|
19
|
+
| **Modify properties** | ✗ | ✓ |
|
|
20
|
+
| **Set fills, strokes, effects** | ✗ | ✓ |
|
|
21
|
+
| **Auto-layout** | ✗ | ✓ |
|
|
22
|
+
| **Execute arbitrary code** | ✗ | ✓ |
|
|
23
|
+
|
|
24
|
+
figma-use gives AI agents full control over Figma — not just reading, but **creating and editing** designs.
|
|
25
|
+
|
|
7
26
|
## How it works
|
|
8
27
|
|
|
9
28
|
```
|
|
@@ -53,22 +72,23 @@ Start Figma and find the plugin in **Plugins → Development → Figma Use**.
|
|
|
53
72
|
### 3. Run commands
|
|
54
73
|
|
|
55
74
|
```bash
|
|
56
|
-
# Create
|
|
57
|
-
figma-use create-
|
|
75
|
+
# Create a styled button in one command (fill + stroke + radius + layout)
|
|
76
|
+
figma-use create-frame --x 0 --y 0 --width 200 --height 48 \
|
|
77
|
+
--fill "#3B82F6" --stroke "#1D4ED8" --radius 8 \
|
|
78
|
+
--layoutMode HORIZONTAL --itemSpacing 8 --padding "12,24,12,24" \
|
|
79
|
+
--name "Button"
|
|
58
80
|
|
|
59
|
-
#
|
|
60
|
-
figma-use create-text --x
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
figma-use get-node --id "1:2"
|
|
81
|
+
# Add text with font styling
|
|
82
|
+
figma-use create-text --x 0 --y 0 --text "Click me" \
|
|
83
|
+
--fontSize 16 --fontFamily "Inter" --fontStyle "Medium" --fill "#FFFFFF" \
|
|
84
|
+
--parentId "1:23"
|
|
64
85
|
|
|
65
86
|
# Export to PNG
|
|
66
|
-
figma-use export-node --id "1:
|
|
67
|
-
|
|
68
|
-
# Take screenshot
|
|
69
|
-
figma-use screenshot --output viewport.png
|
|
87
|
+
figma-use export-node --id "1:23" --format PNG --scale 2 --output button.png
|
|
70
88
|
```
|
|
71
89
|
|
|
90
|
+
All create commands support inline styling — no need for separate `set-*` calls.
|
|
91
|
+
|
|
72
92
|
## Output Format
|
|
73
93
|
|
|
74
94
|
Human-readable by default:
|
|
@@ -222,39 +242,26 @@ figma-use eval "const node = await figma.getNodeByIdAsync('1:2'); return node.na
|
|
|
222
242
|
|
|
223
243
|
## For AI Agents
|
|
224
244
|
|
|
225
|
-
figma-use is designed
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
response = client.messages.create(
|
|
241
|
-
model="claude-sonnet-4-20250514",
|
|
242
|
-
messages=[{
|
|
243
|
-
"role": "user",
|
|
244
|
-
"content": "Create a blue button with white text 'Click me'"
|
|
245
|
-
}],
|
|
246
|
-
tools=[{
|
|
247
|
-
"name": "figma",
|
|
248
|
-
"description": "Run figma-use CLI command",
|
|
249
|
-
"input_schema": {
|
|
250
|
-
"type": "object",
|
|
251
|
-
"properties": {
|
|
252
|
-
"command": {"type": "string"}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}]
|
|
256
|
-
)
|
|
245
|
+
figma-use is designed to work with AI coding agents like [Claude Code](https://docs.anthropic.com/en/docs/claude-code), [Cursor](https://cursor.sh), or any agent that can execute shell commands.
|
|
246
|
+
|
|
247
|
+
### Using with Claude Code
|
|
248
|
+
|
|
249
|
+
Add the [web-to-figma skill](https://github.com/anthropics/claude-code/tree/main/skills) to your agent:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
# The skill teaches the agent how to:
|
|
253
|
+
# - Extract styles from web pages
|
|
254
|
+
# - Recreate UI components in Figma
|
|
255
|
+
# - Match colors, fonts, spacing, and layout
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Then just ask:
|
|
259
|
+
|
|
257
260
|
```
|
|
261
|
+
Recreate this login form in Figma: https://example.com/login
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
The agent will use `figma-use` commands to build the design.
|
|
258
265
|
|
|
259
266
|
## License
|
|
260
267
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dannote/figma-use",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Control Figma from the command line. Like browser-use, but for Figma.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -46,14 +46,8 @@
|
|
|
46
46
|
"elysia": "^1.2.25"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@anthropic-ai/sdk": "^0.52.0",
|
|
50
|
-
"@anthropic-ai/tokenizer": "^0.0.4",
|
|
51
49
|
"@types/bun": "^1.3.6",
|
|
52
50
|
"esbuild": "^0.25.4",
|
|
53
51
|
"typescript": "^5.8.3"
|
|
54
|
-
},
|
|
55
|
-
"engines": {
|
|
56
|
-
"node": ">=18",
|
|
57
|
-
"bun": ">=1.0"
|
|
58
52
|
}
|
|
59
53
|
}
|