Configure IM platform channels (Feishu, WeCom, Weixin) for openclacky. Uses browser automation for navigation; guides the user to paste credentials and perform UI steps. Trigger on: "channel setup", "setup feishu", "setup wecom", "setup weixin", "setup wechat", "channel config", "channel status", "channel enable", "channel disable", "channel reconfigure", "channel doctor". Subcommands: setup, status, enable <platform>, disable <platform>, reconfigure, doctor.
Configure IM platform channels for openclacky.
| User says | Subcommand |
|---|---|
channel setup, setup feishu, setup wecom, setup weixin, setup wechat | setup |
channel status | status |
channel enable feishu/wecom/weixin | enable |
channel disable feishu/wecom/weixin | disable |
channel reconfigure | reconfigure |
channel doctor | doctor |
statusCall the server API:
curl -s http://${CLACKY_SERVER_HOST}:${CLACKY_SERVER_PORT}/api/channels
Response shape (example):
{"channels":[
{"platform":"feishu","enabled":true,"running":true,"has_config":true,"app_id":"cli_xxx","domain":"https://open.feishu.cn","allowed_users":[]},
{"platform":"wecom","enabled":false,"running":false,"has_config":false,"bot_id":""},
{"platform":"weixin","enabled":true,"running":true,"has_config":true,"has_token":true,"base_url":"https://ilinkai.weixin.qq.com","allowed_users":[]}
]}
Display the result:
Channel Status
─────────────────────────────────────────────────────
Platform Enabled Running Details
feishu ✅ yes ✅ yes app_id: cli_xxx...
wecom ❌ no ❌ no (not configured)
weixin ✅ yes ✅ yes has_token: true
─────────────────────────────────────────────────────
app_id (truncated to 12 chars)bot_id if presenthas_token: true/false (token value is never displayed)If the API is unreachable or returns an empty list: "No channels configured yet. Run /channel-setup setup to get started."
setupAsk:
Which platform would you like to connect?
- Feishu
- WeCom (Enterprise WeChat)
- Weixin (Personal WeChat via iLink QR login)
Run the setup script (full path is available in the supporting files list above):
ruby "SKILL_DIR/feishu_setup.rb"
Important: call safe_shell with timeout: 180 — the script may wait up to 90s for a WebSocket connection in Phase 4.
If exit code is 0:
~/.clacky/channels.yml.If exit code is non-0:
browser-setup skill: invoke_skill("browser-setup", "setup").browser(action="navigate", url="https://open.feishu.cn/app")
<error message>. Switching to guided setup..."Only reach here if the automated script failed.
open https://open.feishu.cn/app. Pass isolated: true.app_id and app_secret.{
"scopes": {
"tenant": [
"im:message",
"im:message.p2p_msg:readonly",
"im:message:send_as_bot"
],
"user": []
}
}
CRITICAL: Feishu requires the long connection to be established before you can save the event config. The platform shows "No application connection detected" until clacky server is running and connected.
curl -X POST http://${CLACKY_SERVER_HOST}:${CLACKY_SERVER_PORT}/api/channels/feishu \
-H "Content-Type: application/json" \
-d '{"app_id":"<APP_ID>","app_secret":"<APP_SECRET>","domain":"https://open.feishu.cn"}'
CRITICAL: This curl call is the ONLY way to save credentials. NEVER write ~/.clacky/channels.yml or any file under ~/.clacky/channels/ directly. The server API handles persistence and hot-reload.[feishu-ws] WebSocket connected ✅:
for i in $(seq 1 20); do
grep -q "\[feishu-ws\] WebSocket connected" ~/.clacky/logger/clacky-$(date +%Y-%m-%d).log 2>/dev/null && echo "CONNECTED" && break
sleep 1
done
im.message.receive_v1, select it, click Add. Reply done." Wait for "done".curl -s -X POST "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal" \
-H "Content-Type: application/json" \
-d '{"app_id":"<APP_ID>","app_secret":"<APP_SECRET>"}'
Check for "code":0. On success: "✅ Feishu channel configured."
open https://work.weixin.qq.com/wework_admin/frame#/aiHelper/create. Pass isolated: true.aib) and secret are not swapped. Run:
curl -X POST http://${CLACKY_SERVER_HOST}:${CLACKY_SERVER_PORT}/api/channels/wecom \
-H "Content-Type: application/json" \
-d '{"bot_id":"<BOT_ID>","secret":"<SECRET>"}'
On success: "✅ WeCom channel configured. WeCom client → Contacts → Smart Bot to find it."
Weixin uses a QR code login — no app_id/app_secret needed. The token from the QR scan is saved directly in channels.yml.
Run the script in --fetch-qr mode to get the QR URL without blocking:
QR_JSON=$(ruby "SKILL_DIR/weixin_setup.rb" --fetch-qr 2>/dev/null)
echo "$QR_JSON"
Parse the JSON output:
qrcode_url — the URL to open in browser (this IS the QR code content)qrcode_id — the session ID needed for pollingIf the output contains "error", show it and stop.
Build the local QR page URL (include current Unix timestamp as since to detect new logins only):
Control Philips Hue lights and scenes via the OpenHue CLI.