agent-line

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

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.
一款TypeScript CLI工具,支持AI Agent和人类通过简单的命令行界面与LINE交互。支持LINE桌面客户端协议的二维码登录和邮箱/密码认证功能。

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.
开始使用前,先了解LINE的一些架构知识:
  • MIDs = LINE的唯一标识符,格式根据实体类型不同而有所区别:
    • u<32hex>
      代表用户(例如:
      u0123456789abcdef0123456789abcdef
    • c<32hex>
      代表群组(例如:
      c0123456789abcdef0123456789abcdef
    • r<32hex>
      代表聊天室(例如:
      r0123456789abcdef0123456789abcdef
  • 二维码登录 = 主要认证方式。CLI生成一个二维码URL,用户用手机扫描即可建立会话。
  • 邮箱/密码登录 = 二维码扫描不可用时的替代方案。
  • 认证令牌复用 = 首次登录后,CLI会在本地存储认证令牌,后续命令可复用该令牌无需重新认证。
  • 设备类型 = CLI默认注册为
    ANDROIDSECONDARY
    ——这是一种可与LINE桌面应用共存的辅助设备。可通过
    --device
    参数覆盖:
    • ANDROIDSECONDARY
      (默认)——辅助设备,支持V3协议,不会强制下线LINE桌面应用
    • DESKTOPMAC
      /
      DESKTOPWIN
      ——会替换桌面会话(强制下线LINE桌面应用)
    • IOSIPAD
      ——辅助设备但API受限(不支持V3令牌刷新)
  • 聊天ID = 用于标识对话的MID。使用
    chat list
    命令查看所有聊天ID。

Quick Start

快速开始

bash
undefined
bash
undefined

QR code login (default, recommended)

二维码登录(默认推荐方式)

agent-line auth login
agent-line auth login

List chat rooms

列出所有聊天室

agent-line chat list --pretty
agent-line chat list --pretty

List messages in a chat

查看指定聊天中的消息

agent-line message list <chat-id>
agent-line message list <chat-id>

Send a message

发送消息

agent-line message send <chat-id> "Hi"
undefined
agent-line message send <chat-id> "Hi"
undefined

Authentication

认证方式

LINE offers three authentication methods:
LINE提供三种认证方式:

Method 1: QR Code Login (Recommended)

方式1:二维码登录(推荐)

The default and most common method. No credentials needed.
bash
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
默认且最常用的方式,无需输入凭据。
bash
agent-line auth login
CLI会在标准错误输出中打印二维码URL,用户使用手机上的LINE应用扫描该二维码,扫描完成后认证自动完成。
流程:
  1. CLI向LINE服务器请求二维码会话
  2. 在标准错误输出中打印URL(例如:
    https://line.me/R/au/q/...
  3. 用户使用LINE移动应用扫描二维码
  4. CLI检测到扫描完成并完成登录
  5. 认证令牌存储在本地供后续使用

Method 2: Email/Password Login

方式2:邮箱/密码登录

For environments where QR scanning isn't possible:
bash
agent-line auth login --email user@example.com --password pass123
适用于无法扫描二维码的环境:
bash
agent-line auth login --email user@example.com --password pass123

Method 3: Token Login

方式3:令牌登录

If you already have a valid auth token:
bash
agent-line auth login --token <auth-token>
如果已有有效的认证令牌:
bash
agent-line auth login --token <auth-token>

Device Override

设备类型覆盖

To specify a device type explicitly:
bash
agent-line auth login --device DESKTOPMAC
agent-line auth login --device DESKTOPWIN
显式指定设备类型:
bash
agent-line auth login --device DESKTOPMAC
agent-line auth login --device DESKTOPWIN

Agent Behavior (MANDATORY)

Agent行为规范(必须遵守)

When a command fails because no account is configured, the agent MUST drive the auth flow itself:
Step 1: Check auth status
bash
agent-line auth status
If authenticated, retry the original command.
Step 2: Attempt login
bash
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
.
当命令因未配置账户而失败时,Agent必须自动驱动认证流程:
步骤1:检查认证状态
bash
agent-line auth status
如果已认证,重试原命令。
步骤2:尝试登录
bash
agent-line auth login
可能的响应:
  • {"authenticated": true, ...}
    → 登录成功,重试原命令。
  • {"next_action": "scan_qr", "qr_url": "...", "qr_html_path": "/tmp/line-qr-xxx.html", ...}
    → 已生成二维码。CLI会尝试自动在用户浏览器中打开二维码页面。如果未自动打开,可运行
    open <qr_html_path>
    (macOS)显示二维码。告知用户使用LINE移动应用扫描二维码,命令会阻塞直至用户完成扫描——扫描完成后会输出
    {"authenticated": true, ...}
  • {"error": "not_connected", ...}
    → 网络问题,检查网络连接后重试。
  • {"error": "not_authenticated", ...}
    → 凭据过期,重新运行
    auth login
    命令。
重要提示:二维码登录在交互式和非交互式(Agent)会话中均有效。CLI会生成包含二维码的HTML页面并在用户默认浏览器中打开,无需TTY。
步骤3:重试原命令
认证成功后,立即执行用户最初请求的操作。
重要注意事项:绝对不要引导用户打开浏览器开发者工具或手动复制令牌,必须始终使用
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.
Agent会维护一个
~/.config/agent-messenger/MEMORY.md
文件,作为跨会话的持久化存储。该文件由Agent管理,CLI不会读写此文件。使用
Read
Write
工具管理内存文件。

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.
每个任务开始时,使用
Read
工具读取
~/.config/agent-messenger/MEMORY.md
,加载之前保存的聊天ID、好友名称和用户偏好。
  • 如果文件尚未存在,无需处理,继续执行任务,当有有用信息时再创建该文件。
  • 如果无法读取文件(权限问题、目录缺失),无需报错,继续执行任务。

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.
发现有用信息后,使用
Write
工具更新
~/.config/agent-messenger/MEMORY.md
。触发写入的场景包括:
  • 登录完成后,保存输出中的
    account_id
  • 发现聊天ID和参与者名称后(来自
    chat list
    命令)
  • 用户设置别名或偏好后(例如:"将这个聊天称为工作群"、"我和Alice的群聊ID是X")
  • 发现聊天结构后(群组、一对一聊天)
写入时需包含完整的文件内容
Write
工具会覆盖整个文件。

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
  • 登录时获取的账户ID(MID)
  • 带有参与者名称或显示名的聊天ID
  • 用户设置的别名(例如:"工作群"、"家庭群")
  • 常用的聊天ID
  • 交互过程中用户表达的任何偏好

What NOT to Store

禁止存储内容

Never store tokens, passwords, credentials, or any sensitive data. Never store full message content (just IDs and chat context). Never store auth tokens.
绝对不要存储令牌、密码、凭据或任何敏感数据。不要存储完整消息内容(仅存储ID和聊天上下文)。不要存储认证令牌。

Handling Stale Data

处理过期数据

If a memorized chat ID returns an error, remove it from
MEMORY.md
. Don't blindly trust memorized data. Verify when something seems off. Prefer re-listing over using a memorized ID that might be stale.
如果保存的聊天ID返回错误,将其从
MEMORY.md
中删除。不要盲目信任保存的数据,当出现异常时进行验证。优先重新列出聊天ID,而非使用可能过期的保存ID。

Format / Example

格式示例

markdown
undefined
markdown
undefined

Agent Messenger Memory

Agent Messenger 内存

LINE Account

LINE 账户

  • Account ID:
    u0123456789abcdef0123456789abcdef
  • Device type: DESKTOPMAC
  • 账户ID:
    u0123456789abcdef0123456789abcdef
  • 设备类型: DESKTOPMAC

Chat Rooms

聊天室

  • c9876543210abcdef9876543210abcdef
    - Work group chat (Alice, Bob, Charlie)
  • u1111111111abcdef1111111111abcdef
    - 1:1 with Alice
  • c2222222222abcdef2222222222abcdef
    - Family group
  • c9876543210abcdef9876543210abcdef
    - 工作群聊(Alice, Bob, Charlie)
  • u1111111111abcdef1111111111abcdef
    - 与Alice的一对一聊天
  • c2222222222abcdef2222222222abcdef
    - 家庭群

Aliases

别名

  • "work" ->
    c9876543210abcdef9876543210abcdef
    (Work group chat)
  • "alice" ->
    u1111111111abcdef1111111111abcdef
    (1:1 with Alice)
  • "work" ->
    c9876543210abcdef9876543210abcdef
    (工作群聊)
  • "alice" ->
    u1111111111abcdef1111111111abcdef
    (与Alice的一对一聊天)

Notes

备注

  • User prefers --pretty output
  • Work chat is the most frequently used

> Memory lets you skip repeated `chat list` calls. When you already know a chat ID from a previous session, use it directly.
  • 用户偏好使用--pretty输出
  • 工作群聊是最常用的聊天

> 内存功能可避免重复调用`chat list`命令。如果已从之前的会话中获取聊天ID,可直接使用。

Commands

命令列表

Auth Commands

认证命令

bash
undefined
bash
undefined

QR code login (default)

二维码登录(默认)

agent-line auth login agent-line auth login --pretty
agent-line auth login agent-line auth login --pretty

Email/password login

邮箱/密码登录

agent-line auth login --email <email> --password <password> agent-line auth login --email <email> --password <password> --pretty
agent-line auth login --email <email> --password <password> agent-line auth login --email <email> --password <password> --pretty

Token login

令牌登录

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

Device override

设备类型覆盖

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

Check auth status

检查认证状态

agent-line auth status agent-line auth status --account <account-id> agent-line auth status --pretty
agent-line auth status agent-line auth status --account <account-id> agent-line auth status --pretty

List all authenticated accounts

列出所有已认证账户

agent-line auth list agent-line auth list --pretty
agent-line auth list agent-line auth list --pretty

Switch active account

切换活跃账户

agent-line auth use <account-id> agent-line auth use <account-id> --pretty
agent-line auth use <account-id> agent-line auth use <account-id> --pretty

Logout

登出

agent-line auth logout agent-line auth logout <account-id> agent-line auth logout --pretty
undefined
agent-line auth logout agent-line auth logout <account-id> agent-line auth logout --pretty
undefined

Whoami Command

Whoami命令

bash
undefined
bash
undefined

Show current authenticated user

显示当前已认证用户

agent-line whoami agent-line whoami --pretty

Output includes:
- `mid` - your LINE MID
- `display_name` - your display name
- `status_message` - your status message
- `picture_url` - your profile picture URL
agent-line whoami agent-line whoami --pretty

输出内容包括:
- `mid` - 你的LINE MID
- `display_name` - 你的显示名称
- `status_message` - 你的状态消息
- `picture_url` - 你的头像URL

Friend Commands

好友命令

bash
undefined
bash
undefined

List all LINE friends

列出所有LINE好友

agent-line friend list agent-line friend list --pretty

Output includes:
- `mid` - friend's MID
- `display_name` - friend's display name
- `status_message` - friend's status message
- `picture_url` - friend's profile picture URL
agent-line friend list agent-line friend list --pretty

输出内容包括:
- `mid` - 好友的MID
- `display_name` - 好友的显示名称
- `status_message` - 好友的状态消息
- `picture_url` - 好友的头像URL

Chat Commands

聊天命令

bash
undefined
bash
undefined

List all chat rooms

列出所有聊天室

agent-line chat list agent-line chat list --pretty

Output includes:
- `chat_id` - MID of the chat room
- `type` - chat type (user, group, room, square)
- `display_name` - chat name
- `member_count` - number of members (groups only)
agent-line chat list agent-line chat list --pretty

输出内容包括:
- `chat_id` - 聊天室的MID
- `type` - 聊天类型(用户、群组、聊天室、广场)
- `display_name` - 聊天名称
- `member_count` - 成员数量(仅群组)

Message Commands

消息命令

bash
undefined
bash
undefined

List messages in a chat room

查看指定聊天中的消息

agent-line message list <chat-id> agent-line message list <chat-id> -n 50 agent-line message list <chat-id> --pretty
agent-line message list <chat-id> agent-line message list <chat-id> -n 50 agent-line message list <chat-id> --pretty

Send a text message

发送文本消息

agent-line message send <chat-id> "Hello world" agent-line message send <chat-id> "Hello world" --pretty
undefined
agent-line message send <chat-id> "Hello world" agent-line message send <chat-id> "Hello world" --pretty
undefined

Message List Output

消息列表输出

Each message includes:
  • message_id
    - unique message identifier
  • type
    - message type (text, image, sticker, etc.)
  • author_id
    - sender's MID
  • text
    - message text content
  • sent_at
    - Unix timestamp (milliseconds)
每条消息包含:
  • message_id
    - 唯一消息标识符
  • type
    - 消息类型(文本、图片、贴纸等)
  • author_id
    - 发送者的MID
  • text
    - 消息文本内容
  • sent_at
    - Unix时间戳(毫秒)

Output Format

输出格式

JSON (Default)

JSON(默认)

All commands output JSON by default for AI consumption:
json
{
  "chat_id": "c0123456789abcdef0123456789abcdef",
  "type": "group",
  "display_name": "Alice, Bob",
  "member_count": 3,
  "unread_count": 5,
  "last_message": {
    "author_id": "u1111111111abcdef1111111111abcdef",
    "text": "Hello everyone!",
    "sent_at": 1705312200000
  }
}
所有命令默认输出JSON格式,供AI处理:
json
{
  "chat_id": "c0123456789abcdef0123456789abcdef",
  "type": "group",
  "display_name": "Alice, Bob",
  "member_count": 3,
  "unread_count": 5,
  "last_message": {
    "author_id": "u1111111111abcdef1111111111abcdef",
    "text": "Hello everyone!",
    "sent_at": 1705312200000
  }
}

Pretty (Human-Readable)

格式化输出(人类可读)

Use
--pretty
flag for formatted output:
bash
agent-line chat list --pretty
使用
--pretty
参数获取格式化输出:
bash
agent-line chat list --pretty

Global Options

全局选项

OptionDescription
--pretty
Human-readable output instead of JSON
选项描述
--pretty
输出人类可读格式,替代默认JSON格式

Common Patterns

常见模式

See
references/common-patterns.md
for typical AI agent workflows.
查看
references/common-patterns.md
获取典型AI Agent工作流。

Templates

模板

See
templates/
directory for runnable examples:
  • post-message.sh
    - Send messages with error handling
  • monitor-chat.sh
    - Monitor a chat for new messages
  • chat-summary.sh
    - Generate chat summary
查看
templates/
目录获取可运行示例:
  • post-message.sh
    - 带错误处理的消息发送脚本
  • monitor-chat.sh
    - 聊天室消息监控脚本
  • chat-summary.sh
    - 聊天摘要生成脚本

Error Handling

错误处理

All commands return consistent error format:
json
{
  "error": "not_connected",
  "message": "Not connected to LINE. Run:\n  agent-line auth login"
}
Common errors:
  • not_connected
    - not authenticated. Run
    agent-line auth login
    .
  • not_authenticated
    - credentials expired or invalid. Re-run
    agent-line auth login
    to get a fresh session.
  • qr_timeout
    - QR code expired before user scanned it. Run
    auth login
    again to generate a new QR code.
  • invalid_token
    - the stored auth token is no longer valid. Re-authenticate with
    auth login
    .
  • login_failed
    - email/password incorrect or account issue.
  • network_error
    - couldn't reach LINE servers. Check connectivity.
  • rate_limited
    - too many requests. Wait a moment and retry.
所有命令返回一致的错误格式:
json
{
  "error": "not_connected",
  "message": "未连接到LINE,请运行:\n  agent-line auth login"
}
常见错误:
  • not_connected
    - 未认证,请运行
    agent-line auth login
  • not_authenticated
    - 凭据过期或无效,重新运行
    agent-line auth login
    获取新会话。
  • qr_timeout
    - 用户扫描前二维码已过期,重新运行
    auth login
    生成新二维码。
  • invalid_token
    - 存储的认证令牌失效,使用
    auth login
    重新认证。
  • login_failed
    - 邮箱/密码错误或账户问题。
  • network_error
    - 无法连接到LINE服务器,检查网络连接。
  • rate_limited
    - 请求过于频繁,稍等后重试。

Configuration

配置

Credentials stored in
~/.config/agent-messenger/line-credentials.json
(0600 permissions).
Config format:
json
{
  "current_account": "u0123456789abcdef0123456789abcdef",
  "accounts": {
    "u0123456789abcdef0123456789abcdef": {
      "account_id": "u0123456789abcdef0123456789abcdef",
      "auth_token": "...",
      "device_type": "DESKTOPMAC",
      "created_at": "2025-01-15T10:30:00.000Z",
      "updated_at": "2025-01-15T10:30:00.000Z"
    }
  }
}
凭据存储在
~/.config/agent-messenger/line-credentials.json
(权限为0600)。
配置格式:
json
{
  "current_account": "u0123456789abcdef0123456789abcdef",
  "accounts": {
    "u0123456789abcdef0123456789abcdef": {
      "account_id": "u0123456789abcdef0123456789abcdef",
      "auth_token": "...",
      "device_type": "DESKTOPMAC",
      "created_at": "2025-01-15T10:30:00.000Z",
      "updated_at": "2025-01-15T10:30:00.000Z"
    }
  }
}

SDK: Programmatic Usage

SDK:编程使用

LineClient
is available as a TypeScript SDK for building scripts and automations.
LineClient
作为TypeScript SDK提供,用于构建脚本和自动化流程。

Setup

初始化

typescript
import { LineClient } from 'agent-messenger/line'

const client = await new LineClient().login()
typescript
import { LineClient } from 'agent-messenger/line'

const client = await new LineClient().login()

Example

示例

typescript
try {
  // List chats
  const chats = await client.getChats()

  // Send a message
  if (chats.length === 0) throw new Error('No chats found')
  const chatId = chats[0].chat_id
  const result = await client.sendMessage(chatId, 'Hello from SDK!')

  // Read messages
  const messages = await client.getMessages(chatId, { count: 50 })
} finally {
  client.close()
}
typescript
try {
  // 列出聊天
  const chats = await client.getChats()

  // 发送消息
  if (chats.length === 0) throw new Error('未找到聊天')
  const chatId = chats[0].chat_id
  const result = await client.sendMessage(chatId, 'Hello from SDK!')

  // 读取消息
  const messages = await client.getMessages(chatId, { count: 50 })
} finally {
  client.close()
}

Full API Reference

完整API参考

See the LINE SDK documentation for complete method signatures, types, schemas, and examples.
查看LINE SDK文档获取完整方法签名、类型、模式和示例。

Limitations

局限性

  • No auto-extraction of credentials (requires interactive login via QR code or email/password)
  • E2EE (Letter Sealing) may prevent reading some message content
  • No file upload support yet
  • No sticker or rich message sending (text only)
  • No group creation or management
  • No group creation or management commands (list only)
  • No reactions or emoji responses
  • No message editing or deletion
  • No voice/video call support
  • Chat IDs are MIDs and not human-readable. Use
    chat list
    to discover them.
  • 无法自动提取凭据(需通过二维码或邮箱/密码进行交互式登录)
  • E2EE(端到端加密)可能导致部分消息内容无法读取
  • 暂不支持文件上传
  • 暂不支持发送贴纸或富媒体消息(仅支持文本)
  • 暂不支持群组创建或管理
  • 暂不支持群组创建或管理命令(仅支持列出)
  • 暂不支持消息反应或表情回复
  • 暂不支持消息编辑或删除
  • 暂不支持语音/视频通话
  • 聊天ID为MID,不便于人类识别,需使用
    chat list
    命令查看

Troubleshooting

故障排除

agent-line: command not found

agent-line: command not found

agent-line
is NOT the npm package name.
The npm package is
agent-messenger
.
If the package is installed globally, use
agent-line
directly:
bash
agent-line chat list --pretty
If the package is NOT installed, use
--package
to install and run:
bash
npx -y --package agent-messenger agent-line chat list --pretty
bunx --package agent-messenger agent-line chat list --pretty
pnpm dlx --package agent-messenger agent-line chat list --pretty
Note: If the user prefers a different package runner, use the matching command above.
NEVER run
npx agent-line
,
bunx agent-line
, or
pnpm dlx agent-line
without
--package agent-messenger
. It will fail or install a wrong package since
agent-line
is not the npm package name.
agent-line
不是npm包名称
,npm包名称为
agent-messenger
如果已全局安装该包,可直接使用
agent-line
bash
agent-line chat list --pretty
如果未安装该包,使用
--package
参数安装并运行:
bash
npx -y --package agent-messenger agent-line chat list --pretty
bunx --package agent-messenger agent-line chat list --pretty
pnpm dlx --package agent-messenger agent-line chat list --pretty
注意:如果用户偏好其他包管理器,使用上述对应命令。
**绝对不要运行
npx agent-line
bunx agent-line
pnpm dlx agent-line
**而不添加
--package agent-messenger
参数,这会导致失败或安装错误的包,因为
agent-line
不是npm包名称。

QR code expired

二维码过期

QR codes have a short TTL. If the user doesn't scan in time:
  1. Run
    agent-line auth login
    again to generate a fresh QR code
  2. Scan promptly with the LINE mobile app
二维码的有效期较短,如果用户未及时扫描:
  1. 重新运行
    agent-line auth login
    生成新二维码
  2. 立即使用LINE移动应用扫描

Token expired

令牌过期

If commands start failing with
not_authenticated
or
invalid_token
:
  1. Run
    agent-line auth login
    to re-authenticate
  2. The old token is replaced automatically
如果命令开始返回
not_authenticated
invalid_token
错误:
  1. 运行
    agent-line auth login
    重新认证
  2. 旧令牌会自动被替换

E2EE messages unreadable

E2EE消息无法读取

Some chats with Letter Sealing enabled may return empty or encrypted message content. This is a known limitation. The CLI cannot decrypt E2EE messages.
部分启用端到端加密(Letter Sealing)的聊天可能返回空或加密的消息内容,这是已知局限性,CLI无法解密E2EE消息。

References

参考文档

  • Authentication Guide
  • Common Patterns
  • 认证指南
  • 常见模式