KosmoKrator

messaging

LINE Messaging CLI for AI Agents

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

5 functions 3 read 2 write Bearer token auth

LINE Messaging CLI Setup

LINE Messaging can be configured headlessly with `kosmokrator integrations:configure line`.

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

Call LINE Messaging Headlessly

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

kosmo integrations:call line.line_send_message '{
  "to": "example_to",
  "messages": "example_messages",
  "notification_disabled": true
}' --json

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

kosmo integrations:line line_send_message '{
  "to": "example_to",
  "messages": "example_messages",
  "notification_disabled": true
}' --json

Agent Discovery Commands

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

kosmo integrations:docs line --json
kosmo integrations:docs line.line_send_message --json
kosmo integrations:schema line.line_send_message --json
kosmo integrations:search "LINE Messaging" --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 LINE Messaging.

line.line_send_message

Write write

Send a push message to a specific LINE user, group, or room. Supports text, image, video, sticker, location, flex, and other message types.

Parameters
to, messages, notification_disabled

Generic CLI call

kosmo integrations:call line.line_send_message '{"to":"example_to","messages":"example_messages","notification_disabled":true}' --json

Provider shortcut

kosmo integrations:line line_send_message '{"to":"example_to","messages":"example_messages","notification_disabled":true}' --json

line.line_broadcast_message

Write write

Broadcast a message to all users who have added the LINE Official Account as a friend. Supports all message types.

Parameters
messages, notification_disabled

Generic CLI call

kosmo integrations:call line.line_broadcast_message '{"messages":"example_messages","notification_disabled":true}' --json

Provider shortcut

kosmo integrations:line line_broadcast_message '{"messages":"example_messages","notification_disabled":true}' --json

line.line_get_profile

Read read

Get the profile information of a LINE user, including display name, profile image URL, status message, and language.

Parameters
user_id

Generic CLI call

kosmo integrations:call line.line_get_profile '{"user_id":"example_user_id"}' --json

Provider shortcut

kosmo integrations:line line_get_profile '{"user_id":"example_user_id"}' --json

line.line_list_friends

Read read

List the friends (followers) of the LINE Official Account. Returns user IDs that can be used with send_message and get_profile.

Parameters
limit, start

Generic CLI call

kosmo integrations:call line.line_list_friends '{"limit":1,"start":"example_start"}' --json

Provider shortcut

kosmo integrations:line line_list_friends '{"limit":1,"start":"example_start"}' --json

line.line_get_current_user

Read read

Get the profile of the LINE Official Account (bot) itself, including display name, icon URL, and basic info.

Parameters
none

Generic CLI call

kosmo integrations:call line.line_get_current_user '{}' --json

Provider shortcut

kosmo integrations:line line_get_current_user '{}' --json

Function Schemas

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

line.line_send_message

Send a push message to a specific LINE user, group, or room. Supports text, image, video, sticker, location, flex, and other message types.

Operation
Write write
Schema command
kosmo integrations:schema line.line_send_message --json
ParameterTypeRequiredDescription
to string yes LINE user ID, group ID, or room ID to send the message to.
messages array yes Array of message objects. Each message must have a "type" (e.g., "text", "image", "sticker") and corresponding fields. Example for text: [{"type": "text", "text": "Hello!"}].
notification_disabled boolean no If true, the recipient will not receive a push notification. Default: false.

line.line_broadcast_message

Broadcast a message to all users who have added the LINE Official Account as a friend. Supports all message types.

Operation
Write write
Schema command
kosmo integrations:schema line.line_broadcast_message --json
ParameterTypeRequiredDescription
messages array yes Array of message objects to broadcast. Each message must have a "type" (e.g., "text", "image", "flex"). Example: [{"type": "text", "text": "Announcement!"}].
notification_disabled boolean no If true, recipients will not receive push notifications. Default: false.

line.line_get_profile

Get the profile information of a LINE user, including display name, profile image URL, status message, and language.

Operation
Read read
Schema command
kosmo integrations:schema line.line_get_profile --json
ParameterTypeRequiredDescription
user_id string yes The LINE user ID to look up (e.g., "U4af4980629...").

line.line_list_friends

List the friends (followers) of the LINE Official Account. Returns user IDs that can be used with send_message and get_profile.

Operation
Read read
Schema command
kosmo integrations:schema line.line_list_friends --json
ParameterTypeRequiredDescription
limit integer no Maximum number of friends to return (default: 100, max: 1000).
start string no Continuation token from a previous response to fetch the next page of results.

line.line_get_current_user

Get the profile of the LINE Official Account (bot) itself, including display name, icon URL, and basic info.

Operation
Read read
Schema command
kosmo integrations:schema line.line_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.