Feishu Binding

作者 starchild-ai-agentf3c2d4997f75無授權條款27 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫今天更新

Feishu/Lark binding: device flow authorization, connect, disconnect, status check. Use when setting up or managing Feishu/Lark connection (e.g. connect Feishu, connect Lark, bind 飞书, check Feishu status, disconnect Lark).

AI 產生的概覽

說明如何透過裝置流程授權來連接、檢查與中斷飛書或 Lark 帳號。

功能
此技能是一份參考文件,用於綁定使用者的飛書(Feishu)或 Lark 帳號,讓代理程式可透過該應用程式聊天。內容說明裝置流程的完整步驟:發起 connect 動作、向使用者顯示 QR code 與驗證連結、等待使用者確認,再輪詢完成狀態。內容也涵蓋狀態檢查、中斷連線、在 feishu 與 lark 之間選擇品牌、依管道顯示 QR code 或連結的方式,以及常見錯誤的疑難排解。
適用情境
適用於設定或管理飛書或 Lark 連線的情境,例如連接、綁定、檢查狀態或中斷帳號。也適用於使用者反映驗證連結有問題或授權已過期的情況。
執行需求
依賴內建的 feishu 工具來執行 connect、poll、status 與 disconnect 動作;此技能未附帶任何指令碼。需要連線至飛書或 Lark 的授權端點,QR code 圖片會儲存到工作區。由於裝置流程負責授權,因此不需要額外憑證。

📱 Feishu/Lark Binding

Connect / disconnect the user's Feishu (飞书) or Lark account so the agent can chat via the Feishu/Lark app.

The feishu tool stays built-in. This SKILL.md is the reference doc.

See also

  • config/context/references/messaging-channels.md — how messages are routed across channels
  • skills/wechat-binding/SKILL.md — analogous WeChat flow
  • skills/tg-bot-binding/SKILL.md — analogous Telegram flow

Brand selection

BrandRegionDomain
feishuChina mainland (中国大陆)feishu.cn / accounts.feishu.cn
larkInternationallarksuite.com / accounts.larksuite.com

Ask the user which brand they use. Default to feishu if unclear. Chinese-speaking users almost always use feishu.


Typical binding flow

connect(brand) → user scans QR / opens link → poll(device_code) → done
  1. Start device flow: feishu(action="connect", brand="feishu") — returns verification_uri, device_code, and a QR code image saved to workspace.
  2. Show BOTH options to the user:
    • QR code scan: Display the QR code image inline using the markdown_image from the result (e.g. ![Feishu QR Code](feishu_qrcode_xxx.png)). The user scans it with their Feishu/Lark app.
    • Direct link: Show the verification_url as a clickable link. The user opens it in their browser, logs in to Feishu/Lark, and confirms.
  3. Wait for the user to confirm. Don't auto-poll — let them say "done" / "confirmed" / "已确认" / "scanned" first.
  4. Poll for completion: feishu(action="poll", device_code=<from step 1>, brand=<same brand>).
    • status: "done" → binding complete, congratulate the user.
    • status: "pending" → ask the user if they've scanned the QR code or opened the link and confirmed.
    • status: "expired" → the device flow expired (typically 5 minutes). Start over with connect.
  5. Confirm to user: "Feishu/Lark connected! You can now chat with your agent on Feishu/Lark."

Actions

actionrequired paramspurpose
status—Current Feishu/Lark app state. Use to check if already connected.
connectbrand (optional, default "feishu")Start device flow. Returns verification URL + device_code.
polldevice_code, brandCheck if user has confirmed authorization. Returns status.
disconnect—Unbind Feishu/Lark app (destructive — confirm with user first).

Channel-aware QR / link display

User channelHow to show
WebInclude file_path (QR image) in your reply — frontend renders it inline. Also show the link.
Telegramsend_to_telegram(file_path=<qr_path>, message_type="photo") + include the link in the caption
WeChatShow the link only (user can't scan a QR inside WeChat for Feishu)
Feishu(User is already on Feishu — they don't need to bind. Tell them it's already connected or check status.)

Key differences from WeChat / Telegram

AspectFeishu/LarkWeChatTelegram
Auth methodDevice flow (URL)QR code scanBot token
User actionOpen URL + confirm in appScan QR + confirmCreate bot via @BotFather
CredentialNone (device flow handles it)bot_token (from QR)bot_token (from BotFather)
Brand choicefeishu / larkN/AN/A

Critical rules

  • Don't auto-poll after connect. Wait for user confirmation that they've opened the link and confirmed in Feishu/Lark. Auto-polling wastes API calls.
  • Device flow expires in ~5 minutes. If poll returns expired, tell the user and start a new connect.
  • disconnect is destructive — confirm with the user before calling it. It will stop the Feishu/Lark gateway instance.
  • Brand matters — feishu and lark use different API domains. Using the wrong brand will fail silently or redirect to the wrong login page.
  • One app per user — a user can only have one Feishu/Lark app at a time. If they want to switch brands, they must disconnect first, then connect with the new brand.

Troubleshooting

SymptomLikely causeFix
connect returns errorUser already has an active appCall status first; if active, ask if they want to disconnect and rebind
poll returns expiredUser took too long to confirmStart a new connect
poll returns pending repeatedlyUser hasn't opened the URL yetRemind them to open the verification URL
User says "I can't find the link"URL was in a previous messageRe-run connect to get a fresh URL

來源與署名

來源:starchild-ai-agent/official-skills位於feishu-binding提交f3c2d49

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架