wecom-cli is a command-line tool for operating WeCom, covering messaging, email, documents, spreadsheets, tasks, calendars, meetings, cloud files, and contact searches. It is intended for people and AI agents that need to perform WeCom workplace operations from a terminal. Its catalogue entries provide skills and instructions for using the tool.
Borrowing it
Nothing to install: this file belongs to WecomTeam/wecom-cli. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/WecomTeam/wecom-cli/main/AGENTS.mdgit clone --depth 1 https://github.com/WecomTeam/wecom-cliWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/wecomteam/wecom-cli/agents-md)<a href="https://agentmods.dev/instructions/wecomteam/wecom-cli/agents-md"><img src="https://agentmods.dev/badge/instructions/wecomteam/wecom-cli/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/wecomteam/wecom-cli/agents-md"><img src="https://agentmods.dev/badge/instructions/wecomteam/wecom-cli/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.04528 | $0.04528 |
| Opus 5.5 | $0.01811 | $0.01811 |
| Sonnet 5.5 | $0.00906 | $0.00906 |
| Haiku 4.5 | $0.00453 | $0.00453 |
Grade A, and why
wecom-cli AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 24d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 145 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
面向 AI Agent 与贡献者的仓库导览:快速定位关键代码、理解核心机制、正确构建与测试。 本文只描述当前实现;改动代码后若结构或机制发生变化,请同步更新本文。
项目概述
wecom-cli 是企业微信官方 CLI(Rust 实现,经 npm 包 @wecom/cli 分发),覆盖消息、邮件、在线文档、智能文档、在线表格、智能表格、待办、日程、会议、微盘、通讯录等办公能力。仓库同时内置 skills/ 下的 Agent Skills,供 AI Agent 调用 CLI 完成业务操作。
CLI 通过 discovery 协议从服务端动态下发服务目录与方法 schema,再在本地构建 clap 命令树。命令模型(按 Client::run 的调度顺序):
wecom-cli --version | --help # 版本与帮助
wecom-cli auth <init|show> # 扩展命令:bin 侧经 ClientBuilder::command() 挂载
wecom-cli cache <status|clear> # 内建命令:discovery 缓存管理(help 中隐藏)
wecom-cli schema <list|get> # 内建命令:服务/方法 schema(help 中隐藏)
wecom-cli <service> --doc | --schema # 服务级文档(service 由 discovery 下发)
wecom-cli <service> [resource...] <method> [flags] # 远程方法调用(方法参数由 schema 生成)
wecom-cli <service> +<helper> [flags] # 本地 helper(+ 前缀,HelperRegistry 调度)
仓库结构
Cargo workspace(resolver = "3",edition 2024)+ pnpm workspace(仅管理 packages/* 平台二进制包):
| 路径 | 说明 |
|---|---|
crates/wecom/ |
核心库(lib):Client/ClientBuilder、argv 调度、discovery 与缓存、schema 驱动命令树、指令处理、输出路由、沙箱 FS |
crates/wecom-cli/ |
二进制(bin):main.rs 装配入口、auth 鉴权体系、config/env/logging、WecomBackend |
crates/wecom-transport/ |
传输层:TransportBackend trait、reqwest HTTP 后端、信封 trait、端点目录泛型、长任务轮询 |
bin/wecom.js |
npm 入口脚本:定位并 exec 当前平台的二进制 |
packages/* |
各平台 npm 二进制包(optionalDependencies 分发:darwin/linux × x64/arm64、win32-x64) |
skills/* |
内置 Agent Skills(14 个,导航见 docs/skills.md) |
docs/ |
持续维护的使用与开发文档(入口 docs/README.md) |
模块职责
crates/wecom(lib)
| 模块 | 职责 |
|---|---|
client/ |
Client/ClientBuilder(builder.rs);run.rs 的 CliRun 负责 argv 调度;invoke.rs/upload.rs 程序化调用;custom_command.rs 扩展命令点;catalog.rs 定义 EndpointKey 内建默认与 PayloadStringReq 请求信封 |
service/ |
服务调用链:handler.rs 服务内分发(helper 优先于 method);command/ 由 schema 构建 clap 子命令树(build.rs/schema_clap.rs)并装配请求体(assemble.rs,命名参数 + --json + --set);execute.rs 执行与游标分页;output.rs 输出路由;preview.rs --dry-run;doc.rs --doc;alias.rs path_alias 隐藏别名;service_handle.rs/method_handle.rs 程序化句柄 |
registry/ |
discovery 服务目录、schema 拉取与缓存(<config_dir>/cache,TTL 60 秒) |
schema/ |
schema 类型、解析、TS 文档生成(ts_doc.rs) |
directive/ |
x-wecom-* 指令:UploadMedia(媒体上传)、UploadMultipart(表单上传)、Save(响应字段落盘);请求前与响应后各收集处理一次 |
builtins/ |
媒体上传的内建实现(upload_media.rs) |
helpers/ |
Helper trait 与 HelperRegistry:以 + 前缀挂载在任意命令路径上的本地命令 |
fs/ |
沙箱文件系统 Fs(按 readable/writable roots 校验)、PathResolver 路径解析、文件名清洗 |
constants.rs |
CLI_INFO/CliInfo:编译期注入的版本信息(--version 输出与 X-WeCom-Cli-Info 请求头) |
error.rs |
lib 层统一错误(错误码段 893000–893099);后台 errcode 经 transport 透传 |
telemetry/ |
lib 侧 telemetry 事件 |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 24d ago Changed · +95 tokens per session 5acba1fbe6f5
- 1mo ago Changed · +11 tokens per session 3de950d2726c
- 1mo ago Changed · +3 lines · +382 tokens per session ab80d5403e4e
- 1mo ago Changed · +286 tokens per session 8791153229e5
- 1mo ago Changed · +1 lines · +103 tokens per session 784c681f551c
- 2mo ago First seen · 141 lines · 3,651 tokens per session scan A ece3a8bc531f
wecom-cli AGENTS.md is an instructions file published in the GitHub repository WecomTeam/wecom-cli (3,303 stars, last pushed 4d ago), licensed MIT. It adds 4,528 tokens to every session, about $0.0181 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
wecom-cli AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| wecom-cli AGENTS.mdWecomTeam/wecom-cli | Instructions file | 3.3k | 4d ago | MIT | A | 4,528 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |