line
Skill4 starsChanged 4 months agoMITView on GitHub
Operate the linebot-turso-relay LINE bot from the CLI — resolve a person's display name to their LINE userId from the Turso archive, then send (push) a message to them, plus the supporting Messaging API operations (profile lookup, binary content download, reply context). Use when the user wants to "send/push a LINE message", "message <name> on LINE", "tell <someone> via the bot", "推訊息給某人", "用 lizard 發 LINE", "查某人的 LINE userId", or otherwise act *outbound* through the bot. For read-only querying of the archive (search/list/count forwarded messages) use the line-inbox skill instead.
- Reads credentials
2 other projects use a version of this.
Adopted by
Most recently taken up by
- gao-xh/multi-agent-protocoltheir own version, first seen Oct 25, 2026
- kaosensei/line-desktop-skilltheir own version, first seen Mar 18, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- kaosensei/line-desktop-skill★ 36same name
- gao-xh/multi-agent-protocol★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repositoryOne other file it gives its agents.
- line-inboxSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
All operations authenticate with LINE_CHANNEL_ACCESS_TOKEN (bearer).
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
LINE bot operations
Outbound + API operations for linebot-turso-relay. The bot captures forwarded messages into a Turso DB (read side = the line-inbox skill); this skill covers acting back out through LINE's Messaging API.
Credentials
All operations authenticate with LINE_CHANNEL_ACCESS_TOKEN (bearer). It lives in the project .env alongside the Turso pair:
LINE_CHANNEL_SECRET=… # HMAC for inbound webhook verification only
LINE_CHANNEL_ACCESS_TOKEN=… # bearer for every api.line.me call below
TURSO_DATABASE_URL=… # used by line-inbox for name→userId lookup
TURSO_AUTH_TOKEN=…Resolve the repo root from this skill's base directory:
SKILL="<Base directory for this skill, as reported by the Skill tool>"
REPO="$SKILL/../../.." # .claude/skills/line → repo root holding .envNever put the token on the command line — read it from .env inside the script so it never appears in argv/process listing/shell history.
Operation 1 — resolve a display name → userId
You can only push to a U… userId, and display names are neither unique nor stable. Resolve via the archive (uses the line-inbox script's DB access):
python3 "$REPO/.claude/skills/line-inbox/scripts/inbox.py" --json sql \
"SELECT source_user_id, user_display_name, COUNT(*) AS n,
MAX(datetime(line_timestamp_ms/1000,'unixepoch','+8 hours')) AS last_seen
FROM messages WHERE user_display_name='<display-name>'
GROUP BY source_user_id ORDER BY n DESC"Ambiguity rule — the one safety gate: wrong-person is the only bad failure.
- Exactly one
source_user_idrow → safe to send. - Zero or two-plus rows → STOP. Print the candidates (userId +
last_seen) and have the user pick; send only with an explicit userId. Never auto-pick.
Targeting a group or room
to also accepts a C… group id or R… room id (the bot must be a member — it is, if the chat appears in the archive). Groups/rooms carry no display name (user_display_name is the speaker, not the chat), so identify them by recent activity/content:
# groups the bot has seen, most recently active first
python3 "$REPO/.claude/skills/line-inbox/scripts/inbox.py" --json sql \
"SELECT source_group_id, COUNT(*) AS n,
MAX(datetime(line_timestamp_ms/1000,'unixepoch','+8 hours')) AS last_seen
FROM messages WHERE source_group_id IS NOT NULL
GROUP BY source_group_id ORDER BY last_seen DESC"
# which group/room a known message belongs to (find a message via line-inbox search first)
python3 "$REPO/.claude/skills/line-inbox/scripts/inbox.py" --json sql \
"SELECT source_group_id, source_room_id FROM messages WHERE id=470"Operation 2 — send (push) a message
Proven recipe (this is the exact call validated end-to-end; POST /v2/bot/message/push):
LIZARD_ENV="$REPO/.env" python3 - <<'PY'
import os, json, pathlib, urllib.request, urllib.error
env = {}
for line in pathlib.Path(os.environ["LIZARD_ENV"]).read_text().splitlines():
line = line.strip()
if line and not line.startswith("#") and "=" in line:
k, v = line.split("=", 1); env[k.strip()] = v.strip()
token = env["LINE_CHANNEL_ACCESS_TOKEN"]
to_id = "U…" # userId (Operation 1), or a C… group / R… room id
text = "your message" # text only; ≤5000 chars
req = urllib.request.Request(
"https://api.line.me/v2/bot/message/push",
data=json.dumps({"to": to_id, "messages": [{"type": "text", "text": text}]}).encode(),
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
method="POST",
)
try:
with urllib.request.urlopen(req) as r:
print("HTTP", r.status, "| request-id", r.headers.get("x-line-request-id"))
print(r.read().decode() or "(empty body = success)")
except urllib.error.HTTPError as e:
print("HTTP", e.code); print(e.read().decode())
PY200 with a sentMessages array = delivered. The to field also accepts a source_group_id / source_room_id to push into a group/room.
Operation 3 — other Messaging API calls
Same bearer token; all against api.line.me (content uses api-data.line.me):
| Need | Call |
| Display name for a userId | GET /v2/bot/profile/{userId} → { "displayName": … } |
| Download an attachment's bytes | GET https://api-data.line.me/v2/bot/message/{messageId}/content (LINE keeps it ~7 days; older archived bytes are in R2 — see line-inbox attachments) |
| Reply to an inbound event | POST /v2/bot/message/reply with { replyToken, messages } — the Worker already does this; reply tokens are single-use and short-lived |
Constraints & gotchas
- Reachability: push only reaches a userId who has added the bot as a friend and hasn't blocked it. You can only target IDs the bot has actually seen (they're in the DB).
- Group push is public to the whole group — everyone in it sees the message. Confirm the
C…id maps to the chat you mean (via the activity/content query above) before sending; there's no recall. - Forwards lose the original sender:
source_user_idon a forwarded message is always you, the forwarder — never the original author. So name-resolution targets are people who DM'd the bot or spoke in a tracked group, not arbitrary contacts. - Push is metered: replies are free/unlimited, push counts against LINE's monthly free-tier quota. Fine for personal volume; don't loop-blast.
- Idempotency is inbound-only: the dedup (
ON CONFLICT(webhook_event_id)) protects ingest, not sends — a re-run of the push recipe sends again.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

