Discover curated AI tools, apps, extensions, and AI news. Updated regularly.
line-oa
Operate LINE Official Account Manager (chat.line.biz) via browser automation. Use when asked to check LINE messages, reply to LINE customers, or manage LINE OA chat interface.
---
name: line-oa
description: Operate LINE Official Account Manager (chat.line.biz) via browser automation. Use when asked to check LINE messages, reply to LINE customers, or manage LINE OA chat interface.
---
# LINE Official Account Manager
⚠️ **CRITICAL**: Always use `profile:"openclaw"` (isolated browser) for all browser actions. Never use Chrome relay. Keep the same `targetId` across operations to avoid losing the tab.
⚠️ **CONTEXT Management**:
- Snapshot results are large. Do NOT repeat them in thinking.
- Extract needed info and process immediately. Do not re-describe the entire snapshot.
- **Preferred approach**: Use `snapshot refs:"aria" compact:true` to find element refs, then `act` + `click`/`type` with ref.
- **Avoid**: Hard-coded `evaluate` with `textContent.includes()` — unreliable due to DOM timing and structure variations.
⚠️ **AUTO-LOGIN SCRIPTS**:
- `auto-login.mjs` is a **reference implementation** (not directly executable by agents)
- `login-flow.md` is the **agent-executable version** (use this for automation)
- **Why separate?** Agents use browser tool calls, not Node module imports
## Configuration
Before first use, check if `config.json` exists:
```
read file_path:"skills/line-oa/config.json"
```
⚠️ **PATH RULE**: Always use workspace-relative paths starting from `skills/line-oa/`. Never use `../` or absolute paths starting with `/`.
If missing, help the user run the following command to start the setup wizard:
```bash
cd skills/line-oa
node scripts/setup.js
```
# Enter LINE OA Manager
This is the first step for all operations below.
1. **Check and start browser service:**
```
browser action:"status"
```
If `"running": false`, start the browser service:
```
browser action:"start" profile:"openclaw"
```
Wait 2-3 seconds for the service to initialize.
2. **Read config to get chatUrl:**
```
read file_path:"skills/line-oa/config.json"
```
Extract `chatUrl` from the JSON (e.g., `https://chat.line.biz/U1234567890abcdef1234567890abcdef/`).
2. **Open browser:**
```
browser action:"open" profile:"openclaw" targetUrl:""
```
Capture `targetId` and `url` from response.
3. **Wait for page load:**
```
browser action:"act" profile:"openclaw" targetId:"" request:{"kind":"wait","timeMs":2000}
```
4. **Check current URL:**
```
browser action:"act" profile:"openclaw" targetId:"" request:{"kind":"evaluate","fn":"function(){return window.location.href;}"}
```
Key result: If the current URL matches `chatUrl`, you have successfully logged in! Go to step 5, else proceed to troubleshooting.
### Troubleshooting
If you see the login page (the URL redirects to `account.line.biz`), use these automation scripts:
a. **Click LINE Account button:**
```
read file_path:"skills/line-oa/scripts/click-line-account.js"
```
Execute the script directly:
```
browser action:"act" profile:"openclaw" targetId:"" request:{"kind":"evaluate","fn":""}
```
Wait 2 seconds.
b. **Click Login button:**
```
read file_path:"skills/line-oa/scripts/click-login.js"
```
Execute the script directly:
```
browser action:"act" profile:"openclaw" targetId:"" request:{"kind":"evaluate","fn":""}
```
Wait 3 seconds.
c. **Reload chatUrl:**
```
browser action:"navigate" profile:"openclaw" targetId:"" targetUrl:""
```
Wait 2 seconds, then take snapshot to verify left-side chat list is visible.
### After Check
5. **Proceed with the user's other requests.**
6. **Clean Up Browser Tabs**:
a. Open a blank tab:
```
browser action:"open" profile:"openclaw" targetUrl:"about:blank"
```
b. Get all tabs:
```
browser action:"tabs" profile:"openclaw"
```
c. Close all tabs except the newest one (about:blank):
```
browser action:"close" profile:"openclaw" targetId:""
```
**Important**: Always clean up tabs after all operations to prevent resource accumulation. The blank tab keeps the browser service running for faster next use.
## Quick Check (for cron / automated checks)
Complete flow: login → list chats → report. Follow these steps exactly.
1. Read config: `read file_path:"skills/line-oa/config.json"` → get `chatUrl`
2. Open browser: `browser action:"open" profile:"openclaw" targetUrl:` → get `targetId`
3. Wait: `browser action:"act" profile:"openclaw" targetId: request:{"kind":"wait","timeMs":3000}`
4. Check URL: `browser action:"act" profile:"openclaw" targetId: request:{"kind":"evaluate","fn":"function(){return window.location.href;}"}`
- If URL contains `account.line.biz` → go to **Troubleshooting** section below to login, then come back
- If URL contains `chat.line.biz` → continue
5. Run this one-liner script **as-is, do not modify**:
```
browser action:"act" profile:"openclaw" targetId: request:{"kind":"evaluate","fn":"(function(){var r=document.querySelectorAll('.list-group-item-chat');return Array.from(r).map(function(e){var h=e.querySelector('h6');var p=e.querySelector('.text-muted.small');var pt=p?p.textContent.trim():'';var ms=e.querySelectorAll('.text-muted');var t='';for(var i=0;i (
# LINE Official Account Manager
Operate LINE Official Account Manager (chat.line.biz) via browser automation.
## Features
- ✅ Check unread messages across all chats
- ✅ Reply to customer messages
- ✅ Manage tags and notes for each chat
- ✅ Switch between multiple official accounts
## Installation
### 1. Install the skill
If using ClawHub:
```bash
clawhub install line-oa
```
Or clone manually:
```bash
git clone ~/.openclaw/workspace/skills/line-oa
```
### 2. Run setup
```bash
cd ~/.openclaw/workspace/skills/line-oa
node scripts/setup.js
```
The setup wizard will:
1. Open https://chat.line.biz/ in your browser
2. Guide you to log in and select your official account
3. Ask you to copy and paste the chat URL
4. Save the configuration to `config.json`
### 3. Start using
Tell your OpenClaw agent:
- "Check LINE for unread messages"
- "Check LINE messages"
- "Reply to [customer name] on LINE"
- "Switch to [LINE Official Account name]"
## Manual Configuration
If you prefer to configure manually, create `config.json`:
```json
{
"chatUrl": "https://chat.line.biz/U1234567890abcdef1234567890abcdef"
}
```
To find your chat URL:
1. Visit https://manager.line.biz
2. Go to Chat section
3. Copy the full URL from the browser address bar
## Reconfiguration
To change your LINE OA account:
```bash
node scripts/setup.js
```
The wizard will detect existing config and ask if you want to overwrite.
## Troubleshooting
**"config.json not found"**
- Run `node scripts/setup.js` in the skill directory
**"Session expired" or login required**
- LINE OA sessions expire after a few hours
- The skill will automatically guide you through re-login
**Browser control issues**
- Make sure OpenClaw browser service is running
- The skill uses `profile:"openclaw"` (isolated browser)
- Never use Chrome relay for LINE OA
## Notes
- This skill uses browser automation (no official LINE API)
- Sessions may expire; re-login required periodically
- Multi-account switching is supported
- All operations are performed through the OpenClaw isolated browser
## License
MIT