wecom-cli: Instructions file for Codex

AGENTS.md

wecom-cli AGENTS.md is an instructions file for Codex, OpenCode from WecomTeam/wecom-cli. It costs 4,528 tokens per session, scanned A, original, MIT.

Repository guidance for AI coding agents and contributors working on wecom-cli, a Rust command-line tool for WeCom business services.

In plain words
What is it for?
Use it when changing wecom-cli or its WeCom integrations, especially when you need to find modules, understand generated commands, or update the repository guide.
Why use it?
It explains the project structure, command routing, discovery system, and how to build and test changes without guessing from the code alone.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is WecomTeam/wecom-cli's own configuration. It tells Codex and OpenCode how to work on wecom-cli itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything wecom-cli configures →

About the project

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.

WecomTeam/wecom-cli · 3,303 stars · on GitHub

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/WecomTeam/wecom-cli/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/WecomTeam/wecom-cli

Made for: Codex, OpenCode.

Wrote 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.

agentmods badge for wecom-cli AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/wecomteam/wecom-cli/agents-md/github.svg)](https://agentmods.dev/instructions/wecomteam/wecom-cli/agents-md)
Your own site
<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.

agentmods 80×15 button for wecom-cli AGENTS.md

Your own site · 80×15
<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>
Per session 4,528 This file is loaded in full into every session.
When invoked 4,528 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 24d ago against content hash 5acba1fbe6f5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

AGENTS.md · 145 lines

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 事件

Read the full file on GitHub · 145 lines

Changes

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.

  1. 24d ago Changed · +95 tokens per session 5acba1fbe6f5
  2. 1mo ago Changed · +11 tokens per session 3de950d2726c
  3. 1mo ago Changed · +3 lines · +382 tokens per session ab80d5403e4e
  4. 1mo ago Changed · +286 tokens per session 8791153229e5
  5. 1mo ago Changed · +1 lines · +103 tokens per session 784c681f551c
  6. 2mo ago First seen · 141 lines · 3,651 tokens per session scan A ece3a8bc531f

Subscribe to this mod's changes

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.

Related

wecom-cli AGENTS.md compared with instructions from other repositories

wecom-cli AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
wecom-cli AGENTS.mdWecomTeam/wecom-cliInstructions file3.3k4d agoMITA4,528Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode