KosmoKrator

productivity

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.

Lark Suite CLI Setup

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

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

KeyEnv varTypeRequiredLabel
access_token LARK_ACCESS_TOKEN Secret secret yes Access Token
url LARK_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 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

Discovery

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

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

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.

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.

Read read
Parameters
page_size, page_token
Generic call
kosmo integrations:call lark.lark_list_chats '{"page_size":1,"page_token":"example_page_token"}' --json
Shortcut
kosmo integrations:lark lark_list_chats '{"page_size":1,"page_token":"example_page_token"}' --json

lark.lark_get_chat

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

Read read
Parameters
chat_id
Generic call
kosmo integrations:call lark.lark_get_chat '{"chat_id":"example_chat_id"}' --json
Shortcut
kosmo integrations:lark lark_get_chat '{"chat_id":"example_chat_id"}' --json

lark.lark_create_chat

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

Write write
Parameters
chat_id, name
Generic call
kosmo integrations:call lark.lark_create_chat '{"chat_id":"example_chat_id","name":"example_name"}' --json
Shortcut
kosmo integrations:lark lark_create_chat '{"chat_id":"example_chat_id","name":"example_name"}' --json

lark.lark_list_messages

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

Read read
Parameters
chat_id, page_size, page_token
Generic call
kosmo integrations:call lark.lark_list_messages '{"chat_id":"example_chat_id","page_size":1,"page_token":"example_page_token"}' --json
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

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

Write write
Parameters
chat_id, content, msg_type
Generic call
kosmo integrations:call lark.lark_send_message '{"chat_id":"example_chat_id","content":"example_content","msg_type":"example_msg_type"}' --json
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

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

Read read
Parameters
chat_id, page_size, page_token
Generic call
kosmo integrations:call lark.lark_list_members '{"chat_id":"example_chat_id","page_size":1,"page_token":"example_page_token"}' --json
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

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

Read read
Parameters
none
Generic call
kosmo integrations:call lark.lark_get_current_user '{}' --json
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 2 parameters
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 1 parameters
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 2 parameters
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 3 parameters
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 3 parameters
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 3 parameters
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 0 parameters
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.