Full wecom-cli reference—40+ methods across six categories, install, init, paths, env vars, and JSON examples; GitHub is for source only.
About this page
Derived from wecom-cli docs/cli-reference.md and skills/*/SKILL.md / references/*.md. You can look up every category and method here (category + method), including typical JSON payloads. GitHub links are for source and issues—not required reading first.
Install & Agent Skills
npm install -g @wecom/cli
npx skills add WecomTeam/wecom-cli -y -g
@wecom/cli: official global npm package providing wecom-cli.
skills add WecomTeam/wecom-cli: installs bundled Agent Skills (-y confirm, -g global).
Requirements (per upstream README): macOS / Linux / Windows (x64, etc.), Node.js >= 18; corporate eligibility limits apply—see upstream.
Interactive setup for the WeCom bot credential, encrypted locally—usually once.
wecom-cli init
- Enter Bot ID / Secret manually (see official help) or scan to bind.
- Upstream notes: availability may be limited (e.g. small orgs)—see repository README.
Command shape & --help
wecom-cli --help
wecom-cli <category> --help
wecom-cli <category> <method> --help
| Level | Output |
|---|
Top --help | Lists all category |
Second --help | Lists all method in that category |
Third --help | JSON Schema / parameters (needs valid credentials and network; schema is fetched dynamically) |
Invocation:
wecom-cli <category> <method> '<json_args>'
json_args is a single-line JSON string; use '{}' when no args.
- Default timeout 30s;
get_msg_media uses 120s.
get_msg_media downloads media to a temp dir; response includes local_path.
category overview
category | Area |
|---|
contact | Contacts |
doc | Docs & smartsheet |
meeting | Meetings |
msg | Messaging |
schedule | Calendar |
todo | Tasks |
Method quick reference
All method names below match wecom-cli <category> --help; if upstream adds tools, trust --help.
| category | method | Summary |
|---|
| contact | get_userlist | Members visible to the current user (userid / name / alias) |
| todo | get_todo_list | Todo list summary (pair with get_todo_detail) |
| todo | get_todo_detail | Batch detail by todo_id_list |
| todo | create_todo | Create todo |
| todo | update_todo | Update todo |
| todo | delete_todo | Delete todo |
| todo | change_todo_user_status | Current user status on a todo |
| schedule | get_schedule_list_by_range | List schedules in a time range |
| schedule | get_schedule_detail | Detail by schedule_id_list |
| schedule | create_schedule | Create schedule |
| schedule | update_schedule | Update schedule |
| schedule | cancel_schedule | Cancel schedule |
| schedule | add_schedule_attendees | Add attendees |
| schedule | del_schedule_attendees | Remove attendees |
| schedule | check_availability | Multi-user free/busy |
| msg | get_msg_chat_list | Conversation list |
| msg | get_message | Fetch messages in a chat |
| msg | get_msg_media | Download media by media_id |
| msg | send_message | Send text and other message types |
| meeting | create_meeting | Create scheduled meeting |
| meeting | list_user_meetings | List meetings |
| meeting | get_meeting_info | Meeting detail |
| meeting | cancel_meeting | Cancel meeting |
| meeting | set_invite_meeting_members | Update invitees |
| doc | get_doc_content | Read doc body |
| doc | create_doc | Create doc or smartsheet |
| doc | edit_doc_content | Overwrite doc body |
| doc | smartsheet_get_sheet | List subsheets |
| doc | smartsheet_add_sheet | Add subsheet |
| doc | smartsheet_update_sheet | Update subsheet |
| doc | smartsheet_delete_sheet | Delete subsheet |
| doc | smartsheet_get_fields | Field schema |
| doc | smartsheet_add_fields | Add fields |
| doc | smartsheet_update_fields | Update fields |
| doc | smartsheet_delete_fields | Delete fields |
| doc | smartsheet_get_records | Query records |
| doc | smartsheet_add_records | Add records |
| doc | smartsheet_update_records | Update records |
| doc | smartsheet_delete_records | Delete records |
Runtime paths
| Item | Default | Notes |
|---|
| Config dir | ~/.config/wecom | Override with WECOM_CLI_CONFIG_DIR |
| Bot credential | <config_dir>/bot.enc | After init |
| MCP config cache | <config_dir>/mcp_config.enc | Updated after configuration |
| Media temp dir | <system temp>/wecom/media | WECOM_CLI_TMP_DIR overrides root |
Environment variables
| Variable | Purpose |
|---|
WECOM_CLI_CONFIG_DIR | Override config directory |
WECOM_CLI_TMP_DIR | Override media temp root |
WECOM_CLI_LOG_LEVEL | stderr log level |
WECOM_CLI_LOG_FILE | JSON logs, daily ww.log |
WECOM_CLI_MCP_CONFIG_ENDPOINT | Override MCP config endpoint |
get_userlist
Members visible to the current user; returns userid, name, alias (not guaranteed full company roster).
wecom-cli contact get_userlist '{}'
- No required JSON fields; use
'{}'.
- Upstream: if visible members exceed 10, the API may error—small-scope scenarios only.
todo
get_todo_list
| JSON field | Required | Notes |
|---|
create_begin_time / create_end_time | No | Filter by created time, YYYY-MM-DD HH:mm:ss |
remind_begin_time / remind_end_time | No | Reminder time filter |
limit | No | Default 10, max 20 |
cursor | No | Pagination, use next_cursor from response |
wecom-cli todo get_todo_list '{}'
wecom-cli todo get_todo_list '{"limit": 20, "cursor": "CURSOR_1"}'
- List is summary only—call
get_todo_detail before showing users full content.
- If
has_more is true, fetch the next page.
get_todo_detail
| JSON field | Required | Notes |
|---|
todo_id_list | Yes | String array, max 20 ids |
wecom-cli todo get_todo_detail '{"todo_id_list": ["TODO_ID_1", "TODO_ID_2"]}'
create_todo
| JSON field | Required | Notes |
|---|
content | Yes | Body text |
follower_list | No | {"followers":[{"follower_id":"userid","follower_status":1}]}; follower_id from get_userlist |
remind_time | No | YYYY-MM-DD HH:mm:ss |
wecom-cli todo create_todo '{"content": "Finish spec", "remind_time": "2025-06-01 09:00:00"}'
update_todo
| JSON field | Required | Notes |
|---|
todo_id | Yes | |
content / follower_list / todo_status / remind_time | No | todo_status: 0 done, 1 in progress; delete via delete_todo |
wecom-cli todo update_todo '{"todo_id": "TODO_ID", "remind_time": "2025-07-01 09:00:00"}'
delete_todo
| JSON field | Required | Notes |
|---|
todo_id | Yes | Irreversible |
wecom-cli todo delete_todo '{"todo_id": "TODO_ID"}'
change_todo_user_status
| JSON field | Required | Notes |
|---|
todo_id | Yes | |
user_status | Yes | 0 reject, 1 accept, 2 done |
wecom-cli todo change_todo_user_status '{"todo_id": "TODO_ID", "user_status": 2}'
schedule
wecom-cli schedule get_schedule_list_by_range '{"start_time": "2026-03-01 09:00:00", "end_time": "2026-03-31 18:00:00"}'
wecom-cli schedule get_schedule_detail '{"schedule_id_list": ["SCHEDULE_ID_1", "SCHEDULE_ID_2"]}'
wecom-cli schedule create_schedule '{"schedule": {"start_time": "2026-03-20 10:00:00", "end_time": "2026-03-20 11:00:00", "summary": "Standup", "attendees": [{"userid": "USER_ID"}], "reminders": {"is_remind": 1, "remind_before_event_secs": 3600, "timezone": 8}, "location": "Room A"}}'
wecom-cli schedule update_schedule '{"schedule": {"schedule_id": "SCHEDULE_ID", "summary": "Updated title", "start_time": "YYYY-MM-DD HH:mm:ss", "end_time": "YYYY-MM-DD HH:mm:ss"}}'
wecom-cli schedule cancel_schedule '{"schedule_id": "SCHEDULE_ID"}'
wecom-cli schedule add_schedule_attendees '{"schedule_id": "SCHEDULE_ID", "attendees": [{"userid": "USER_ID"}]}'
wecom-cli schedule del_schedule_attendees '{"schedule_id": "SCHEDULE_ID", "attendees": [{"userid": "USER_ID"}]}'
wecom-cli schedule check_availability '{"check_user_list": ["USER_ID_1", "USER_ID_2"], "start_time": "2026-03-20 10:00:00", "end_time": "2026-03-20 12:00:00"}'
msg
wecom-cli msg get_msg_chat_list '{"begin_time": "2026-03-11 00:00:00", "end_time": "2026-03-17 23:59:59"}'
wecom-cli msg get_msg_chat_list '{"begin_time": "2026-03-11 00:00:00", "end_time": "2026-03-17 23:59:59", "cursor": "NEXT_CURSOR"}'
get_message
| JSON field | Required | Notes |
|---|
chat_type | Yes | 1 DM, 2 group |
chatid | Yes | Peer userid for DM, group id for groups |
begin_time / end_time | Yes | YYYY-MM-DD HH:mm:ss, within allowed window (see upstream) |
cursor | No | Pagination |
wecom-cli msg get_message '{"chat_type": 1, "chatid": "zhangsan", "begin_time": "2026-03-17 09:00:00", "end_time": "2026-03-17 18:00:00"}'
wecom-cli msg get_message '{"chat_type": 2, "chatid": "wrxxxxxxxx", "begin_time": "2026-03-17 09:00:00", "end_time": "2026-03-17 18:00:00"}'
wecom-cli msg get_msg_media '{"media_id": "MEDIAID_xxxxxx"}'
send_message
wecom-cli msg send_message '{"chat_type": 1, "chatid": "zhangsan", "msgtype": "text", "text": {"content": "hello world"}}'
wecom-cli msg send_message '{"chat_type": 2, "chatid": "wrxxxxxxxx", "msgtype": "text", "text": {"content": "Hi everyone"}}'
meeting
wecom-cli meeting create_meeting '{"title": "Weekly", "meeting_start_datetime": "2026-03-18 15:00", "meeting_duration": 3600}'
wecom-cli meeting create_meeting '{"title": "Review", "meeting_start_datetime": "2026-03-18 15:00", "meeting_duration": 3600, "location": "3F room", "invitees": {"userid": ["zhangsan", "lisi"]}}'
wecom-cli meeting list_user_meetings '{"begin_datetime": "2026-03-01 00:00", "end_datetime": "2026-03-31 23:59", "limit": 100}'
wecom-cli meeting get_meeting_info '{"meetingid": "<meeting id>"}'
wecom-cli meeting cancel_meeting '{"meetingid": "<meeting id>"}'
wecom-cli meeting set_invite_meeting_members '{"meetingid": "<meeting id>", "invitees": [{"userid": "lisi"}, {"userid": "wangwu"}]}'
doc
doc_type (create_doc)
doc_type | Meaning |
|---|
3 | Document |
10 | Smartsheet |
Examples
wecom-cli doc get_doc_content '{"docid": "DOCID", "type": 2}'
wecom-cli doc get_doc_content '{"docid": "DOCID", "type": 2, "task_id": "xxx"}'
wecom-cli doc get_doc_content '{"url": "https://doc.weixin.qq.com/doc/xxx", "type": 2}'
wecom-cli doc create_doc '{"doc_type": 3, "doc_name": "Weekly report"}'
wecom-cli doc create_doc '{"doc_type": 10, "doc_name": "Task board"}'
wecom-cli doc edit_doc_content '{"docid": "DOCID", "content": "# Title\n\nBody", "content_type": 1}'
wecom-cli doc smartsheet_get_sheet '{"docid": "DOCID"}'
wecom-cli doc smartsheet_add_sheet '{"docid": "DOCID", "properties": {"title": "New sheet"}}'
wecom-cli doc smartsheet_update_sheet '{"docid": "DOCID", "properties": {"sheet_id": "SHEET_ID", "title": "Renamed"}}'
wecom-cli doc smartsheet_delete_sheet '{"docid": "DOCID", "sheet_id": "SHEETID"}'
wecom-cli doc smartsheet_get_fields '{"docid": "DOCID", "sheet_id": "SHEETID"}'
wecom-cli doc smartsheet_add_fields '{"docid": "DOCID", "sheet_id": "SHEETID", "fields": [{"field_title": "Task", "field_type": "FIELD_TYPE_TEXT"}]}'
wecom-cli doc smartsheet_update_fields '{"docid": "DOCID", "sheet_id": "SHEETID", "fields": [{"field_id": "FIELDID", "field_title": "New title", "field_type": "FIELD_TYPE_TEXT"}]}'
wecom-cli doc smartsheet_delete_fields '{"docid": "DOCID", "sheet_id": "SHEETID", "field_ids": ["FIELDID"]}'
wecom-cli doc smartsheet_get_records '{"docid": "DOCID", "sheet_id": "SHEETID"}'
wecom-cli doc smartsheet_get_records '{"url": "https://doc.weixin.qq.com/smartsheet/xxx", "sheet_id": "SHEETID"}'
wecom-cli doc smartsheet_add_records '{"docid": "DOCID", "sheet_id": "SHEETID", "records": [{"values": {"Task": [{"type": "text", "text": "Finish spec"}], "Priority": [{"text": "High"}]}}]}'
wecom-cli doc smartsheet_update_records '{"docid": "DOCID", "sheet_id": "SHEETID", "key_type": "CELL_VALUE_KEY_TYPE_FIELD_TITLE", "records": [{"record_id": "RECORDID", "values": {"Task": [{"type": "text", "text": "Updated"}]}}]}'
wecom-cli doc smartsheet_delete_records '{"docid": "DOCID", "sheet_id": "SHEETID", "record_ids": ["RECORDID1", "RECORDID2"]}'
For USER (member) columns in smartsheet, supply user_id—resolve names via contact get_userlist first.
Bundled Agent Skills
| Skill folder | category | Scope (per upstream) |
|---|
wecomcli-contact | contact | Contacts |
wecomcli-todo | todo | Todo lifecycle |
wecomcli-meeting | meeting | Create/list/cancel/invitees |
wecomcli-msg | msg | Chats, messages, media, send |
wecomcli-schedule | schedule | Calendar CRUD, attendees, free/busy |
wecomcli-doc | doc | Docs & smartsheet |
License
Upstream wecom-cli is MIT (see repository LICENSE).