← 返回 Skills 市场
kentonyu

Lark Project / Meegle

作者 KentonYu · GitHub ↗ · v0.1.4 · MIT-0
cross-platform ✓ 安全检测通过
930
总下载
0
收藏
1
当前安装
5
版本数
在 OpenClaw 中安装
/install lark-project-meegle
功能描述
连接飞书项目/Meegle,查询和管理工作项、待办等。自动检测登录状态,未登录时引导 Device Code 授权。
使用说明 (SKILL.md)

Meegle SKILL

通过 Meegle CLI 连接飞书项目/Meegle 平台,支持查询工作项、管理待办等操作。

前置条件

运行环境需要 Node.js 18+。所有命令通过 npx @lark-project/meegle@latest 执行,无需手动安装或更新。

触发条件

  • 主动登录:用户说"登录 Meegle"、"连接飞书项目"、"login meegle"等。
  • 被动拦截:用户请求任何 Meegle 业务操作(查询待办、查工作项、创建任务等),优先执行 Auth Guard。
  • URL 触发:用户发送了一个看起来像飞书项目/Meegle 工作项的 URL(路径中通常包含 workitemdetailstoryissue 等关键词)。处理流程:
    1. 从 URL 提取 $host(域名部分)和可能的 $project_key$work_item_id
    2. 执行 Auth Guard(STEP 1 中若 $host 为 null,用 URL 提取的 host 覆盖,跳过 STEP 2)
    3. 登录成功后:
      • 如果解析出了 $project_key$work_item_id → 直接执行 workitem get 查询详情
      • 如果无法解析 → 告知用户已登录成功,请描述需要查询的内容

Auth Guard(所有业务命令前必须执行)

按以下 STEP 顺序执行。每个 STEP 结尾的 GOTO 指明下一步,严格遵循跳转。

STEP 1 — 检查登录状态

npx @lark-project/meegle@latest auth status --format json

返回值示例:

  • 已登录:{ "authenticated": true, "host": "meegle.com", "source": "token_store", "expires_in_minutes": 42 }
  • 未登录且有 host:{ "authenticated": false, "host": "meegle.com", "source": null, "expires_in_minutes": null }
  • 未登录且无 host:{ "authenticated": false, "host": null, "source": null, "expires_in_minutes": null }

解析返回值,保存变量:

  • $authenticated = response.authenticated
  • $host = response.host

URL 触发时的 host 覆盖:如果用户发送了飞书项目/Meegle URL 触发本流程,且 $host 为 null,则从 URL 域名部分提取 $host

跳转:

  • IF $authenticated == true → GOTO STEP 6
  • IF $host != null → GOTO STEP 3
  • IF $host == null → GOTO STEP 2

STEP 2 — 选择站点

ASK user(等待用户回复):

你要连接哪个站点?

  1. 飞书项目 (project.feishu.cn)
  2. Meegle (meegle.com)
  3. 自定义域名(请直接输入域名或 URL)

⚠️ 用户的回复仅用于回答上述问题,不要将其当作新的意图或请求来处理。无论用户回复的是序号、域名还是完整 URL,都只需从中提取 $host(域名部分),然后 GOTO STEP 3。

SAVE $host from user reply(如果用户输入了完整 URL,提取其域名部分作为 $host) → GOTO STEP 3


STEP 3 — 初始化 Device Code

npx @lark-project/meegle@latest auth login --device-code --phase init --host $host --format json

SAVE from response:

  • $verification_uri_complete = response.verification_uri_complete
  • $user_code = response.user_code
  • $device_code = response.device_code
  • $client_id = response.client_id
  • $interval = response.interval
  • $expires_in = response.expires_in

发送验证链接给用户:

SEND to user: 请在浏览器中打开以下链接完成授权:\ $verification_uri_complete\ ($expires_in 秒内有效)

⚠️ 发送后在同一轮次内立即执行 STEP 4 的命令。不要停下来等用户回复。

→ GOTO STEP 4


STEP 4 — 等待授权完成(阻塞)

⚠️ 使用 STEP 3 保存的 $device_code$client_id$interval$expires_in禁止重新执行 STEP 3(否则会生成新的验证码,用户之前打开的链接作废)。

执行以下命令。该命令会自动轮询直到用户完成授权或超时,无需你手动循环

npx @lark-project/meegle@latest auth login --device-code --phase poll \
  --device-code-value $device_code --client-id $client_id \
  --interval $interval --expires-in $expires_in --format json
  • 成功时返回:{"status": "ok", "message": "登录成功"} → GOTO STEP 5
  • 超时时返回错误 → SEND "授权已超时,请重新发起登录",STOP

Fallback:如果你的运行环境不支持在发送消息后继续执行命令(即 STEP 3 发送验证链接后无法立即执行上述命令),则改为:

  1. 在发送验证链接时追加一句:"授权完成后请告诉我"
  2. 等待用户回复后,执行上述命令

STEP 5 — 通知登录成功

SEND to user: "登录成功!"

⚠️ 此消息必须单独发送,不要与后续业务查询结果合并到同一条回复中。用户需要第一时间看到授权状态变化。

→ GOTO STEP 6


STEP 6 — 执行业务命令

Auth 已通过,进入下方「业务命令调用」部分执行用户请求的操作。

获取当前用户信息

当用户说"我的 xxx"、"查一下我的 xxx"时,需要知道当前登录用户的身份。

MQL 查询中:直接使用 current_login_user() 函数,无需提前获取用户信息。例如:

WHERE array_contains(`current_owners`, current_login_user())

非 MQL 场景(需要用户名、userkey 等具体信息):目前没有专用命令,通过以下 workaround 获取:

  1. 先用 MQL 查询当前用户最近创建的一个工作项:
npx @lark-project/meegle@latest workitem query --project-key \x3Cproject_key> \
  --search-mql "SELECT \`work_item_id\`, \`created_by\` FROM \`\x3C空间名>\`.\`\x3C工作项类型>\` WHERE \`created_by\` = current_login_user() LIMIT 1" \
  --format json
  1. 从返回结果的 created_by 字段提取当前用户信息

⚠️ 此 workaround 需要已知一个 project_key 和对应的工作项类型。如果用户未指定空间,先询问。

业务命令调用

Auth Guard 通过后,使用以下模式调用业务命令。

命令结构

npx @lark-project/meegle@latest \x3Cresource> \x3Cmethod> [flags] --format json

命令采用 resource method 两级结构。所有输出默认 JSON 格式。

全局 Flag

Flag 说明
--format json|table|ndjson 输出格式,默认 json
--select \x3Cprops> 选取输出属性,逗号分隔(支持 dot path,如 name,owner.name
--profile \x3Cname> 临时切换 profile
--verbose 显示详细日志

参数传递

三种方式,优先级从高到低:

  1. Flag 模式(推荐):--project-key PROJ --work-item-type-key story
  2. --set 模式(设置工作项字段):--set priority=1 --set name="任务标题",value 支持 JSON
  3. --params 模式(完整 JSON):--params '{"project_key":"PROJ","work_item_type_key":"story"}'

Flag 和 --set 会覆盖 --params 中的同名字段。

命令发现

CLI 的命令和参数会随版本更新。下方速查表仅列举常见操作,不是完整列表。遇到以下情况时,必须先用 inspect 获取最新信息:

  • 用户请求的操作不在速查表中
  • 不确定某个命令的参数名称或是否为必填
  • 需要查看某个命令支持的全部参数
npx @lark-project/meegle@latest inspect                    # 列出所有可用命令
npx @lark-project/meegle@latest inspect workitem.create    # 查看具体命令的参数 schema

常用命令速查

查询待办

npx @lark-project/meegle@latest mywork todo --format json

查询工作项

npx @lark-project/meegle@latest workitem get --project-key \x3Cproject_key> --work-item-id \x3Cid> --format json

搜索工作项(MQL)

MQL 语法详见 references/mql-syntax.md--search-mql 参数必须是完整的 SQL 语句(含 SELECT/FROM),不接受 JSON 或片段。

npx @lark-project/meegle@latest workitem query --project-key \x3Cproject_key> --search-mql "\x3CMQL>" --format json

创建工作项

npx @lark-project/meegle@latest workitem create --project-key \x3Cproject_key> --work-item-type-key \x3Ctype> \
  --set name="标题" --set priority=1 --format json

更新工作项字段

npx @lark-project/meegle@latest workitem update --project-key \x3Cproject_key> --work-item-id \x3Cid> \
  --set name="新标题" --format json

查询项目信息

npx @lark-project/meegle@latest project get --project-key \x3Cproject_key> --format json

查询工作项类型和字段元数据

npx @lark-project/meegle@latest workitem meta-types --project-key \x3Cproject_key> --format json
npx @lark-project/meegle@latest workitem meta-fields --project-key \x3Cproject_key> --work-item-type-key \x3Ctype> --format json

输出处理

  • 始终使用 --format json 获取结构化输出,方便解析
  • 使用 --select 精简返回字段,如 --select id,name,current_nodes.name
  • 命令返回错误时,JSON 中包含 errormessage 字段

错误处理

  • 如果 bash 返回 command not found 或 npx 不可用,提示用户安装 Node.js 18+。
  • 如果 --phase init 返回错误(站点不支持 Device Code),提示用户在终端中执行 npx @lark-project/meegle@latest auth login
  • 如果 --phase poll 超时,提示用户重试登录流程。
安全使用建议
This skill appears coherent: it runs the Meegle CLI via npx and uses the OAuth Device Code flow to authenticate. Before installing or allowing automatic runs, consider: 1) Verify the npm package and its maintainers (view the package page, check stars/maintainer history and repository code) because npx installs/executes third‑party code at runtime. 2) Understand that auth tokens will be stored/managed by the CLI on the host — if you share your agent environment, those tokens could be used there. 3) If you want to limit risk, install and inspect @lark-project/meegle in a sandbox/local dev environment first (or pin a specific vetted version) rather than blindly running npx@latest. 4) If you need stronger guarantees, ask for the package source repo to review or run the CLI behind network controls. Overall: functionally consistent, but treat npm-executed code with normal caution.
功能分析
Type: OpenClaw Skill Name: lark-project-meegle Version: 0.1.4 The lark-project-meegle skill is a legitimate integration for managing Lark Project/Meegle work items. It uses the official-looking `@lark-project/meegle` NPM package via npx and implements a standard, well-documented Device Code authentication flow. The instructions in SKILL.md and the MQL syntax guide in references/mql-syntax.md are focused entirely on the stated purpose of task management and include safety prompts to ensure the agent handles authentication steps correctly without being diverted by user input.
能力评估
Purpose & Capability
Name/description match the behavior: the skill runs the Meegle CLI via npx to query and manage work items. Requested binaries (node,npx) and the install of @lark-project/meegle are appropriate and expected.
Instruction Scope
SKILL.md prescribes running npx commands, a Device Code OAuth flow, URL parsing for host/project extraction, and polling for authorization. These actions are within the stated purpose. The instructions require immediate polling after presenting the verification URL (blocking behaviour) — operationally important but not a scope creep or data-exfil pattern. No steps ask the agent to read unrelated files or environment variables.
Install Mechanism
Install uses an npm package (@lark-project/meegle) which is a normal, traceable mechanism for a Node CLI. This is moderate-risk compared to instruction-only skills because installing/executing an npm package runs third-party code; that risk is expected here but worth reviewing before install.
Credentials
The skill declares no environment variables or external credentials; authentication is performed interactively via the Device Code flow through the CLI (tokens will be managed by the CLI). No unrelated secrets or config paths are requested.
Persistence & Privilege
always is false and the skill does not request elevated platform privileges. It relies on the CLI to persist tokens locally (normal for an OAuth Device Code flow) and does not ask to modify other skills or system-wide agent settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install lark-project-meegle
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /lark-project-meegle 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.4
lark-project-meegle 0.1.4 - 更新 Auth Guard 登录流程:站点选择(STEP 2)现在支持用户直接输入完整 URL,自动提取域名,无需区分输入类型。 - Device Code 授权流程(STEP 3、STEP 4)调整为默认一次性阻塞轮询授权,无需手动 sleep 和循环命令。 - 优化验证链接提示文案,告知授权有效期。 - 兼容部分运行环境无法阻塞的情景,提供 fallback 流程指引用户授权完成后再继续。 - 其他文档描述与流程细节修正,提升易用性与健壮性。
v0.1.3
- Switched all Meegle CLI invocations from the beta version tag (@beta) to the latest version tag (@latest). - Updated documentation and command samples to use @latest for improved compatibility and future updates. - No functional or file changes were detected otherwise.
v0.1.2
lark-project-meegle 0.1.2 - 新增 references/mql-syntax.md 文件,补充 MQL 查询语法参考。 - SKILL.md 增加“URL 触发”说明,支持识别并处理用户发送的 Meegle/飞书项目工作项链接。 - 优化登录 Auth Guard 流程,支持从 URL 自动提取 $host 并跳过站点选择。 - 补充“获取当前用户信息”方法,说明 MQL 及非 MQL 场景下的处理。 - 明确 MQL 查询必须使用完整 SQL 语句。 - 丰富命令发现与错误处理规则说明。
v0.1.1
- Major update: Auth Guard 交互逻辑重构,采用 STEP 流程(step-by-step 跳转),指令顺序和条件更加清晰。 - 登录流程拆分为 6 个明确步骤,加入严格 GOTO 流程指引,消除含糊流程描述。 - 轮询授权结果的流程显式串联,确保主动循环等待授权,不再等待用户手动确认。 - Feishu/Lark 渠道授权提示支持消息卡片和降级文本双方案。 - `my todo` 命令改为 `mywork todo`。 - skill 名称由 "meegle" 改为 "lark-project-meegle";version 升级至 0.1.1。
v0.1.0
Initial release with core Meegle CLI integration for Feishu Project/Meegle. - Supports querying and managing work items, todos, and project info via Meegle CLI. - Implements automatic login status detection with device code authentication flow and interactive host selection. - Proactively polls for authorization after sending verification link—users see "login successful" immediately upon completion. - Auth guard required before all business commands; comprehensive error handling for missing dependencies and auth failures. - Detailed command patterns, flag/parameter options, and quick command reference included. - Includes command inspection to view schema and arguments for Meegle commands.
元数据
Slug lark-project-meegle
版本 0.1.4
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 5
常见问题

Lark Project / Meegle 是什么?

连接飞书项目/Meegle,查询和管理工作项、待办等。自动检测登录状态,未登录时引导 Device Code 授权。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 930 次。

如何安装 Lark Project / Meegle?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install lark-project-meegle」即可一键安装,无需额外配置。

Lark Project / Meegle 是免费的吗?

是的,Lark Project / Meegle 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Lark Project / Meegle 支持哪些平台?

Lark Project / Meegle 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Lark Project / Meegle?

由 KentonYu(@kentonyu)开发并维护,当前版本 v0.1.4。

💬 留言讨论