KosmoKrator

productivity

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.

Figma CLI Setup

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

Install, configure, and verify
# 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 reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.

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

Command Patterns

The generic command is stable across every integration. The provider shortcut is shorter for humans.

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

Discovery

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

Discovery commands
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

Automation Contexts

The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.

CLI Functions

Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.

figma.figma_delete_comment

Delete a comment from a Figma file.

Write write
Parameters
file_key, comment_id
Generic call
kosmo integrations:call figma.figma_delete_comment '{"file_key":"example_file_key","comment_id":"example_comment_id"}' --json
Shortcut
kosmo integrations:figma figma_delete_comment '{"file_key":"example_file_key","comment_id":"example_comment_id"}' --json

figma.figma_get_comments

List all comments on a Figma file.

Read read
Parameters
file_key
Generic call
kosmo integrations:call figma.figma_get_comments '{"file_key":"example_file_key"}' --json
Shortcut
kosmo integrations:figma figma_get_comments '{"file_key":"example_file_key"}' --json

figma.figma_get_component

Get a Figma component by its key.

Read read
Parameters
component_key
Generic call
kosmo integrations:call figma.figma_get_component '{"component_key":"example_component_key"}' --json
Shortcut
kosmo integrations:figma figma_get_component '{"component_key":"example_component_key"}' --json

figma.figma_get_components

List all components in a Figma file.

Read read
Parameters
file_key
Generic call
kosmo integrations:call figma.figma_get_components '{"file_key":"example_file_key"}' --json
Shortcut
kosmo integrations:figma figma_get_components '{"file_key":"example_file_key"}' --json

figma.figma_get_current_user

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

Read read
Parameters
none
Generic call
kosmo integrations:call figma.figma_get_current_user '{}' --json
Shortcut
kosmo integrations:figma figma_get_current_user '{}' --json

figma.figma_get_file

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

Read read
Parameters
file_key, ids, depth, geometry, plugin_data
Generic 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
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

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

Read read
Parameters
file_key, ids, format, scale, svg_include_id_token
Generic 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
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

Get specific nodes from a Figma file by node IDs.

Read read
Parameters
file_key, ids, depth, geometry
Generic call
kosmo integrations:call figma.figma_get_file_nodes '{"file_key":"example_file_key","ids":"example_ids","depth":1,"geometry":"example_geometry"}' --json
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

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

Read read
Parameters
file_key
Generic call
kosmo integrations:call figma.figma_get_image_fills '{"file_key":"example_file_key"}' --json
Shortcut
kosmo integrations:figma figma_get_image_fills '{"file_key":"example_file_key"}' --json

figma.figma_get_me

Get the authenticated Figma user profile.

Read read
Parameters
none
Generic call
kosmo integrations:call figma.figma_get_me '{}' --json
Shortcut
kosmo integrations:figma figma_get_me '{}' --json

figma.figma_get_project_files

List all files in a Figma project.

Read read
Parameters
project_id, branch_data
Generic call
kosmo integrations:call figma.figma_get_project_files '{"project_id":"example_project_id","branch_data":true}' --json
Shortcut
kosmo integrations:figma figma_get_project_files '{"project_id":"example_project_id","branch_data":true}' --json

figma.figma_get_style

Get a Figma style by its key.

Read read
Parameters
style_key
Generic call
kosmo integrations:call figma.figma_get_style '{"style_key":"example_style_key"}' --json
Shortcut
kosmo integrations:figma figma_get_style '{"style_key":"example_style_key"}' --json

figma.figma_get_styles

List all styles in a Figma file.

Read read
Parameters
file_key
Generic call
kosmo integrations:call figma.figma_get_styles '{"file_key":"example_file_key"}' --json
Shortcut
kosmo integrations:figma figma_get_styles '{"file_key":"example_file_key"}' --json

figma.figma_get_team_projects

List all projects in a Figma team.

Read read
Parameters
team_id
Generic call
kosmo integrations:call figma.figma_get_team_projects '{"team_id":"example_team_id"}' --json
Shortcut
kosmo integrations:figma figma_get_team_projects '{"team_id":"example_team_id"}' --json

figma.figma_list_comments

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

Read read
Parameters
file_key
Generic call
kosmo integrations:call figma.figma_list_comments '{"file_key":"example_file_key"}' --json
Shortcut
kosmo integrations:figma figma_list_comments '{"file_key":"example_file_key"}' --json

figma.figma_list_components

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

Read read
Parameters
file_key
Generic call
kosmo integrations:call figma.figma_list_components '{"file_key":"example_file_key"}' --json
Shortcut
kosmo integrations:figma figma_list_components '{"file_key":"example_file_key"}' --json

figma.figma_list_files

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

Read read
Parameters
limit, page
Generic call
kosmo integrations:call figma.figma_list_files '{"limit":1,"page":1}' --json
Shortcut
kosmo integrations:figma figma_list_files '{"limit":1,"page":1}' --json

figma.figma_list_projects

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

Read read
Parameters
team_id
Generic call
kosmo integrations:call figma.figma_list_projects '{"team_id":"example_team_id"}' --json
Shortcut
kosmo integrations:figma figma_list_projects '{"team_id":"example_team_id"}' --json

figma.figma_list_team_components

List published components in a Figma team.

Read read
Parameters
team_id, max_depth
Generic call
kosmo integrations:call figma.figma_list_team_components '{"team_id":"example_team_id","max_depth":1}' --json
Shortcut
kosmo integrations:figma figma_list_team_components '{"team_id":"example_team_id","max_depth":1}' --json

figma.figma_post_comment

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

Read read
Parameters
file_key, message, client_meta, comment_id
Generic 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
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 2 parameters
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 1 parameters
Schema command
kosmo integrations:schema figma.figma_get_comments --json
ParameterTypeRequiredDescription
file_key string yes The Figma file key.
figma.figma_get_component 1 parameters
Schema command
kosmo integrations:schema figma.figma_get_component --json
ParameterTypeRequiredDescription
component_key string yes The component key.
figma.figma_get_components 1 parameters
Schema command
kosmo integrations:schema figma.figma_get_components --json
ParameterTypeRequiredDescription
file_key string yes The Figma file key.
figma.figma_get_current_user 0 parameters
Schema command
kosmo integrations:schema figma.figma_get_current_user --json
ParameterTypeRequiredDescription
No parameters.
figma.figma_get_file 5 parameters
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 5 parameters
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 4 parameters
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 1 parameters
Schema command
kosmo integrations:schema figma.figma_get_image_fills --json
ParameterTypeRequiredDescription
file_key string yes The Figma file key.
figma.figma_get_me 0 parameters
Schema command
kosmo integrations:schema figma.figma_get_me --json
ParameterTypeRequiredDescription
No parameters.
figma.figma_get_project_files 2 parameters
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 1 parameters
Schema command
kosmo integrations:schema figma.figma_get_style --json
ParameterTypeRequiredDescription
style_key string yes The style key.
figma.figma_get_styles 1 parameters
Schema command
kosmo integrations:schema figma.figma_get_styles --json
ParameterTypeRequiredDescription
file_key string yes The Figma file key.
figma.figma_get_team_projects 1 parameters
Schema command
kosmo integrations:schema figma.figma_get_team_projects --json
ParameterTypeRequiredDescription
team_id string yes The Figma team ID.
figma.figma_list_comments 1 parameters
Schema command
kosmo integrations:schema figma.figma_list_comments --json
ParameterTypeRequiredDescription
file_key string yes The Figma file key.
figma.figma_list_components 1 parameters
Schema command
kosmo integrations:schema figma.figma_list_components --json
ParameterTypeRequiredDescription
file_key string yes The Figma file key.
figma.figma_list_files 2 parameters
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 1 parameters
Schema command
kosmo integrations:schema figma.figma_list_projects --json
ParameterTypeRequiredDescription
team_id string yes The Figma team ID.
figma.figma_list_team_components 2 parameters
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 4 parameters
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.