How to Connect Corporate WeChat with the Terminal and AI Agents
If you've ever worked with Chinese clients, contractors, or subsidiaries, you've likely encountered WeCom (also known as WeChat Work or 企业微信). In China, this messenger literally covers everything: email, corporate calendars, cloud drives, smart tables, and video calls.
But for an engineer, daily routines within the heavy desktop client become tedious. Manually forwarding build logs, creating standard meetings, or updating rows in a corporate spreadsheet gets old fast. The WeCom team has released a repository wecom-cli as open source. This is an official command-line utility designed specifically for automating routine tasks and connecting AI agents.
Why Move Corporate Messenger to Console
The core concept is straightforward and practical. Developers consolidated the platform's scattered APIs into a single binary that works equally well whether you run it manually from a bash script or delegate it to autonomous AI agents.
Instead of writing custom wrappers around HTTP APIs with authentication and token refresh logic, you get a ready-made command-line interface. The utility is built in Rust, compiles for macOS, Linux, and Windows, and installs via a standard npm command.
# Установка CLI
npm install -g @wecom/cli
# Установка модуля навыков для AI-агентов
npx skills add WeComTeam/wecom-cli -y -g
# Первичная авторизация через QR-код
wecom-cli auth init
# Проверка статуса входа
wecom-cli auth show
Authentication is convenient: you run the command, scan the QR code generated in the terminal using the WeCom mobile app, and the session is saved. If you're running a script on a remote server without a screen, there's a --manual flag for manually entering bot credentials.
What the Utility Can Do
The utility covers virtually all WeCom workspace services. All functionality can be divided into four main areas.
1. Messages and Email
The bot can send notifications to recent direct messages and group chats. Markdown formatting, file attachments, images, videos, and voice notes are supported. The mail module can search for emails, read message bodies, send replies, and forward attachments.
2. Documents and Smart Tables
Through the terminal, you can create new online documents, append text to the end of a file, or overwrite it entirely. Tables support CSV and Excel imports, adding rows, and reading cells. For advanced smart tables (WeCom's Airtable equivalent), the CLI can modify field structures, configure views, and update styles.
3. Calendar, Tasks, and Meetings
The tool can create and cancel meetings, check participant availability, and book conference rooms. After a call, you can retrieve the text transcript and brief meeting summary via CLI. The task module supports creating tickets, reassigning owners, and marking completion.
4. Disk and Contacts
The utility searches for colleagues by name, pinyin transliteration, or nickname. This enables scripts to automatically find the right person and assign them a task or meeting. WeCom file disk supports searching, uploading, and downloading documents.
Under the Hood and AI Integration
The source code is written in Rust (version 1.75 and above). This provides instant command response in pipelines and low memory consumption compared to pure scripting alternatives.
Another interesting detail is the Agent Skills protocol support. The README specifically highlights the npx skills add WeComTeam/wecom-cli command. It registers the CLI as a toolset for LLM agents (for example, in environments like Claude Desktop, Cursor, or AutoGPT).
When you connect such a skill, the neural network receives a structured description of all commands. The model can independently parse an email, find the needed file on disk, extract numbers from it, create a smart table, and send a report to the work chat without a single line of additional adapter code.
Practical Scenarios
Where would such a tool be useful in practice?
- CI/CD reports. Instead of standard webhooks, you can set up complex logic: the bot collects an artifact, uploads it to WeCom disk, attaches the link to a message in the release chat, and tags the on-call engineer.
- Task synchronization. A script fetches new issues from Jira or GitHub and creates corresponding tasks in WeCom for the local team.
- Meeting summary collection. Automatic retrieval of meeting transcripts after online meetings, processing them through an LLM, and publishing summaries to an internal document.
- Quick data import. Regular export of metrics from databases to smart tables without manual CSV export.
If your team is tied to Chinese partners or uses WeCom as the primary work tool, wecom-cli will save a lot of time.
The project is new, documentation is partially in Chinese, but the commands are intuitive, and the Rust foundation makes the utility reliable for server-side cron jobs. To get started, you only need Node.js 18, the installed package, and a WeCom account. It's definitely worth trying, especially if you automate deployments or set up local AI agents.
Related projects