feishu-remote
GitHub飞书远程控制插件,通过WebSocket长连接将飞书机器人接入本地CLI,支持远程操控、会话管理及安全加固。用于配置环境、管理守护进程及发送测试通知。
Trigger Scenarios
Install
npx skills add handais/antigravity-feishu-remote --skill feishu-remote -g -y
SKILL.md
Frontmatter
{
"name": "feishu-remote",
"description": "Configure, run, manage, troubleshoot, and package the Feishu Remote Control bridge, MCP server, and completion hook for Antigravity. Use when the user asks to set up Feishu bot remote control, check\/restart the bridge daemon, send Feishu test notifications, or package the plugin to share with friends."
}
Feishu Remote Control Guide
This plugin connects Feishu (WebSocket long connection, no public IP or webhook required) to the local agy CLI so users can steer Antigravity from Android/iOS Feishu.
All user secrets and runtime state live strictly outside the plugin folder at ~/.config/antigravity-feishu/ (0600 permissions), keeping the plugin folder clean and safe to share.
1. First-Time Dependency Check
Before running any script, make sure Node.js dependencies are installed inside the active plugin root (default ~/.gemini/config/plugins/feishu-remote/, or the directory where agy plugin install placed the plugin):
cd ~/.gemini/config/plugins/feishu-remote
[ -d node_modules/@larksuiteoapi/node-sdk ] || npm install --omit=dev
2. Feishu Open Platform Checklist (Share with User When Needed)
- Open Feishu Open Platform and select/create an Enterprise Self-built App (企业自建应用).
- Under 应用能力 → 机器人 (Bot), enable Bot capability.
- Under 权限管理 (Permissions), enable:
- Core:
im:message,im:message:send_as_bot,im:message.p2p_msg:readonly,im:resource(required for inbound/outbound images & files), and optionallyim:message.group_at_msg:readonly. - Enhanced UX & Cloud Docs (recommended):
cardkit:card:write,cardkit:card:read,im:message.reactions:write_only,im:message:readonly,docx:document:readonly,docx:document:write_only,docx:document.block:convert,wiki:node:read. - Feishu Task Center v2 (optional, requires user OAuth via
cli.mjs authand redirect URIhttp://127.0.0.1:18923/callback):offline_access,task:task:read,task:task:write,task:tasklist:read.
- Core:
- Under 事件与回调 (Events & Callbacks):
- 事件配置: Choose 使用长连接接收事件 (WebSocket Long Connection) and subscribe to
im.message.receive_v1andapplication.bot.menu_v6(for Bot Custom Menu click events). - 回调配置: Choose 使用长连接接收回调 and subscribe to
card.action.trigger(for interactive Control Panel, Directory Browser (/dirs), Commands & Skills (///skills), Git (/git), Scopes (/scopes), Queue (/queue), Retry, Session, Model, and Abort buttons).
- 事件配置: Choose 使用长连接接收事件 (WebSocket Long Connection) and subscribe to
- Under 应用能力 → 机器人 → 机器人自定义菜单 (Optional, Recommended):
- Enable 机器人自定义菜单 (prefer 悬浮菜单) with shortcut buttons pushing event keys
menu_panel,menu_commands,menu_new,menu_stop(also supportsmenu_skills,menu_dirs,menu_effort,menu_git,menu_scopes,menu_queue,menu_mode_temp_full,menu_ops,menu_reload,menu_sessions,menu_models,menu_mode_full,menu_goal,menu_swarm,menu_schedule,menu_plan,menu_help) or sending/panel,/,/new,/stop.
- Enable 机器人自定义菜单 (prefer 悬浮菜单) with shortcut buttons pushing event keys
- Under 版本管理与发布, create and publish a version (or enable in test/dev scope).
3. Setup & Manage Daemon (scripts/cli.mjs)
Run commands with node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs:
- Configure credentials & defaults:
Optional flags:printf '%s' "<APP_SECRET>" | node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs setup \ --app-id "<APP_ID>" \ --app-secret-stdin \ --allow-open-id "<YOUR_OPEN_ID>" \ --cwd "$HOME" \ --mode accept-edits--app-secret-stdin/FEISHU_APP_SECRETenv var (recommended instead of passing--app-secretvia shell argv)--domain feishu|lark(defaultfeishu)--model <model-id>--effort <low|medium|high|xhigh|max|default>(defaultdefault)--timeout <seconds>(default3600;0for unlimited)--max-concurrent <1..10>(default4; max simultaneous activeagyruns across chats/topic threads)--proxy <http://127.0.0.1:7897>(proxy for spawnedagysubprocesses; auto-detected if omitted)--feishu-proxy <url>(usually leave empty so Feishu connects directly)--allow-open-id <ou_xxx>(repeatable;autoBindFirstUserdefaults tofalsefor fail-closed security — pass--auto-bind trueexplicitly if first-P2P auto-bind is desired)--auto-bind true|false(defaultfalse)--group-policy mention|off|all(defaultmention)--stop-hook true|false(defaulttrue; desktop completion cards include a📱 接管此对话handoff button)--notify-mode on|away|off&--away-seconds <10..3600>(defaulton,120s;awaysuppresses desktop completion notifications while active at the keyboard)- Note: in
accept-editsmode, remote tasks can read/edit files but shell/MCP calls may be denied; tap⚡ 30m全权(or send/mode full 30m, auto-reverts after expiry) or⚡ 常驻全权in the Control Panel when remote shell/MCP execution is needed.
- Start / Stop / Restart background daemon (
launchdon macOS,systemd --useron Linux):node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs start node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs status node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs logs --lines 50 node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs check node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs safe-restart node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs backups node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs rollback node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs scopes node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs auth node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs tasks --filter open node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs read-doc "<URL_OR_TOKEN>" node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs write-doc --title "Report" --file ./report.md node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs desktop --limit 5 node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs handoff --copy cli node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs restart node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs stopcheck: runs two-stage preflight (node --check+ isolated ESM import/export check).safe-restart: runscheckfirst and aborts without restarting if any error is found.backups/snapshot/rollback: manages deduplicated known-good code snapshots under~/.config/antigravity-feishu/backups/(max 5). In Feishu, users can also tap♻️ 安全重启or⏪ 快照回滚(or send/ops,/reload,/check,/snapshot,/rollback).scopes/read-doc/write-doc: inspect Feishu Open Platform scopes and read/write Feishu Docx/Wiki documents from CLI (MCP toolsfeishu_read_docandfeishu_write_docare also exposed viamcp-server.mjs).desktop: read-only scan/FTS5 search of local CLI & Desktop App conversations (--query,--filter,--limit).node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs send-file <path> [--as-file]: upload and send a local image or file back to Feishu (requiresim:resourcescope).- Inside Feishu chat: supports CardKit 2.0 typewriter streaming (auto-fallback to
patchCard), message completion reaction (DONE), per-chat FIFO task queuing (/queue), quoted message context fetching, auto-reading sharedfeishu.cn/docx/...&/wiki/...URLs,/doc,/git,/scopes,/effort,/timeout,/sessions+/desktop(/pc) dual-option takeover (🧵 新开话题接管via/topicvs current-chat takeover, plus/unlinkto stop auto-routing),/handoff(/back) mobile-to-desktop return handoff (clipboard +feishu_list_mobile_sessions/feishu_read_mobile_sessionMCP sync + origin drift detection),/guard(PreToolUserisky shell command Feishu card approval), turn diff/modified-file buttons, temporary full mode (/mode full 30m), desktop Stop-card reply preview + smart topic-thread return routing, retry buttons on failed/aborted cards, inbound/outbound media (/send), fuzzy/cd <keyword>, and///skills(menu_commands) +/agy <raw>passthrough.
- Send a test card (after first user has bound or
--receive-idis given):node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs test-send node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs test-send --panel node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs test-send --dirs
4. Packaging & Sharing with Friends
Generate a clean .zip containing zero node_modules and zero personal credentials/state:
node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs pack --out ~/Desktop/feishu-remote-plugin.zip
Friend installation steps:
- Unzip into
~/.gemini/config/plugins/feishu-remote/ - Run
cd ~/.gemini/config/plugins/feishu-remote && npm install --omit=dev - Run
node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs setup --app-id ... --app-secret ... - Run
node ~/.gemini/config/plugins/feishu-remote/scripts/cli.mjs start - Message their Feishu bot once in private chat to auto-bind their
open_id.
GitHub Release notes convention:
- Always put the AI-first install/upgrade workflow at the top of the Install & Upgrade section (tell users to send
https://github.com/handais/antigravity-feishu-remotedirectly to Antigravity so the AI installs/upgrades automatically without manual zip extraction), followed bygit pull && npm install --omit=devfor existing clones, and manual zip extraction (~/.gemini/config/plugins/, avoiding double-nestedfeishu-remote/feishu-remote/) as the offline/no-Git fallback.
5. Troubleshooting Quick Notes
- Proxy isolation: Feishu WS/REST calls strip
http_proxy/https_proxy/all_proxyby default so localsocks5://proxies do not break Feishu WebSocket connections, while spawnedagysubprocesses receiveconfig.agy.proxy. - Stop hook noise:
stop-notify.mjsautomatically skips child sessions spawned by the bridge (FEISHU_REMOTE_BRIDGE_CHILD=1) to prevent loops.
Version History
-
5832a8d
Current 2026-11-28 19:24
新增命令仪表盘与持久化工作流会话,增强安全性(如自动绑定首用户、敏感文件保护),优化SQLite查询并修复Windows CLI边缘情况。
-
53f3e91
2026-11-28 01:06
无内容变更
- 09d6450 2026-11-27 19:01


