Skip to content
AI & Agents
Skill

/agent-line

Interact with LINE - send messages, read chats, manage conversations

From plugin
agent-messenger
17118 skills
Install
$ npx -y skills add agent-messenger/agent-messenger --skill agent-line --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/agent-line

Context preview

The summary Claude sees to decide when to auto-load this skill.

Interact with LINE - send messages, read chats, manage conversations

SKILL.md

agent-line.SKILL.md
name: agent-line
description: Interact with LINE - send messages, read chats, manage conversations
version: 2.36.0
allowed-tools: Bash(agent-line:*)
metadata:
  openclaw:
    requires:
      bins:
        - agent-line
    install:
      - kind: node
        package: agent-messenger
        bins: [agent-line]

Agent LINE

A TypeScript CLI tool that enables AI agents and humans to interact with LINE through a simple command interface. Features QR code login and email/password authentication for the LINE desktop client protocol.

Key Concepts

Before diving in, a few things about LINE's architecture:

  • **MIDs** = LINE's unique identifiers. Format varies by entity type:
  • `u<32hex>` for users (e.g., `u0123456789abcdef0123456789abcdef`)
  • `c<32hex>` for groups (e.g., `c0123456789abcdef0123456789abcdef`)
  • `r<32hex>` for rooms (e.g., `r0123456789abcdef0123456789abcdef`)
  • **QR code login** = the primary authentication method. The CLI generates a QR code URL, you scan it with your phone, and the session is established.
  • **Email/password login** = an alternative when QR scanning isn't practical.
  • **Auth token reuse** = after initial login, the CLI stores an auth token locally. Subsequent commands reuse it without re-authentication.
  • **Device types** = the CLI registers as `ANDROIDSECONDARY` by default — a secondary device that coexists with the LINE desktop app. Override with `--device`:
  • `ANDROIDSECONDARY` (default) — secondary device, V3-capable, won't kick LINE desktop
  • `DESKTOPMAC` / `DESKTOPWIN` — replaces the desktop session (kicks LINE desktop app)
  • `IOSIPAD` — secondary but limited API (no V3 token refresh)
  • **Chat ID** = an MID that identifies a conversation. Use `chat list` to discover them.

Quick Start

# QR code login (default, recommended)
agent-line auth login

# List chat rooms
agent-line chat list --pretty

# List messages in a chat
agent-line message list <chat-id>

# Send a message
agent-line message send <chat-id> "Hi"

Authentication

LINE offers three authentication methods:

Method 1: QR Code Login (Recommended)

The default and most common method. No credentials needed.

agent-line auth login

The CLI prints a QR code URL to stderr. The user scans it with the LINE app on their phone. Once scanned, authentication completes automatically.

Flow: 1. CLI requests a QR code session from LINE's server 2. A URL is printed to stderr (e.g., `https://line.me/R/au/q/...`) 3. User scans the QR code with their LINE mobile app 4. CLI detects the scan and completes login 5. Auth token is stored locally for future use

Method 2: Email/Password Login

For environments where QR scanning isn't possible:

agent-line auth login --email user@example.com --password pass123

Method 3: Token Login

If you already have a valid auth token:

agent-line auth login --token <auth-token>

Device Override

To specify a device type explicitly:

agent-line auth login --device DESKTOPMAC
agent-line auth login --device DESKTOPWIN

Agent Behavior (MANDATORY)

When a command fails because no account is configured, the agent MUST drive the auth flow itself:

**Step 1: Check auth status**

agent-line auth status

If authenticated, retry the original command.

**Step 2: Attempt login**

agent-line auth login

Possible responses:

  • `{"authenticated": true, ...}` → Success. Retry original command.
  • `{"next_action": "scan_qr", "qr_url": "...", "qr_html_path": "/tmp/line-qr-xxx.html", ...}` → QR code has been generated. The CLI attempts to open it in the user's browser automatically. If it didn't open, run `open <qr_html_path>` (macOS) to show the QR code. Tell the user to scan the QR code with the LINE mobile app. The command blocks until the user scans — once scanned, it outputs `{"authenticated": true, ...}`.
  • `{"error": "not_connected", ...}` → Network issue. Check connectivity and retry.
  • `{"error": "not_authenticated", ...}` → Credentials expired. Re-run `auth login`.

**Important**: QR login works in both interactive and non-interactive (agent) sessions. The CLI generates an HTML page with the QR code and opens it in the user's default browser. No TTY is required.

**Step 3: Retry the original command**

After successful auth, immediately execute whatever the user originally asked for.

**IMPORTANT**: NEVER guide the user to open a web browser, use DevTools, or manually copy tokens. Always use `agent-line auth login`.

Memory

The agent maintains a `~/.config/agent-messenger/MEMORY.md` file as persistent memory across sessions. This is agent-managed. The CLI does not read or write this file. Use the `Read` and `Write` tools to manage your memory file.

Reading Memory

At the **start of every task**, read `~/.config/agent-messenger/MEMORY.md` using the `Read` tool to load any previously discovered chat IDs, friend names, and preferences.

  • If the file doesn't exist yet, that's fine. Proceed without it and create it when you first have useful information to store.
  • If the file can't be read (permissions, missing directory), proceed without memory. Don't error out.

Writing Memory

After discovering useful information, update `~/.config/agent-messenger/MEMORY.md` using the `Write` tool. Write triggers include:

  • After login, remember the `account_id` from the output
  • After discovering chat IDs and participant names (from `chat list`)
  • After the user gives you an alias or preference ("call this the work chat", "my group chat with Alice is X")
  • After discovering chat structure (group chats, 1:1 chats)

When writing, include the **complete file content**. The `Write` tool overwrites the entire file.

What to Store

  • Account ID (MID) from login
  • Chat IDs with participant names or display names
  • User-given aliases ("work chat", "family group")
  • Commonly referenced chat IDs
  • Any user preference expressed during interaction

What NOT to Store

Ne

Read more
Ships withagent-messenger

Your agent messages as you — not as a bot One CLI for Slack, Discord, Teams, Webex, Telegram, WhatsApp, LINE, WeChat, iMessage, Instagram, KakaoTalk, and Channel Talk.

Get the whole plugin
Stats
180
Stars
29
Forks
Active
Maintenance
TypeScript
Language
4d ago
Last commit
6mo ago
Created

Repo: agent-messenger/agent-messenger