- 移除 TodoItem 中的 priority、created_at 和 updated_at 字段 - 强制每个任务都必须有唯一 id,且由用户负责生成 - 修改合并模式逻辑,merge=true 下保留未提及的旧任务 - 支持已完成和已取消任务重新激活(状态改回 pending 或 in_progress) - 禁止 in_progress 状态退回到 pending,必须标记为 completed 或 cancelled - 优化状态转换校验,允许特定状态间合法切换 - 简化任务变更消息,移除详细的新增/更新/移除统计 - 更新文档和示例,明确 id 必须由用户生成和使用 - 修复和补充测试,增强状态转换和合并模式验证 - 调整任务时间戳生成逻辑,统一使用当前时间及索引 - 该变更提供更合理的任务状态机械及管理模式,提升稳定性和易用性
3.5 KiB
3.5 KiB
lark-wiki +member-add
Add a member to a wiki space. OpenAPI: POST /open-apis/wiki/v2/spaces/:space_id/members. Shortcut over the raw wiki members create — adds enum hints, optional --need-notification, my_library resolution, and a flattened single-member output envelope.
The underlying
members.createAPI is flaggeddanger: truein the schema browser, but adding a member is not confirmation-gated (no--yes). To revert, call+member-removewith the same(member_id, member_type, member_role)tuple.
Usage
# Add a user as a regular member
lark-cli wiki +member-add \
--space-id <space_id> \
--member-id <open_id|email|user_id|app_id|...> \
--member-type <openid|email|userid|unionid|openchat|opendepartmentid|appid> \
--member-role <admin|member> \
[--need-notification] \
[--as user|bot]
# Personal library (resolves my_library to the per-user real space first)
lark-cli wiki +member-add \
--space-id my_library \
--member-id ou_xxx --member-type openid --member-role member \
--as user
# Preview the call chain without writing
lark-cli wiki +member-add \
--space-id <space_id> --member-id <id> --member-type openid --member-role admin \
--dry-run
Flags
| Flag | Type | Required | Default | Description |
|---|---|---|---|---|
--space-id |
string | Yes | — | Wiki space ID; use my_library for the personal document library (user only) |
--member-id |
string | Yes | — | Member ID; interpretation is decided by --member-type |
--member-type |
enum | Yes | — | openchat / userid / email / opendepartmentid / openid / unionid / appid |
--member-role |
enum | Yes | — | admin (full space administration) / member (collaborator) |
--need-notification |
bool | No | unset | Send an in-app notification after the grant. Omitting the flag sends no need_notification query at all — passing --need-notification=false is the explicit opt-out |
--as |
enum | No | auto |
Identity user/bot; wiki is user-centric → pass --as user |
Output
{
"space_id": "7160145948494381236",
"member_id": "ou_449b53ad6aee526f7ed311b216aabcef",
"member_type": "openid",
"member_role": "admin",
"type": "user"
}
type is a read-only enum (user / chat / department) the server attaches; absent when the API omits it.
Notes
- Bot +
my_libraryis rejected upfront —my_libraryis a per-user alias with no meaning for a tenant token. Pass an explicit--space-idwhen--as bot. - Bot +
opendepartmentidis a known unsupported path on the backend. The CLI does not pre-block it (the API may evolve), but the call will fail. Use--as userfor department adds. - App member uses
--member-type=appid. The corresponding--member-idis the app ID, commonly formatted ascli_xxx. - Resolve
--member-idbefore calling:lark-cli contact +search-userfor users,lark-cli im +chat-searchfor groups,lark-cli api POST /open-apis/contact/v3/departments/searchfor departments. Do not call+member-addfirst and reverse-engineer the type from the error. - The role switch (
admin⇄member) is not a single update — call+member-removefor the old role first, then+member-addwith the new one. --dry-runpreviews 2 steps when--space-id my_library(resolve → add), 1 step otherwise.
Required Scope
wiki:member:create