OpenCLI Online

WeCom

WeCom CLI (wecom-cli)

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.

PurposeURL
Source & issueshttps://github.com/WecomTeam/wecom-cli
WeCom help (smart bot credentials)https://open.work.weixin.qq.com/help2/pc/cat?doc_id=21677
WeCom Open Platformhttps://work.weixin.qq.com/

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.


Configure credentials — init

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
LevelOutput
Top --helpLists all category
Second --helpLists all method in that category
Third --helpJSON 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

categoryArea
contactContacts
docDocs & smartsheet
meetingMeetings
msgMessaging
scheduleCalendar
todoTasks

Method quick reference

All method names below match wecom-cli <category> --help; if upstream adds tools, trust --help.

categorymethodSummary
contactget_userlistMembers visible to the current user (userid / name / alias)
todoget_todo_listTodo list summary (pair with get_todo_detail)
todoget_todo_detailBatch detail by todo_id_list
todocreate_todoCreate todo
todoupdate_todoUpdate todo
tododelete_todoDelete todo
todochange_todo_user_statusCurrent user status on a todo
scheduleget_schedule_list_by_rangeList schedules in a time range
scheduleget_schedule_detailDetail by schedule_id_list
schedulecreate_scheduleCreate schedule
scheduleupdate_scheduleUpdate schedule
schedulecancel_scheduleCancel schedule
scheduleadd_schedule_attendeesAdd attendees
scheduledel_schedule_attendeesRemove attendees
schedulecheck_availabilityMulti-user free/busy
msgget_msg_chat_listConversation list
msgget_messageFetch messages in a chat
msgget_msg_mediaDownload media by media_id
msgsend_messageSend text and other message types
meetingcreate_meetingCreate scheduled meeting
meetinglist_user_meetingsList meetings
meetingget_meeting_infoMeeting detail
meetingcancel_meetingCancel meeting
meetingset_invite_meeting_membersUpdate invitees
docget_doc_contentRead doc body
doccreate_docCreate doc or smartsheet
docedit_doc_contentOverwrite doc body
docsmartsheet_get_sheetList subsheets
docsmartsheet_add_sheetAdd subsheet
docsmartsheet_update_sheetUpdate subsheet
docsmartsheet_delete_sheetDelete subsheet
docsmartsheet_get_fieldsField schema
docsmartsheet_add_fieldsAdd fields
docsmartsheet_update_fieldsUpdate fields
docsmartsheet_delete_fieldsDelete fields
docsmartsheet_get_recordsQuery records
docsmartsheet_add_recordsAdd records
docsmartsheet_update_recordsUpdate records
docsmartsheet_delete_recordsDelete records

Runtime paths

ItemDefaultNotes
Config dir~/.config/wecomOverride with WECOM_CLI_CONFIG_DIR
Bot credential<config_dir>/bot.encAfter init
MCP config cache<config_dir>/mcp_config.encUpdated after configuration
Media temp dir<system temp>/wecom/mediaWECOM_CLI_TMP_DIR overrides root

Environment variables

VariablePurpose
WECOM_CLI_CONFIG_DIROverride config directory
WECOM_CLI_TMP_DIROverride media temp root
WECOM_CLI_LOG_LEVELstderr log level
WECOM_CLI_LOG_FILEJSON logs, daily ww.log
WECOM_CLI_MCP_CONFIG_ENDPOINTOverride MCP config endpoint

contact

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 fieldRequiredNotes
create_begin_time / create_end_timeNoFilter by created time, YYYY-MM-DD HH:mm:ss
remind_begin_time / remind_end_timeNoReminder time filter
limitNoDefault 10, max 20
cursorNoPagination, 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 fieldRequiredNotes
todo_id_listYesString array, max 20 ids
wecom-cli todo get_todo_detail '{"todo_id_list": ["TODO_ID_1", "TODO_ID_2"]}'

create_todo

JSON fieldRequiredNotes
contentYesBody text
follower_listNo{"followers":[{"follower_id":"userid","follower_status":1}]}; follower_id from get_userlist
remind_timeNoYYYY-MM-DD HH:mm:ss
wecom-cli todo create_todo '{"content": "Finish spec", "remind_time": "2025-06-01 09:00:00"}'

update_todo

JSON fieldRequiredNotes
todo_idYes
content / follower_list / todo_status / remind_timeNotodo_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 fieldRequiredNotes
todo_idYesIrreversible
wecom-cli todo delete_todo '{"todo_id": "TODO_ID"}'

change_todo_user_status

JSON fieldRequiredNotes
todo_idYes
user_statusYes0 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 fieldRequiredNotes
chat_typeYes1 DM, 2 group
chatidYesPeer userid for DM, group id for groups
begin_time / end_timeYesYYYY-MM-DD HH:mm:ss, within allowed window (see upstream)
cursorNoPagination
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"}'

get_msg_media

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_typeMeaning
3Document
10Smartsheet

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 foldercategoryScope (per upstream)
wecomcli-contactcontactContacts
wecomcli-todotodoTodo lifecycle
wecomcli-meetingmeetingCreate/list/cancel/invitees
wecomcli-msgmsgChats, messages, media, send
wecomcli-schedulescheduleCalendar CRUD, attendees, free/busy
wecomcli-docdocDocs & smartsheet

License

Upstream wecom-cli is MIT (see repository LICENSE).