KosmoKrator

productivity

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.

LINE Messaging CLI Setup

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

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

KeyEnv varTypeRequiredLabel
access_token LINE_ACCESS_TOKEN Secret secret yes Channel Access Token
url LINE_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 line.line_reply_message '{"reply_token":"example_reply_token","messages":"example_messages","notification_disabled":true}' --json
Provider shortcut
kosmo integrations:line line_reply_message '{"reply_token":"example_reply_token","messages":"example_messages","notification_disabled":true}' --json

Discovery

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

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

line.line_reply_message

Send a reply message using a webhook reply token.

Write write
Parameters
reply_token, messages, notification_disabled
Generic call
kosmo integrations:call line.line_reply_message '{"reply_token":"example_reply_token","messages":"example_messages","notification_disabled":true}' --json
Shortcut
kosmo integrations:line line_reply_message '{"reply_token":"example_reply_token","messages":"example_messages","notification_disabled":true}' --json

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.

Write write
Parameters
to, messages, notification_disabled, custom_aggregation_units
Generic call
kosmo integrations:call line.line_send_message '{"to":"example_to","messages":"example_messages","notification_disabled":true,"custom_aggregation_units":"example_custom_aggregation_units"}' --json
Shortcut
kosmo integrations:line line_send_message '{"to":"example_to","messages":"example_messages","notification_disabled":true,"custom_aggregation_units":"example_custom_aggregation_units"}' --json

line.line_multicast_message

Send messages to multiple LINE user IDs.

Write write
Parameters
to, messages, notification_disabled
Generic call
kosmo integrations:call line.line_multicast_message '{"to":"example_to","messages":"example_messages","notification_disabled":true}' --json
Shortcut
kosmo integrations:line line_multicast_message '{"to":"example_to","messages":"example_messages","notification_disabled":true}' --json

line.line_narrowcast_message

Send a narrowcast message with recipient and demographic filters.

Write write
Parameters
messages, recipient, filter, notification_disabled
Generic call
kosmo integrations:call line.line_narrowcast_message '{"messages":"example_messages","recipient":"example_recipient","filter":"example_filter","notification_disabled":true}' --json
Shortcut
kosmo integrations:line line_narrowcast_message '{"messages":"example_messages","recipient":"example_recipient","filter":"example_filter","notification_disabled":true}' --json

line.line_get_narrowcast_progress

Get the progress status of a LINE narrowcast request.

Read read
Parameters
request_id
Generic call
kosmo integrations:call line.line_get_narrowcast_progress '{"request_id":"example_request_id"}' --json
Shortcut
kosmo integrations:line line_get_narrowcast_progress '{"request_id":"example_request_id"}' --json

line.line_broadcast_message

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

Write write
Parameters
messages, notification_disabled
Generic call
kosmo integrations:call line.line_broadcast_message '{"messages":"example_messages","notification_disabled":true}' --json
Shortcut
kosmo integrations:line line_broadcast_message '{"messages":"example_messages","notification_disabled":true}' --json

line.line_mark_as_read

Mark messages in a LINE chat as read.

Write write
Parameters
chat_id
Generic call
kosmo integrations:call line.line_mark_as_read '{"chat_id":"example_chat_id"}' --json
Shortcut
kosmo integrations:line line_mark_as_read '{"chat_id":"example_chat_id"}' --json

line.line_start_loading_animation

Display a LINE loading animation for a chat.

Write write
Parameters
chat_id, loading_seconds
Generic call
kosmo integrations:call line.line_start_loading_animation '{"chat_id":"example_chat_id","loading_seconds":1}' --json
Shortcut
kosmo integrations:line line_start_loading_animation '{"chat_id":"example_chat_id","loading_seconds":1}' --json

line.line_get_message_quota

Get the monthly LINE message quota limit.

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

line.line_get_message_quota_consumption

Get LINE message quota consumption for the current month.

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

line.line_get_delivery_count

Get number of sent LINE messages for reply, push, multicast, or broadcast on a date.

Read read
Parameters
type, date
Generic call
kosmo integrations:call line.line_get_delivery_count '{"type":"example_type","date":"example_date"}' --json
Shortcut
kosmo integrations:line line_get_delivery_count '{"type":"example_type","date":"example_date"}' --json

line.line_validate_messages

Validate LINE message objects for a target send endpoint.

Write write
Parameters
type, messages
Generic call
kosmo integrations:call line.line_validate_messages '{"type":"example_type","messages":"example_messages"}' --json
Shortcut
kosmo integrations:line line_validate_messages '{"type":"example_type","messages":"example_messages"}' --json

line.line_set_webhook_endpoint

Set the LINE channel webhook endpoint URL.

Write write
Parameters
endpoint
Generic call
kosmo integrations:call line.line_set_webhook_endpoint '{"endpoint":"example_endpoint"}' --json
Shortcut
kosmo integrations:line line_set_webhook_endpoint '{"endpoint":"example_endpoint"}' --json

line.line_get_webhook_endpoint

Get LINE channel webhook endpoint information.

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

line.line_test_webhook_endpoint

Test the LINE webhook endpoint.

Write write
Parameters
endpoint
Generic call
kosmo integrations:call line.line_test_webhook_endpoint '{"endpoint":"example_endpoint"}' --json
Shortcut
kosmo integrations:line line_test_webhook_endpoint '{"endpoint":"example_endpoint"}' --json

line.line_get_profile

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

Read read
Parameters
user_id
Generic call
kosmo integrations:call line.line_get_profile '{"user_id":"example_user_id"}' --json
Shortcut
kosmo integrations:line line_get_profile '{"user_id":"example_user_id"}' --json

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.

Read read
Parameters
limit, start
Generic call
kosmo integrations:call line.line_list_friends '{"limit":1,"start":"example_start"}' --json
Shortcut
kosmo integrations:line line_list_friends '{"limit":1,"start":"example_start"}' --json

line.line_get_current_user

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

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

line.line_get_group_summary

Get LINE group chat summary information.

Read read
Parameters
group_id
Generic call
kosmo integrations:call line.line_get_group_summary '{"group_id":"example_group_id"}' --json
Shortcut
kosmo integrations:line line_get_group_summary '{"group_id":"example_group_id"}' --json

line.line_get_group_member_count

Get member count for a LINE group chat.

Read read
Parameters
group_id
Generic call
kosmo integrations:call line.line_get_group_member_count '{"group_id":"example_group_id"}' --json
Shortcut
kosmo integrations:line line_get_group_member_count '{"group_id":"example_group_id"}' --json

line.line_list_group_member_ids

List LINE group member user IDs.

Read read
Parameters
group_id, start
Generic call
kosmo integrations:call line.line_list_group_member_ids '{"group_id":"example_group_id","start":"example_start"}' --json
Shortcut
kosmo integrations:line line_list_group_member_ids '{"group_id":"example_group_id","start":"example_start"}' --json

line.line_get_group_member_profile

Get profile information for a LINE group member.

Read read
Parameters
group_id, user_id
Generic call
kosmo integrations:call line.line_get_group_member_profile '{"group_id":"example_group_id","user_id":"example_user_id"}' --json
Shortcut
kosmo integrations:line line_get_group_member_profile '{"group_id":"example_group_id","user_id":"example_user_id"}' --json

line.line_leave_group

Leave a LINE group chat.

Write write
Parameters
group_id
Generic call
kosmo integrations:call line.line_leave_group '{"group_id":"example_group_id"}' --json
Shortcut
kosmo integrations:line line_leave_group '{"group_id":"example_group_id"}' --json

line.line_create_rich_menu

Create a LINE rich menu object.

Write write
Parameters
rich_menu
Generic call
kosmo integrations:call line.line_create_rich_menu '{"rich_menu":"example_rich_menu"}' --json
Shortcut
kosmo integrations:line line_create_rich_menu '{"rich_menu":"example_rich_menu"}' --json

line.line_validate_rich_menu

Validate a LINE rich menu object.

Write write
Parameters
rich_menu
Generic call
kosmo integrations:call line.line_validate_rich_menu '{"rich_menu":"example_rich_menu"}' --json
Shortcut
kosmo integrations:line line_validate_rich_menu '{"rich_menu":"example_rich_menu"}' --json

line.line_list_rich_menus

List LINE rich menus configured for the channel.

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

line.line_get_rich_menu

Get LINE rich menu metadata.

Read read
Parameters
rich_menu_id
Generic call
kosmo integrations:call line.line_get_rich_menu '{"rich_menu_id":"example_rich_menu_id"}' --json
Shortcut
kosmo integrations:line line_get_rich_menu '{"rich_menu_id":"example_rich_menu_id"}' --json

line.line_delete_rich_menu

Delete a LINE rich menu by ID.

Write write
Parameters
rich_menu_id
Generic call
kosmo integrations:call line.line_delete_rich_menu '{"rich_menu_id":"example_rich_menu_id"}' --json
Shortcut
kosmo integrations:line line_delete_rich_menu '{"rich_menu_id":"example_rich_menu_id"}' --json

line.line_set_default_rich_menu

Set the default rich menu for all LINE users.

Write write
Parameters
rich_menu_id
Generic call
kosmo integrations:call line.line_set_default_rich_menu '{"rich_menu_id":"example_rich_menu_id"}' --json
Shortcut
kosmo integrations:line line_set_default_rich_menu '{"rich_menu_id":"example_rich_menu_id"}' --json

line.line_get_default_rich_menu

Get the default LINE rich menu ID.

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

line.line_clear_default_rich_menu

Clear the default LINE rich menu.

Write write
Parameters
none
Generic call
kosmo integrations:call line.line_clear_default_rich_menu '{}' --json
Shortcut
kosmo integrations:line line_clear_default_rich_menu '{}' --json

line.line_link_rich_menu_to_user

Link a LINE rich menu to a specific user.

Write write
Parameters
user_id, rich_menu_id
Generic call
kosmo integrations:call line.line_link_rich_menu_to_user '{"user_id":"example_user_id","rich_menu_id":"example_rich_menu_id"}' --json
Shortcut
kosmo integrations:line line_link_rich_menu_to_user '{"user_id":"example_user_id","rich_menu_id":"example_rich_menu_id"}' --json

line.line_get_user_rich_menu

Get the rich menu linked to a LINE user.

Read read
Parameters
user_id
Generic call
kosmo integrations:call line.line_get_user_rich_menu '{"user_id":"example_user_id"}' --json
Shortcut
kosmo integrations:line line_get_user_rich_menu '{"user_id":"example_user_id"}' --json

line.line_unlink_rich_menu_from_user

Unlink a rich menu from a LINE user.

Write write
Parameters
user_id
Generic call
kosmo integrations:call line.line_unlink_rich_menu_from_user '{"user_id":"example_user_id"}' --json
Shortcut
kosmo integrations:line line_unlink_rich_menu_from_user '{"user_id":"example_user_id"}' --json

line.line_issue_link_token

Issue an account-link token for a LINE user.

Write write
Parameters
user_id
Generic call
kosmo integrations:call line.line_issue_link_token '{"user_id":"example_user_id"}' --json
Shortcut
kosmo integrations:line line_issue_link_token '{"user_id":"example_user_id"}' --json

Function Schemas

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

line.line_reply_message 3 parameters
Schema command
kosmo integrations:schema line.line_reply_message --json
ParameterTypeRequiredDescription
reply_token string yes Reply token from a webhook event.
messages array yes Array of LINE message objects.
notification_disabled boolean no Disable push notification when true.
line.line_send_message 4 parameters
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.
custom_aggregation_units string no Optional custom aggregation unit for message analytics.
line.line_multicast_message 3 parameters
Schema command
kosmo integrations:schema line.line_multicast_message --json
ParameterTypeRequiredDescription
to array yes Array of LINE user IDs.
messages array yes Array of LINE message objects.
notification_disabled boolean no Disable push notification when true.
line.line_narrowcast_message 4 parameters
Schema command
kosmo integrations:schema line.line_narrowcast_message --json
ParameterTypeRequiredDescription
messages array yes Array of LINE message objects.
recipient object no Recipient object such as audienceGroupId include/exclude filters.
filter object no Demographic filter object.
notification_disabled boolean no Disable push notification when true.
line.line_get_narrowcast_progress 1 parameters
Schema command
kosmo integrations:schema line.line_get_narrowcast_progress --json
ParameterTypeRequiredDescription
request_id string yes Narrowcast request ID.
line.line_broadcast_message 2 parameters
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_mark_as_read 1 parameters
Schema command
kosmo integrations:schema line.line_mark_as_read --json
ParameterTypeRequiredDescription
chat_id string yes LINE user ID, group ID, or room ID.
line.line_start_loading_animation 2 parameters
Schema command
kosmo integrations:schema line.line_start_loading_animation --json
ParameterTypeRequiredDescription
chat_id string yes LINE chat ID.
loading_seconds integer no Optional loading duration in seconds.
line.line_get_message_quota 0 parameters
Schema command
kosmo integrations:schema line.line_get_message_quota --json
ParameterTypeRequiredDescription
No parameters.
line.line_get_message_quota_consumption 0 parameters
Schema command
kosmo integrations:schema line.line_get_message_quota_consumption --json
ParameterTypeRequiredDescription
No parameters.
line.line_get_delivery_count 2 parameters
Schema command
kosmo integrations:schema line.line_get_delivery_count --json
ParameterTypeRequiredDescription
type string yes Delivery type: reply, push, multicast, or broadcast.
date string yes Date in yyyyMMdd format.
line.line_validate_messages 2 parameters
Schema command
kosmo integrations:schema line.line_validate_messages --json
ParameterTypeRequiredDescription
type string yes Validation type: reply, push, multicast, narrowcast, or broadcast.
messages array yes Array of LINE message objects to validate.
line.line_set_webhook_endpoint 1 parameters
Schema command
kosmo integrations:schema line.line_set_webhook_endpoint --json
ParameterTypeRequiredDescription
endpoint string yes HTTPS webhook endpoint URL.
line.line_get_webhook_endpoint 0 parameters
Schema command
kosmo integrations:schema line.line_get_webhook_endpoint --json
ParameterTypeRequiredDescription
No parameters.
line.line_test_webhook_endpoint 1 parameters
Schema command
kosmo integrations:schema line.line_test_webhook_endpoint --json
ParameterTypeRequiredDescription
endpoint string no Optional endpoint URL to test.
line.line_get_profile 1 parameters
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 2 parameters
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 0 parameters
Schema command
kosmo integrations:schema line.line_get_current_user --json
ParameterTypeRequiredDescription
No parameters.
line.line_get_group_summary 1 parameters
Schema command
kosmo integrations:schema line.line_get_group_summary --json
ParameterTypeRequiredDescription
group_id string yes LINE group ID.
line.line_get_group_member_count 1 parameters
Schema command
kosmo integrations:schema line.line_get_group_member_count --json
ParameterTypeRequiredDescription
group_id string yes LINE group ID.
line.line_list_group_member_ids 2 parameters
Schema command
kosmo integrations:schema line.line_list_group_member_ids --json
ParameterTypeRequiredDescription
group_id string yes LINE group ID.
start string no Continuation token.
line.line_get_group_member_profile 2 parameters
Schema command
kosmo integrations:schema line.line_get_group_member_profile --json
ParameterTypeRequiredDescription
group_id string yes LINE group ID.
user_id string yes LINE user ID.
line.line_leave_group 1 parameters
Schema command
kosmo integrations:schema line.line_leave_group --json
ParameterTypeRequiredDescription
group_id string yes LINE group ID.
line.line_create_rich_menu 1 parameters
Schema command
kosmo integrations:schema line.line_create_rich_menu --json
ParameterTypeRequiredDescription
rich_menu object yes LINE rich menu object without richMenuId.
line.line_validate_rich_menu 1 parameters
Schema command
kosmo integrations:schema line.line_validate_rich_menu --json
ParameterTypeRequiredDescription
rich_menu object yes LINE rich menu object without richMenuId.
line.line_list_rich_menus 0 parameters
Schema command
kosmo integrations:schema line.line_list_rich_menus --json
ParameterTypeRequiredDescription
No parameters.
line.line_get_rich_menu 1 parameters
Schema command
kosmo integrations:schema line.line_get_rich_menu --json
ParameterTypeRequiredDescription
rich_menu_id string yes LINE rich menu ID.
line.line_delete_rich_menu 1 parameters
Schema command
kosmo integrations:schema line.line_delete_rich_menu --json
ParameterTypeRequiredDescription
rich_menu_id string yes Rich menu ID.
line.line_set_default_rich_menu 1 parameters
Schema command
kosmo integrations:schema line.line_set_default_rich_menu --json
ParameterTypeRequiredDescription
rich_menu_id string yes Rich menu ID.
line.line_get_default_rich_menu 0 parameters
Schema command
kosmo integrations:schema line.line_get_default_rich_menu --json
ParameterTypeRequiredDescription
No parameters.
line.line_clear_default_rich_menu 0 parameters
Schema command
kosmo integrations:schema line.line_clear_default_rich_menu --json
ParameterTypeRequiredDescription
No parameters.
line.line_get_user_rich_menu 1 parameters
Schema command
kosmo integrations:schema line.line_get_user_rich_menu --json
ParameterTypeRequiredDescription
user_id string yes LINE user 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.