From 24d46c367356ebf879598c8127a1fb3769e93eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=B3=E5=B3=B0=E5=A8=9F?= Date: Wed, 13 May 2026 15:00:56 +0800 Subject: [PATCH] docs(im): warn against fabricating chat URLs from chat_id Add a "Sharing Chats / Generating Chat URLs" note in lark-im SKILL.md and a Scenario 4 in chat-search reference, telling users (and agents) to always source group links from chats.link and never hand-construct applink.feishu.cn/...?chatId=oc_xxx style URLs -- those do not navigate. The chats.link host is tenant-specific, so it is not hard-coded in docs or examples. Change-Id: I3bd8883f530384b96dcdcfdb2665e84a4dbe639e --- skills/lark-im/SKILL.md | 9 +++++++++ skills/lark-im/references/lark-im-chat-search.md | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/skills/lark-im/SKILL.md b/skills/lark-im/SKILL.md index 4e9d12547..3a9110221 100644 --- a/skills/lark-im/SKILL.md +++ b/skills/lark-im/SKILL.md @@ -51,6 +51,15 @@ When using bot identity (`--as bot`) to fetch messages (e.g. `+chat-messages-lis Card messages (`interactive` type) are not yet supported for compact conversion in event subscriptions. The raw event data will be returned instead, with a hint printed to stderr. +### Sharing Chats / Generating Chat URLs + +Group share links must come from `chats.link`. **Never hand-construct `applink.feishu.cn/...?chatId=oc_xxx` style URLs from a `chat_id`** — they don't navigate. The API returns a tenant-specific join link (host varies); pass it through as-is. + +```bash +lark-cli im chats link --params '{"chat_id":"oc_xxx"}' +# default 7-day validity; pass --data '{"validity_period":"year"|"permanently"}' to extend +``` + ### Flag Types Flags support two layers: diff --git a/skills/lark-im/references/lark-im-chat-search.md b/skills/lark-im/references/lark-im-chat-search.md index 403f9da60..fce618505 100644 --- a/skills/lark-im/references/lark-im-chat-search.md +++ b/skills/lark-im/references/lark-im-chat-search.md @@ -87,6 +87,15 @@ CHAT_ID=$(lark-cli im +chat-search --query "daily report" --format json | jq -r lark-cli im +messages-send --chat-id "$CHAT_ID" --text "Today's progress update" ``` +### Scenario 4: Search a chat and get its share link + +```bash +CHAT_ID=$(lark-cli im +chat-search --query "alert group" --format json | jq -r '.data.chats[0].chat_id') +lark-cli im chats link --params "{\"chat_id\":\"$CHAT_ID\"}" +``` + +Never hand-build `applink.feishu.cn/...?chatId=oc_xxx` URLs — see [SKILL.md](../SKILL.md#sharing-chats--generating-chat-urls). + ## Common Errors and Troubleshooting | Symptom | Root Cause | Solution |