| name | figma-files |
| description | Figma file, node, image, comment, version, and project commands. Use for reading file structure, exporting images, managing comments, and browsing projects. |
| allowed-tools | Bash(figma:*) |
figma — File & Project Commands
Quick start
figma me
figma files get <file-key> --depth 1
figma files nodes <file-key> --ids 1:2,3:4
figma files frames <file-key>
figma images export <file-key> --ids 1:2,3:4 --format png
figma comments list <file-key>
figma me
Show current user info (verify token works).
figma me [--json]
JSON output:
{
"id": "123456",
"handle": "John Doe",
"email": "john@example.com",
"img_url": "https://..."
}
figma files get <file-key>
Get file structure and metadata.
figma files get <file-key> [--depth N] [--version ID] [--geometry paths] [--json]
Options:
--depth N — depth of node tree (use 1-2 for large files)
--version ID — get a specific version
--geometry paths — include vector path data
JSON output: Full Figma file JSON (name, document tree, lastModified, version).
figma files nodes <file-key>
Get specific nodes by ID.
figma files nodes <file-key> --ids 1:2,3:4 [--json]
JSON output:
{
"name": "File Name",
"nodes": {
"1:2": { "document": { "id": "1:2", "name": "Node", "type": "FRAME", ... } }
}
}
figma files frames <file-key>
List all frames in a file.
figma files frames <file-key> [--json]
JSON output: Array of FigmaNode objects with type "FRAME".
figma images export <file-key>
Export nodes as images (PNG, SVG, JPG, PDF).
figma images export <file-key> --ids 1:2,3:4 [--format png] [--scale 2] [--output-dir ./exports] [--json]
Options:
--ids — (required) comma-separated node IDs
--format — png, svg, jpg, pdf (default: png)
--scale — 0.01 to 4 (default: 2)
--output-dir — output directory (default: current directory)
JSON output:
{
"fileKey": "abc123",
"outputDir": "./exports",
"format": "png",
"exported": [{ "nodeId": "1:2", "filename": "1-2.png", "path": "./exports/1-2.png" }],
"failed": []
}
figma comments list <file-key>
List comments on a file.
figma comments list <file-key> [--json]
figma comments add <file-key> <message>
Add a comment. Use - to read from stdin.
figma comments add <file-key> "Review the header layout" [--json]
echo "Long comment..." | figma comments add <file-key> -
figma versions list <file-key>
List version history.
figma versions list <file-key> [--json]
figma projects list <team-id>
List projects in a team.
figma projects list <team-id> [--json]
figma projects files <project-id>
List files in a project.
figma projects files <project-id> [--json]
Workflow: Explore a design file
figma files get <file-key> --depth 1 --json
figma files frames <file-key> --json
figma files nodes <file-key> --ids 1:2,3:4 --json
figma images export <file-key> --ids 1:2,3:4 --format png --scale 2 --output-dir ./figma-exports --json
Workflow: Analyze a screen for test case writing
Use this workflow when a QA engineer or tester needs to understand a UI screen to write test cases.
figma images export <file-key> --ids <node-id> --format png --scale 2 --output-dir ./figma-exports --json
figma files nodes <file-key> --ids <node-id> --json
What to extract from the node tree for test cases:
- TEXT nodes → field labels, button text, headings, placeholder text, error messages
- FRAME/GROUP names → logical sections (e.g. "Login Form", "Header", "Navigation")
- COMPONENT/INSTANCE nodes → reusable UI elements (buttons, inputs, dropdowns, checkboxes)
- Node hierarchy → parent-child relationships reveal form structure and grouping
- Node names → designers often name layers descriptively (e.g. "Email Input", "Submit Button", "Error State")
From the visual export + node structure, identify:
- All interactive elements (buttons, links, inputs, toggles, dropdowns)
- Required vs optional fields (look for asterisks or "required" labels)
- Validation hints (error message text nodes, helper text)
- Navigation paths (tabs, breadcrumbs, menu items)
- Different states if multiple frames exist (empty, filled, error, success, loading)
Workflow: Compare UI states and screen variations
Use this when you need to understand different states of the same screen (e.g. empty form vs validation errors vs success).
figma files get <file-key> --depth 2 --json
figma images export <file-key> --ids <state1-id>,<state2-id>,<state3-id> --format png --scale 2 --output-dir ./figma-exports --json