重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
npx skills add https://github.com/vm0-ai/vm0-skills --skill figma通过 REST API 访问和管理 Figma 工作区中的设计文件、组件、评论和项目。
官方文档:
https://developers.figma.com/docs/rest-api/
当您需要执行以下操作时,请使用此技能:
通过 vm0 平台(OAuth 连接器)连接您的 Figma 账户。FIGMA_TOKEN 环境变量会自动配置。
验证身份验证:
curl -s "https://api.figma.com/v1/me" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" | jq '{id, email, handle}'
预期响应:您的用户信息(id、email、handle)。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
Figma 文件 URL 中包含文件密钥:
URL: https://www.figma.com/design/abc123XYZ/My-Design-File
文件密钥: abc123XYZ
文件密钥是 /design/(或 /file/)与下一个 / 之间的字母数字字符串。
所有示例均假设 FIGMA_TOKEN 已设置。
基础 URL:https://api.figma.com/v1
获取已认证用户的信息(无需参数):
curl -s "https://api.figma.com/v1/me" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" | jq '{id, email, handle, img_url}'
检索完整的文件结构,包括画框、组件和样式。
将 <file-key> 替换为 Figma URL 中的实际文件密钥。
curl -s "https://api.figma.com/v1/files/<file-key>" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" | jq '{name, lastModified, version, document: .document.children[0].name}'
通过节点 ID 从文件中检索特定节点。
将 <file-key> 替换为您的文件密钥,将 <node-id> 替换为实际的节点 ID(多个节点用逗号分隔,例如 1:2,1:3)。
curl -s "https://api.figma.com/v1/files/<file-key>/nodes?ids=<node-id>" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" | jq '.nodes'
节点 ID 可以从文件结构或 Figma URL 的 ?node-id=X-Y 参数中找到(将 - 转换为 :)。
将节点导出为 PNG、JPG、SVG 或 PDF 格式的图像。
将 <file-key> 替换为您的文件密钥,将 <node-id> 替换为实际的节点 ID。
curl -s "https://api.figma.com/v1/images/<file-key>?ids=<node-id>&format=png&scale=2" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" | jq '.images'
参数:
format: png、jpg、svg、pdf(默认:png)scale: 0.5、1、2、4(默认:1)获取文件中使用的所有图像的下载 URL。
将 <file-key> 替换为您的文件密钥。
curl -s "https://api.figma.com/v1/files/<file-key>/images" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" | jq '.meta.images'
列出文件上的所有评论。
将 <file-key> 替换为您的文件密钥。
curl -s "https://api.figma.com/v1/files/<file-key>/comments" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" | jq '.comments[] | {id, message: .message, user: .user.handle, created_at}'
向文件添加评论。Figma 要求 client_meta 包含一个 node_id 来锚定评论。
将 <file-key> 替换为您的文件密钥,将 <node-id> 替换为实际的节点 ID。
写入 /tmp/figma_comment.json:
{
"message": "This looks great!",
"client_meta": {
"node_id": "<node-id>",
"node_offset": { "x": 0, "y": 0 }
}
}
curl -s -X POST "https://api.figma.com/v1/files/<file-key>/comments" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" --header "Content-Type: application/json" -d @/tmp/figma_comment.json | jq '{id, message}'
列出文件的版本历史。
将 <file-key> 替换为您的文件密钥。
curl -s "https://api.figma.com/v1/files/<file-key>/versions" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" | jq '.versions[] | {id, created_at, label, description, user: .user.handle}'
列出项目中的所有文件。
将 <project-id> 替换为您的项目 ID。项目 ID 可以从 Figma URL 或团队项目列表中查找。
curl -s "https://api.figma.com/v1/projects/<project-id>/files" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" | jq '.files[] | {key, name, last_modified}'
获取文件中的组件集(变体)。
将 <file-key> 替换为您的文件密钥。
curl -s "https://api.figma.com/v1/files/<file-key>/component_sets" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" | jq '.meta.component_sets[] | {key, name, description}'
获取特定组件的元数据。
将 <component-key> 替换为组件集输出中的组件密钥。
curl -s "https://api.figma.com/v1/components/<component-key>" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" | jq '{key, name, description, containing_frame}'
Figma 文件具有分层结构:
FILE
└── CANVAS (page)
├── FRAME
│ ├── RECTANGLE
│ ├── TEXT
│ └── GROUP
│ └── VECTOR
└── FRAME
└── COMPONENT
常见节点类型:CANVAS、FRAME、GROUP、VECTOR、BOOLEAN_OPERATION、STAR、LINE、ELLIPSE、REGULAR_POLYGON、RECTANGLE、TEXT、SLICE、COMPONENT、COMPONENT_SET、INSTANCE
/v1/me 开始:在调用其他端点之前,始终先验证身份验证/design/<file-key>/...)X:Y(例如 1:2)——在 URL 中显示为 X-Y,需将 - 转换为 :next_page每周安装数
61
代码仓库
GitHub 星标数
49
首次出现
2026年1月24日
安全审计
安装于
gemini-cli50
cursor49
opencode49
codex48
amp47
cline47
Access and manage design files, components, comments, and projects in Figma workspaces via REST API.
Official docs:
https://developers.figma.com/docs/rest-api/
Use this skill when you need to:
Connect your Figma account via the vm0 platform (OAuth connector). The FIGMA_TOKEN environment variable is automatically configured.
Verify authentication:
curl -s "https://api.figma.com/v1/me" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" | jq '{id, email, handle}'
Expected response: Your user information (id, email, handle).
Figma file URLs contain the file key:
URL: https://www.figma.com/design/abc123XYZ/My-Design-File
File Key: abc123XYZ
The file key is the alphanumeric string between /design/ (or /file/) and the next /.
All examples assume FIGMA_TOKEN is set.
Base URL: https://api.figma.com/v1
Get information about the authenticated user (no parameters needed):
curl -s "https://api.figma.com/v1/me" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" | jq '{id, email, handle, img_url}'
Retrieve complete file structure including frames, components, and styles.
Replace <file-key> with your actual file key from a Figma URL.
curl -s "https://api.figma.com/v1/files/<file-key>" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" | jq '{name, lastModified, version, document: .document.children[0].name}'
Retrieve specific nodes from a file by node IDs.
Replace <file-key> with your file key and <node-id> with actual node IDs (comma-separated for multiple, e.g., 1:2,1:3).
curl -s "https://api.figma.com/v1/files/<file-key>/nodes?ids=<node-id>" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" | jq '.nodes'
Node IDs can be found in the file structure or from the Figma URL ?node-id=X-Y parameter (convert - to :).
Export nodes as images in PNG, JPG, SVG, or PDF format.
Replace <file-key> with your file key and <node-id> with actual node IDs.
curl -s "https://api.figma.com/v1/images/<file-key>?ids=<node-id>&format=png&scale=2" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" | jq '.images'
Parameters:
format: png, jpg, svg, pdf (default: png)scale: 0.5, 1, 2, 4 (default: 1)Get download URLs for all images used in a file.
Replace <file-key> with your file key.
curl -s "https://api.figma.com/v1/files/<file-key>/images" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" | jq '.meta.images'
List all comments on a file.
Replace <file-key> with your file key.
curl -s "https://api.figma.com/v1/files/<file-key>/comments" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" | jq '.comments[] | {id, message: .message, user: .user.handle, created_at}'
Add a comment to a file. Figma requires client_meta with a node_id to anchor the comment.
Replace <file-key> with your file key and <node-id> with an actual node ID.
Write to /tmp/figma_comment.json:
{
"message": "This looks great!",
"client_meta": {
"node_id": "<node-id>",
"node_offset": { "x": 0, "y": 0 }
}
}
curl -s -X POST "https://api.figma.com/v1/files/<file-key>/comments" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" --header "Content-Type: application/json" -d @/tmp/figma_comment.json | jq '{id, message}'
List version history of a file.
Replace <file-key> with your file key.
curl -s "https://api.figma.com/v1/files/<file-key>/versions" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" | jq '.versions[] | {id, created_at, label, description, user: .user.handle}'
List all files in a project.
Replace <project-id> with your project ID. Project IDs can be found in Figma URLs or from team project listings.
curl -s "https://api.figma.com/v1/projects/<project-id>/files" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" | jq '.files[] | {key, name, last_modified}'
Get component sets (variants) in a file.
Replace <file-key> with your file key.
curl -s "https://api.figma.com/v1/files/<file-key>/component_sets" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" | jq '.meta.component_sets[] | {key, name, description}'
Get metadata for a specific component.
Replace <component-key> with your component key from the component sets output.
curl -s "https://api.figma.com/v1/components/<component-key>" --header "Authorization: Bearer $(printenv FIGMA_TOKEN)" | jq '{key, name, description, containing_frame}'
Figma files have a hierarchical structure:
FILE
└── CANVAS (page)
├── FRAME
│ ├── RECTANGLE
│ ├── TEXT
│ └── GROUP
│ └── VECTOR
└── FRAME
└── COMPONENT
Common node types: CANVAS, FRAME, GROUP, VECTOR, BOOLEAN_OPERATION, STAR, LINE, ELLIPSE, REGULAR_POLYGON, RECTANGLE, TEXT, SLICE, , ,
/v1/me: Always verify auth first before calling other endpoints/design/<file-key>/...)X:Y (e.g., 1:2) — in URLs they appear as X-Y, convert - to :next_page in responsesWeekly Installs
61
Repository
GitHub Stars
49
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
gemini-cli50
cursor49
opencode49
codex48
amp47
cline47
shadcn/ui 框架:React 组件库与 UI 设计系统,Tailwind CSS 最佳实践
72,100 周安装
COMPONENTCOMPONENT_SETINSTANCE