KosmoKrator

design

Figma CLI for AI Agents

Use the Figma CLI from KosmoKrator to call Figma tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

20 functions 19 read 1 write Bearer token auth

Figma CLI Setup

Figma can be configured headlessly with `kosmokrator integrations:configure figma`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure figma --set access_token="$FIGMA_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor figma --json
kosmokrator integrations:status --json

Credentials

Authentication type: Bearer token bearer_token. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
access_token FIGMA_ACCESS_TOKEN Secret secret yes Personal Access Token
url FIGMA_URL URL url no API Base URL

Call Figma Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call figma.figma_delete_comment '{
  "file_key": "example_file_key",
  "comment_id": "example_comment_id"
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:figma figma_delete_comment '{
  "file_key": "example_file_key",
  "comment_id": "example_comment_id"
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs figma --json
kosmo integrations:docs figma.figma_delete_comment --json
kosmo integrations:schema figma.figma_delete_comment --json
kosmo integrations:search "Figma" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Figma.

figma.figma_delete_comment

Write write

Delete a comment from a Figma file.

Parameters
file_key, comment_id

Generic CLI call

kosmo integrations:call figma.figma_delete_comment '{"file_key":"example_file_key","comment_id":"example_comment_id"}' --json

Provider shortcut

kosmo integrations:figma figma_delete_comment '{"file_key":"example_file_key","comment_id":"example_comment_id"}' --json

figma.figma_get_comments

Read read

List all comments on a Figma file.

Parameters
file_key

Generic CLI call

kosmo integrations:call figma.figma_get_comments '{"file_key":"example_file_key"}' --json

Provider shortcut

kosmo integrations:figma figma_get_comments '{"file_key":"example_file_key"}' --json

figma.figma_get_component

Read read

Get a Figma component by its key.

Parameters
component_key

Generic CLI call

kosmo integrations:call figma.figma_get_component '{"component_key":"example_component_key"}' --json

Provider shortcut

kosmo integrations:figma figma_get_component '{"component_key":"example_component_key"}' --json

figma.figma_get_components

Read read

List all components in a Figma file.

Parameters
file_key

Generic CLI call

kosmo integrations:call figma.figma_get_components '{"file_key":"example_file_key"}' --json

Provider shortcut

kosmo integrations:figma figma_get_components '{"file_key":"example_file_key"}' --json

figma.figma_get_current_user

Read read

Get the authenticated Figma user profile. Returns name, email, and account details.

Parameters
none

Generic CLI call

kosmo integrations:call figma.figma_get_current_user '{}' --json

Provider shortcut

kosmo integrations:figma figma_get_current_user '{}' --json

figma.figma_get_file

Read read

Get a Figma file by key. Returns the document tree with pages and nodes.

Parameters
file_key, ids, depth, geometry, plugin_data

Generic CLI call

kosmo integrations:call figma.figma_get_file '{"file_key":"example_file_key","ids":"example_ids","depth":1,"geometry":"example_geometry","plugin_data":"example_plugin_data"}' --json

Provider shortcut

kosmo integrations:figma figma_get_file '{"file_key":"example_file_key","ids":"example_ids","depth":1,"geometry":"example_geometry","plugin_data":"example_plugin_data"}' --json

figma.figma_get_file_images

Read read

Export images from Figma nodes in a file. Returns image download URLs.

Parameters
file_key, ids, format, scale, svg_include_id_token

Generic CLI call

kosmo integrations:call figma.figma_get_file_images '{"file_key":"example_file_key","ids":"example_ids","format":"example_format","scale":1,"svg_include_id_token":true}' --json

Provider shortcut

kosmo integrations:figma figma_get_file_images '{"file_key":"example_file_key","ids":"example_ids","format":"example_format","scale":1,"svg_include_id_token":true}' --json

figma.figma_get_file_nodes

Read read

Get specific nodes from a Figma file by node IDs.

Parameters
file_key, ids, depth, geometry

Generic CLI call

kosmo integrations:call figma.figma_get_file_nodes '{"file_key":"example_file_key","ids":"example_ids","depth":1,"geometry":"example_geometry"}' --json

Provider shortcut

kosmo integrations:figma figma_get_file_nodes '{"file_key":"example_file_key","ids":"example_ids","depth":1,"geometry":"example_geometry"}' --json

figma.figma_get_image_fills

Read read

Get image fill metadata for a Figma file. Returns image URLs for all image fills.

Parameters
file_key

Generic CLI call

kosmo integrations:call figma.figma_get_image_fills '{"file_key":"example_file_key"}' --json

Provider shortcut

kosmo integrations:figma figma_get_image_fills '{"file_key":"example_file_key"}' --json

figma.figma_get_me

Read read

Get the authenticated Figma user profile.

Parameters
none

Generic CLI call

kosmo integrations:call figma.figma_get_me '{}' --json

Provider shortcut

kosmo integrations:figma figma_get_me '{}' --json

figma.figma_get_project_files

Read read

List all files in a Figma project.

Parameters
project_id, branch_data

Generic CLI call

kosmo integrations:call figma.figma_get_project_files '{"project_id":"example_project_id","branch_data":true}' --json

Provider shortcut

kosmo integrations:figma figma_get_project_files '{"project_id":"example_project_id","branch_data":true}' --json

figma.figma_get_style

Read read

Get a Figma style by its key.

Parameters
style_key

Generic CLI call

kosmo integrations:call figma.figma_get_style '{"style_key":"example_style_key"}' --json

Provider shortcut

kosmo integrations:figma figma_get_style '{"style_key":"example_style_key"}' --json

figma.figma_get_styles

Read read

List all styles in a Figma file.

Parameters
file_key

Generic CLI call

kosmo integrations:call figma.figma_get_styles '{"file_key":"example_file_key"}' --json

Provider shortcut

kosmo integrations:figma figma_get_styles '{"file_key":"example_file_key"}' --json

figma.figma_get_team_projects

Read read

List all projects in a Figma team.

Parameters
team_id

Generic CLI call

kosmo integrations:call figma.figma_get_team_projects '{"team_id":"example_team_id"}' --json

Provider shortcut

kosmo integrations:figma figma_get_team_projects '{"team_id":"example_team_id"}' --json

figma.figma_list_comments

Read read

List all comments on a Figma file. Includes authors, positions, and reply threads.

Parameters
file_key

Generic CLI call

kosmo integrations:call figma.figma_list_comments '{"file_key":"example_file_key"}' --json

Provider shortcut

kosmo integrations:figma figma_list_comments '{"file_key":"example_file_key"}' --json

figma.figma_list_components

Read read

List all components in a Figma file. Returns component names, keys, and descriptions.

Parameters
file_key

Generic CLI call

kosmo integrations:call figma.figma_list_components '{"file_key":"example_file_key"}' --json

Provider shortcut

kosmo integrations:figma figma_list_components '{"file_key":"example_file_key"}' --json

figma.figma_list_files

Read read

List Figma files accessible to the authenticated user. Returns file names, keys, and thumbnails with pagination support.

Parameters
limit, page

Generic CLI call

kosmo integrations:call figma.figma_list_files '{"limit":1,"page":1}' --json

Provider shortcut

kosmo integrations:figma figma_list_files '{"limit":1,"page":1}' --json

figma.figma_list_projects

Read read

List all projects in a Figma team. Returns project names and IDs.

Parameters
team_id

Generic CLI call

kosmo integrations:call figma.figma_list_projects '{"team_id":"example_team_id"}' --json

Provider shortcut

kosmo integrations:figma figma_list_projects '{"team_id":"example_team_id"}' --json

figma.figma_list_team_components

Read read

List published components in a Figma team.

Parameters
team_id, max_depth

Generic CLI call

kosmo integrations:call figma.figma_list_team_components '{"team_id":"example_team_id","max_depth":1}' --json

Provider shortcut

kosmo integrations:figma figma_list_team_components '{"team_id":"example_team_id","max_depth":1}' --json

figma.figma_post_comment

Read read

Post a comment on a Figma file. Can be a top-level comment or a reply.

Parameters
file_key, message, client_meta, comment_id

Generic CLI call

kosmo integrations:call figma.figma_post_comment '{"file_key":"example_file_key","message":"example_message","client_meta":"example_client_meta","comment_id":"example_comment_id"}' --json

Provider shortcut

kosmo integrations:figma figma_post_comment '{"file_key":"example_file_key","message":"example_message","client_meta":"example_client_meta","comment_id":"example_comment_id"}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

figma.figma_delete_comment

Delete a comment from a Figma file.

Operation
Write write
Schema command
kosmo integrations:schema figma.figma_delete_comment --json
ParameterTypeRequiredDescription
file_key string yes The Figma file key.
comment_id string yes The comment ID to delete.

figma.figma_get_comments

List all comments on a Figma file.

Operation
Read read
Schema command
kosmo integrations:schema figma.figma_get_comments --json
ParameterTypeRequiredDescription
file_key string yes The Figma file key.

figma.figma_get_component

Get a Figma component by its key.

Operation
Read read
Schema command
kosmo integrations:schema figma.figma_get_component --json
ParameterTypeRequiredDescription
component_key string yes The component key.

figma.figma_get_components

List all components in a Figma file.

Operation
Read read
Schema command
kosmo integrations:schema figma.figma_get_components --json
ParameterTypeRequiredDescription
file_key string yes The Figma file key.

figma.figma_get_current_user

Get the authenticated Figma user profile. Returns name, email, and account details.

Operation
Read read
Schema command
kosmo integrations:schema figma.figma_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

figma.figma_get_file

Get a Figma file by key. Returns the document tree with pages and nodes.

Operation
Read read
Schema command
kosmo integrations:schema figma.figma_get_file --json
ParameterTypeRequiredDescription
file_key string yes The Figma file key (from the file URL).
ids string no Comma-separated list of node IDs to return.
depth integer no Max depth of the document tree to return.
geometry string no Set to "path" to include vector path data.
plugin_data string no Comma-separated list of plugin IDs to include data for.

figma.figma_get_file_images

Export images from Figma nodes in a file. Returns image download URLs.

Operation
Read read
Schema command
kosmo integrations:schema figma.figma_get_file_images --json
ParameterTypeRequiredDescription
file_key string yes The Figma file key.
ids string yes Comma-separated list of node IDs to export.
format string no Image format: png, jpg, svg, or pdf. Defaults to png.
scale number no Image scale factor (e.g. 1, 2, 3). Defaults to 1.
svg_include_id_token boolean no If true, include id attribute for SVG root.

figma.figma_get_file_nodes

Get specific nodes from a Figma file by node IDs.

Operation
Read read
Schema command
kosmo integrations:schema figma.figma_get_file_nodes --json
ParameterTypeRequiredDescription
file_key string yes The Figma file key.
ids string yes Comma-separated list of node IDs to retrieve.
depth integer no Max depth of nodes to return.
geometry string no Set to "path" to include vector path data.

figma.figma_get_image_fills

Get image fill metadata for a Figma file. Returns image URLs for all image fills.

Operation
Read read
Schema command
kosmo integrations:schema figma.figma_get_image_fills --json
ParameterTypeRequiredDescription
file_key string yes The Figma file key.

figma.figma_get_me

Get the authenticated Figma user profile.

Operation
Read read
Schema command
kosmo integrations:schema figma.figma_get_me --json
ParameterTypeRequiredDescription
No parameters.

figma.figma_get_project_files

List all files in a Figma project.

Operation
Read read
Schema command
kosmo integrations:schema figma.figma_get_project_files --json
ParameterTypeRequiredDescription
project_id string yes The Figma project ID.
branch_data boolean no If true, include branch metadata for each file.

figma.figma_get_style

Get a Figma style by its key.

Operation
Read read
Schema command
kosmo integrations:schema figma.figma_get_style --json
ParameterTypeRequiredDescription
style_key string yes The style key.

figma.figma_get_styles

List all styles in a Figma file.

Operation
Read read
Schema command
kosmo integrations:schema figma.figma_get_styles --json
ParameterTypeRequiredDescription
file_key string yes The Figma file key.

figma.figma_get_team_projects

List all projects in a Figma team.

Operation
Read read
Schema command
kosmo integrations:schema figma.figma_get_team_projects --json
ParameterTypeRequiredDescription
team_id string yes The Figma team ID.

figma.figma_list_comments

List all comments on a Figma file. Includes authors, positions, and reply threads.

Operation
Read read
Schema command
kosmo integrations:schema figma.figma_list_comments --json
ParameterTypeRequiredDescription
file_key string yes The Figma file key.

figma.figma_list_components

List all components in a Figma file. Returns component names, keys, and descriptions.

Operation
Read read
Schema command
kosmo integrations:schema figma.figma_list_components --json
ParameterTypeRequiredDescription
file_key string yes The Figma file key.

figma.figma_list_files

List Figma files accessible to the authenticated user. Returns file names, keys, and thumbnails with pagination support.

Operation
Read read
Schema command
kosmo integrations:schema figma.figma_list_files --json
ParameterTypeRequiredDescription
limit integer no Maximum number of files to return (default: 30).
page integer no Page number for pagination (default: 1).

figma.figma_list_projects

List all projects in a Figma team. Returns project names and IDs.

Operation
Read read
Schema command
kosmo integrations:schema figma.figma_list_projects --json
ParameterTypeRequiredDescription
team_id string yes The Figma team ID.

figma.figma_list_team_components

List published components in a Figma team.

Operation
Read read
Schema command
kosmo integrations:schema figma.figma_list_team_components --json
ParameterTypeRequiredDescription
team_id string yes The Figma team ID.
max_depth integer no Maximum depth of component tree to return.

figma.figma_post_comment

Post a comment on a Figma file. Can be a top-level comment or a reply.

Operation
Read read
Schema command
kosmo integrations:schema figma.figma_post_comment --json
ParameterTypeRequiredDescription
file_key string yes The Figma file key.
message string yes The comment text.
client_meta string no JSON object with position metadata (x, y) for the comment.
comment_id string no If provided, this comment is a reply to the given comment ID.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.