lark-shared

Installation
Summary

Lark CLI configuration, authentication, and operational guidelines for agent workflows.

  • Requires initial setup via lark-cli config init --new; generate QR codes for all verification URLs using lark-cli auth qrcode before sharing with users
  • Supports two identity types—user (personal resources via auth login) and bot (application-level via appId/appSecret)—with distinct permission models; confirm identity matches the operation's intent
  • Handle permission errors differently by identity: bot requires backend scope setup (provide console_url), user requires auth login --scope or --domain with explicit scope specification
  • Use split-flow for agent-initiated auth: execute --no-wait --json to get verification URL and device code, display to user, then execute --device-code in a follow-up step after user confirms completion
  • High-risk write operations require explicit user confirmation; when CLI exits with code 10 and confirmation_required error, display the action details, obtain user consent, then retry with --yes appended to the original command
SKILL.md

lark-cli 共享规则

所有 lark-* skill 共享的底座:身份、认证、输出契约与高风险操作。

通用准则

  1. 调用前先确认用法:执行前读对应 reference 或跑 --help,别猜 flag 盲调。

  2. 身份决定你代表谁操作--as user 代表用户本人(能看到、也能操作其日历、云空间/云盘/云存储等个人资源),--as bot 代表应用自己,应用级操作,只能访问bot自己的资源,bot 查用户资源会返回空成功而非报错。动手前先搞清楚身份identity。身份模型和权限管理 → lark-shared-identity-and-permissions.md

  3. 授权 / 配置类 URL 必须配二维码:当命令输出 verification_urlverification_uri_completeconsole_url 等 URL 字段时,必须用 lark-cli auth qrcode 生成并在回复中展示,URL 在前二维码在后;优先生成 PNG(--output),仅当用户明确要求时才使用 ASCII(--ascii)。URL 原样转发——不编解码、不加标点、不重拼 query,二维码和链接请一起展示给用户。

  4. --format json(默认)下,判断成功用 ok == true(或进程退出码 0),不要用 code == 0:成功信封没有顶层 code / msg 字段,code 只出现在错误信封的 error 内。按 OpenAPI 老格式 {"code": 0, "msg": "ok"}判断会把所有成功调用误判为失败——封装写入类命令时尤其危险。JSON 输出契约 → lark-shared-output-contract.md

安全规则

  1. 禁止输出密钥(appSecret、accessToken等)到终端明文。
Installs
413.7K
Repository
larksuite/cli
GitHub Stars
16.5K
First Seen
Mar 28, 2026
lark-shared — larksuite/cli