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 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.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
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.
kosmo integrations:call line.line_reply_message '{"reply_token":"example_reply_token","messages":"example_messages","notification_disabled":true}' --json 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.
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 - Parameters
- reply_token, messages, notification_disabled
kosmo integrations:call line.line_reply_message '{"reply_token":"example_reply_token","messages":"example_messages","notification_disabled":true}' --json 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 - Parameters
- to, messages, notification_disabled, custom_aggregation_units
kosmo integrations:call line.line_send_message '{"to":"example_to","messages":"example_messages","notification_disabled":true,"custom_aggregation_units":"example_custom_aggregation_units"}' --json 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 - Parameters
- to, messages, notification_disabled
kosmo integrations:call line.line_multicast_message '{"to":"example_to","messages":"example_messages","notification_disabled":true}' --json 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 - Parameters
- messages, recipient, filter, notification_disabled
kosmo integrations:call line.line_narrowcast_message '{"messages":"example_messages","recipient":"example_recipient","filter":"example_filter","notification_disabled":true}' --json 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 - Parameters
- request_id
kosmo integrations:call line.line_get_narrowcast_progress '{"request_id":"example_request_id"}' --json 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 - Parameters
- messages, notification_disabled
kosmo integrations:call line.line_broadcast_message '{"messages":"example_messages","notification_disabled":true}' --json 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 - Parameters
- chat_id
kosmo integrations:call line.line_mark_as_read '{"chat_id":"example_chat_id"}' --json 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 - Parameters
- chat_id, loading_seconds
kosmo integrations:call line.line_start_loading_animation '{"chat_id":"example_chat_id","loading_seconds":1}' --json 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 - Parameters
- none
kosmo integrations:call line.line_get_message_quota '{}' --json kosmo integrations:line line_get_message_quota '{}' --json line.line_get_message_quota_consumption
Get LINE message quota consumption for the current month.
read - Parameters
- none
kosmo integrations:call line.line_get_message_quota_consumption '{}' --json 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 - Parameters
- type, date
kosmo integrations:call line.line_get_delivery_count '{"type":"example_type","date":"example_date"}' --json 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 - Parameters
- type, messages
kosmo integrations:call line.line_validate_messages '{"type":"example_type","messages":"example_messages"}' --json 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 - Parameters
- endpoint
kosmo integrations:call line.line_set_webhook_endpoint '{"endpoint":"example_endpoint"}' --json kosmo integrations:line line_set_webhook_endpoint '{"endpoint":"example_endpoint"}' --json line.line_get_webhook_endpoint
Get LINE channel webhook endpoint information.
read - Parameters
- none
kosmo integrations:call line.line_get_webhook_endpoint '{}' --json kosmo integrations:line line_get_webhook_endpoint '{}' --json line.line_test_webhook_endpoint
Test the LINE webhook endpoint.
write - Parameters
- endpoint
kosmo integrations:call line.line_test_webhook_endpoint '{"endpoint":"example_endpoint"}' --json 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 - Parameters
- user_id
kosmo integrations:call line.line_get_profile '{"user_id":"example_user_id"}' --json 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 - Parameters
- limit, start
kosmo integrations:call line.line_list_friends '{"limit":1,"start":"example_start"}' --json 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 - Parameters
- none
kosmo integrations:call line.line_get_current_user '{}' --json kosmo integrations:line line_get_current_user '{}' --json line.line_get_group_summary
Get LINE group chat summary information.
read - Parameters
- group_id
kosmo integrations:call line.line_get_group_summary '{"group_id":"example_group_id"}' --json 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 - Parameters
- group_id
kosmo integrations:call line.line_get_group_member_count '{"group_id":"example_group_id"}' --json 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 - Parameters
- group_id, start
kosmo integrations:call line.line_list_group_member_ids '{"group_id":"example_group_id","start":"example_start"}' --json 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 - Parameters
- group_id, user_id
kosmo integrations:call line.line_get_group_member_profile '{"group_id":"example_group_id","user_id":"example_user_id"}' --json 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 - Parameters
- group_id
kosmo integrations:call line.line_leave_group '{"group_id":"example_group_id"}' --json kosmo integrations:line line_leave_group '{"group_id":"example_group_id"}' --json line.line_create_rich_menu
Create a LINE rich menu object.
write - Parameters
- rich_menu
kosmo integrations:call line.line_create_rich_menu '{"rich_menu":"example_rich_menu"}' --json 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 - Parameters
- rich_menu
kosmo integrations:call line.line_validate_rich_menu '{"rich_menu":"example_rich_menu"}' --json 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 - Parameters
- none
kosmo integrations:call line.line_list_rich_menus '{}' --json kosmo integrations:line line_list_rich_menus '{}' --json line.line_get_rich_menu
Get LINE rich menu metadata.
read - Parameters
- rich_menu_id
kosmo integrations:call line.line_get_rich_menu '{"rich_menu_id":"example_rich_menu_id"}' --json 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 - Parameters
- rich_menu_id
kosmo integrations:call line.line_delete_rich_menu '{"rich_menu_id":"example_rich_menu_id"}' --json 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 - Parameters
- rich_menu_id
kosmo integrations:call line.line_set_default_rich_menu '{"rich_menu_id":"example_rich_menu_id"}' --json 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 - Parameters
- none
kosmo integrations:call line.line_get_default_rich_menu '{}' --json kosmo integrations:line line_get_default_rich_menu '{}' --json line.line_clear_default_rich_menu
Clear the default LINE rich menu.
write - Parameters
- none
kosmo integrations:call line.line_clear_default_rich_menu '{}' --json 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 - Parameters
- user_id, rich_menu_id
kosmo integrations:call line.line_link_rich_menu_to_user '{"user_id":"example_user_id","rich_menu_id":"example_rich_menu_id"}' --json 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 - Parameters
- user_id
kosmo integrations:call line.line_get_user_rich_menu '{"user_id":"example_user_id"}' --json 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 - Parameters
- user_id
kosmo integrations:call line.line_unlink_rich_menu_from_user '{"user_id":"example_user_id"}' --json 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 - Parameters
- user_id
kosmo integrations:call line.line_issue_link_token '{"user_id":"example_user_id"}' --json 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
kosmo integrations:schema line.line_reply_message --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema line.line_send_message --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema line.line_multicast_message --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema line.line_narrowcast_message --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema line.line_get_narrowcast_progress --json | Parameter | Type | Required | Description |
|---|---|---|---|
request_id | string | yes | Narrowcast request ID. |
line.line_broadcast_message 2 parameters
kosmo integrations:schema line.line_broadcast_message --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema line.line_mark_as_read --json | Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | string | yes | LINE user ID, group ID, or room ID. |
line.line_start_loading_animation 2 parameters
kosmo integrations:schema line.line_start_loading_animation --json | Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | string | yes | LINE chat ID. |
loading_seconds | integer | no | Optional loading duration in seconds. |
line.line_get_message_quota 0 parameters
kosmo integrations:schema line.line_get_message_quota --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
line.line_get_message_quota_consumption 0 parameters
kosmo integrations:schema line.line_get_message_quota_consumption --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
line.line_get_delivery_count 2 parameters
kosmo integrations:schema line.line_get_delivery_count --json | Parameter | Type | Required | Description |
|---|---|---|---|
type | string | yes | Delivery type: reply, push, multicast, or broadcast. |
date | string | yes | Date in yyyyMMdd format. |
line.line_validate_messages 2 parameters
kosmo integrations:schema line.line_validate_messages --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema line.line_set_webhook_endpoint --json | Parameter | Type | Required | Description |
|---|---|---|---|
endpoint | string | yes | HTTPS webhook endpoint URL. |
line.line_get_webhook_endpoint 0 parameters
kosmo integrations:schema line.line_get_webhook_endpoint --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
line.line_test_webhook_endpoint 1 parameters
kosmo integrations:schema line.line_test_webhook_endpoint --json | Parameter | Type | Required | Description |
|---|---|---|---|
endpoint | string | no | Optional endpoint URL to test. |
line.line_get_profile 1 parameters
kosmo integrations:schema line.line_get_profile --json | Parameter | Type | Required | Description |
|---|---|---|---|
user_id | string | yes | The LINE user ID to look up (e.g., "U4af4980629..."). |
line.line_list_friends 2 parameters
kosmo integrations:schema line.line_list_friends --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema line.line_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
line.line_get_group_summary 1 parameters
kosmo integrations:schema line.line_get_group_summary --json | Parameter | Type | Required | Description |
|---|---|---|---|
group_id | string | yes | LINE group ID. |
line.line_get_group_member_count 1 parameters
kosmo integrations:schema line.line_get_group_member_count --json | Parameter | Type | Required | Description |
|---|---|---|---|
group_id | string | yes | LINE group ID. |
line.line_list_group_member_ids 2 parameters
kosmo integrations:schema line.line_list_group_member_ids --json | Parameter | Type | Required | Description |
|---|---|---|---|
group_id | string | yes | LINE group ID. |
start | string | no | Continuation token. |
line.line_get_group_member_profile 2 parameters
kosmo integrations:schema line.line_get_group_member_profile --json | Parameter | Type | Required | Description |
|---|---|---|---|
group_id | string | yes | LINE group ID. |
user_id | string | yes | LINE user ID. |
line.line_leave_group 1 parameters
kosmo integrations:schema line.line_leave_group --json | Parameter | Type | Required | Description |
|---|---|---|---|
group_id | string | yes | LINE group ID. |
line.line_issue_link_token 1 parameters
kosmo integrations:schema line.line_issue_link_token --json | Parameter | Type | Required | Description |
|---|---|---|---|
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.