wecom-unified
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese企业微信套件 (WeCom Unified)
WeCom Unified Suite
企业微信 CLI () 全能套件,通过命令行工具与企业微信系统交互,覆盖 6 大业务域:通讯录、消息、文档(含文档/智能表格/智能文档 3 种品类)、日程、会议、待办。
wecom-cliAll-in-one WeCom CLI () suite, interacting with the WeCom system via command-line tools, covering 6 core business domains: Contacts, Messages, Documents (including 3 types: Document, Smart Sheet, Smart Document), Schedules, Meetings, and Tasks.
wecom-cli⚠️ 前置检查 — 使用任何命令前必须执行
⚠️ Pre-check — Must be executed before using any commands
Step 1: 检查 CLI 是否安装
Step 1: Check if CLI is installed
bash
wecom-cli --version如果命令不存在或报错,执行安装:
bash
npm install -g @wecom/clibash
wecom-cli --versionIf the command does not exist or throws an error, execute the installation:
bash
npm install -g @wecom/cliStep 2: 检查凭证是否配置
Step 2: Check if credentials are configured
bash
wecom-cli auth show --auth-status- 输出 → 已配置,可以继续使用
authorized - 输出 → 未配置,需要执行 Step 3
unauthorized
bash
wecom-cli auth show --auth-status- Output → Configured, you can proceed
authorized - Output → Not configured, need to execute Step 3
unauthorized
Step 3: 配置凭证(仅未授权时执行)
Step 3: Configure credentials (only execute if unauthorized)
bash
wecom-cli init --noninteractive⚠️ 该命令会输出一个授权链接和二维码,并阻塞等待用户扫码完成验证。授权成功后命令会自动退出,仅需执行一次。
bash
wecom-cli init --noninteractive⚠️ This command will output an authorization link and QR code, and block waiting for the user to scan the code to complete verification. The command will exit automatically after successful authorization, and only needs to be executed once.
业务域概览
Business Domain Overview
👤 通讯录 (contact)
👤 Contacts (contact)
获取可见范围成员列表、按姓名/别名搜索匹配、查询 userid。
→ 详见 references/wecom-contact.md
Get visible member list, search matches by name/alias, query userid.
→ See details in references/wecom-contact.md
💬 消息 (msg)
💬 Messages (msg)
会话列表查询、消息记录拉取(文本/图片/文件/语音/视频)、多媒体文件获取、文本消息发送。
→ 详见 references/wecom-msg.md
Query conversation list, pull message records (text/image/file/voice/video), get multimedia files, send text messages.
→ See details in references/wecom-msg.md
📄 文档、智能表格 & 智能文档 (doc)
📄 Documents, Smart Sheets & Smart Documents (doc)
文档创建/读取/编辑(Markdown 格式),智能表格子表管理、字段/列管理、记录增删改查,智能文档(智能主页)创建与内容导出。支持通过 docid 或 URL 定位文档,自动识别文档品类(文档/智能表格/智能文档)并路由到正确接口。
→ 详见 references/wecom-doc.md
Create/read/edit documents (in Markdown format), manage Smart Sheet sub-tables, fields/columns, add/delete/update/query records, create Smart Documents (Smart Homepage) and export content. Support locating documents via docid or URL, automatically identify document types (Document/Smart Sheet/Smart Document) and route to the correct interface.
→ See details in references/wecom-doc.md
📅 日程 (schedule)
📅 Schedules (schedule)
查询日程列表与详情、创建/修改/取消日程、添加/移除参与人、查询多成员闲忙状态并分析共同空闲时段。
→ 详见 references/wecom-schedule.md
Query schedule list and details, create/modify/cancel schedules, add/remove participants, check availability status of multiple members and analyze common free time slots.
→ See details in references/wecom-schedule.md
🎥 会议 (meeting)
🎥 Meetings (meeting)
创建预约会议、查询会议列表与详情、取消会议、更新受邀成员。
→ 详见 references/wecom-meeting.md
Create scheduled meetings, query meeting list and details, cancel meetings, update invited members.
→ See details in references/wecom-meeting.md
✅ 待办 (todo)
✅ Tasks (todo)
查询待办列表与详情、创建/更新/删除待办、变更用户处理状态(接受/拒绝/完成)、分派任务。
→ 详见 references/wecom-todo.md
Query task list and details, create/update/delete tasks, change user processing status (accept/reject/complete), assign tasks.
→ See details in references/wecom-todo.md
公共概念与规则
Common Concepts and Rules
所有业务域共享的通用调用格式、返回格式、错误处理、通讯录查询方法和时间格式规范。
→ 详见 references/wecom-shared.md
General call format, return format, error handling, contact query methods, and time format specifications shared by all business domains.
→ See details in references/wecom-shared.md
快速示例
Quick Examples
查询通讯录成员
Query contact members
bash
wecom-cli contact get_userlist '{}'bash
wecom-cli contact get_userlist '{}'查看最近会话列表
View recent conversation list
bash
wecom-cli msg get_msg_chat_list '{"begin_time": "2026-04-08 00:00:00", "end_time": "2026-04-15 23:59:59"}'bash
wecom-cli msg get_msg_chat_list '{"begin_time": "2026-04-08 00:00:00", "end_time": "2026-04-15 23:59:59"}'发送文本消息
Send text message
bash
wecom-cli msg send_message '{"chat_type": 1, "chatid": "zhangsan", "msgtype": "text", "text": {"content": "hello"}}'bash
wecom-cli msg send_message '{"chat_type": 1, "chatid": "zhangsan", "msgtype": "text", "text": {"content": "hello"}}'创建文档
Create document
bash
wecom-cli doc create_doc '{"doc_type": 3, "doc_name": "项目周报"}'bash
wecom-cli doc create_doc '{"doc_type": 3, "doc_name": "项目周报"}'读取文档内容(Markdown 格式)
Read document content (Markdown format)
bash
wecom-cli doc get_doc_content '{"docid": "DOCID", "type": 2}'bash
wecom-cli doc get_doc_content '{"docid": "DOCID", "type": 2}'创建智能文档(智能主页)
Create Smart Document (Smart Homepage)
⚠️ 特殊语法:此命令必须使用(带+smartpage_create前缀),加号不可省略;该+仅适用于此命令,不要泛化到其他+子命令。doc
bash
wecom-cli doc +smartpage_create '{"title": "项目概览", "pages": [{"page_title": "需求文档", "content_type": 1, "page_filepath": "/path/to/requirements.md"}]}'⚠️ Special Syntax: This command must use(with+smartpage_createprefix), the plus sign cannot be omitted; this+only applies to this command, do not generalize to other+sub-commands.doc
bash
wecom-cli doc +smartpage_create '{"title": "项目概览", "pages": [{"page_title": "需求文档", "content_type": 1, "page_filepath": "/path/to/requirements.md"}]}'导出智能文档内容
Export Smart Document content
bash
wecom-cli doc smartpage_export_task '{"docid": "DOCID", "content_type": 1}'bash
wecom-cli doc smartpage_export_task '{"docid": "DOCID", "content_type": 1}'查询今天的日程
Query today's schedules
bash
wecom-cli schedule get_schedule_list_by_range '{"start_time": "2026-04-15 00:00:00", "end_time": "2026-04-15 23:59:59"}'bash
wecom-cli schedule get_schedule_list_by_range '{"start_time": "2026-04-15 00:00:00", "end_time": "2026-04-15 23:59:59"}'创建预约会议
Create scheduled meeting
bash
wecom-cli meeting create_meeting '{"title": "周例会", "meeting_start_datetime": "2026-04-16 15:00", "meeting_duration": 3600}'bash
wecom-cli meeting create_meeting '{"title": "周例会", "meeting_start_datetime": "2026-04-16 15:00", "meeting_duration": 3600}'查看待办列表
View task list
bash
wecom-cli todo get_todo_list '{}'bash
wecom-cli todo get_todo_list '{}'创建待办
Create task
bash
wecom-cli todo create_todo '{"content": "完成Q2规划文档", "remind_time": "2026-04-20 09:00:00"}'bash
wecom-cli todo create_todo '{"content": "完成Q2规划文档", "remind_time": "2026-04-20 09:00:00"}'