KosmoKrator

communication

Lark Suite CLI for AI Agents

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

7 functions 5 read 2 write Bearer token auth

Lark Suite CLI Setup

Lark Suite can be configured headlessly with `kosmokrator integrations:configure lark`.

# 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 lark --set access_token="$LARK_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor lark --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 LARK_ACCESS_TOKEN Secret secret yes Access Token
url LARK_URL URL url no API Base URL

Call Lark Suite Headlessly

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

kosmo integrations:call lark.lark_list_chats '{
  "page_size": 1,
  "page_token": "example_page_token"
}' --json

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

kosmo integrations:lark lark_list_chats '{
  "page_size": 1,
  "page_token": "example_page_token"
}' --json

Agent Discovery Commands

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

kosmo integrations:docs lark --json
kosmo integrations:docs lark.lark_list_chats --json
kosmo integrations:schema lark.lark_list_chats --json
kosmo integrations:search "Lark Suite" --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 Lark Suite.

lark.lark_list_chats

Read read

List chats the current authenticated user belongs to in Lark. Returns chat IDs, names, and metadata for use with other Lark tools.

Parameters
page_size, page_token

Generic CLI call

kosmo integrations:call lark.lark_list_chats '{"page_size":1,"page_token":"example_page_token"}' --json

Provider shortcut

kosmo integrations:lark lark_list_chats '{"page_size":1,"page_token":"example_page_token"}' --json

lark.lark_get_chat

Read read

Get detailed information about a specific Lark chat, including its name, description, owner, and member count.

Parameters
chat_id

Generic CLI call

kosmo integrations:call lark.lark_get_chat '{"chat_id":"example_chat_id"}' --json

Provider shortcut

kosmo integrations:lark lark_get_chat '{"chat_id":"example_chat_id"}' --json

lark.lark_create_chat

Write write

Create a new group chat in Lark. Specify a chat ID and name for the new chat.

Parameters
chat_id, name

Generic CLI call

kosmo integrations:call lark.lark_create_chat '{"chat_id":"example_chat_id","name":"example_name"}' --json

Provider shortcut

kosmo integrations:lark lark_create_chat '{"chat_id":"example_chat_id","name":"example_name"}' --json

lark.lark_list_messages

Read read

List messages in a specific Lark chat. Returns message IDs, sender info, content, and timestamps.

Parameters
chat_id, page_size, page_token

Generic CLI call

kosmo integrations:call lark.lark_list_messages '{"chat_id":"example_chat_id","page_size":1,"page_token":"example_page_token"}' --json

Provider shortcut

kosmo integrations:lark lark_list_messages '{"chat_id":"example_chat_id","page_size":1,"page_token":"example_page_token"}' --json

lark.lark_send_message

Write write

Send a message to a specific Lark chat. Supports text and rich message types.

Parameters
chat_id, content, msg_type

Generic CLI call

kosmo integrations:call lark.lark_send_message '{"chat_id":"example_chat_id","content":"example_content","msg_type":"example_msg_type"}' --json

Provider shortcut

kosmo integrations:lark lark_send_message '{"chat_id":"example_chat_id","content":"example_content","msg_type":"example_msg_type"}' --json

lark.lark_list_members

Read read

List members of a specific Lark chat. Returns member IDs, names, and roles.

Parameters
chat_id, page_size, page_token

Generic CLI call

kosmo integrations:call lark.lark_list_members '{"chat_id":"example_chat_id","page_size":1,"page_token":"example_page_token"}' --json

Provider shortcut

kosmo integrations:lark lark_list_members '{"chat_id":"example_chat_id","page_size":1,"page_token":"example_page_token"}' --json

lark.lark_get_current_user

Read read

Get information about the currently authenticated Lark user, including name, user ID, and avatar.

Parameters
none

Generic CLI call

kosmo integrations:call lark.lark_get_current_user '{}' --json

Provider shortcut

kosmo integrations:lark lark_get_current_user '{}' --json

Function Schemas

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

lark.lark_list_chats

List chats the current authenticated user belongs to in Lark. Returns chat IDs, names, and metadata for use with other Lark tools.

Operation
Read read
Schema command
kosmo integrations:schema lark.lark_list_chats --json
ParameterTypeRequiredDescription
page_size integer no Number of chats to return per page (max 50, default 20).
page_token string no Pagination cursor from a previous response to fetch the next page.

lark.lark_get_chat

Get detailed information about a specific Lark chat, including its name, description, owner, and member count.

Operation
Read read
Schema command
kosmo integrations:schema lark.lark_get_chat --json
ParameterTypeRequiredDescription
chat_id string yes The chat ID to retrieve (e.g., "oc_a0553eda9014c201e6969b478895c230").

lark.lark_create_chat

Create a new group chat in Lark. Specify a chat ID and name for the new chat.

Operation
Write write
Schema command
kosmo integrations:schema lark.lark_create_chat --json
ParameterTypeRequiredDescription
chat_id string yes A unique identifier for the new chat (e.g., "oc_my_new_chat").
name string yes The display name for the new group chat.

lark.lark_list_messages

List messages in a specific Lark chat. Returns message IDs, sender info, content, and timestamps.

Operation
Read read
Schema command
kosmo integrations:schema lark.lark_list_messages --json
ParameterTypeRequiredDescription
chat_id string yes The chat ID to list messages from (e.g., "oc_a0553eda9014c201e6969b478895c230").
page_size integer no Number of messages to return per page (max 50, default 20).
page_token string no Pagination cursor from a previous response to fetch the next page.

lark.lark_send_message

Send a message to a specific Lark chat. Supports text and rich message types.

Operation
Write write
Schema command
kosmo integrations:schema lark.lark_send_message --json
ParameterTypeRequiredDescription
chat_id string yes The chat ID to send the message to (e.g., "oc_a0553eda9014c201e6969b478895c230").
content string yes The message content. For text messages, pass plain text or JSON like '{"text":"Hello"}'. For rich messages, pass the appropriate JSON structure.
msg_type string no The message type: "text", "post", "image", "file", etc. Defaults to "text".

lark.lark_list_members

List members of a specific Lark chat. Returns member IDs, names, and roles.

Operation
Read read
Schema command
kosmo integrations:schema lark.lark_list_members --json
ParameterTypeRequiredDescription
chat_id string yes The chat ID to list members from (e.g., "oc_a0553eda9014c201e6969b478895c230").
page_size integer no Number of members to return per page (max 50, default 20).
page_token string no Pagination cursor from a previous response to fetch the next page.

lark.lark_get_current_user

Get information about the currently authenticated Lark user, including name, user ID, and avatar.

Operation
Read read
Schema command
kosmo integrations:schema lark.lark_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

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.