{"_id":"@aibotk/wms-cli","_rev":"2-f30b2e5ece1a0f92be643b2edb9b04eb","name":"@aibotk/wms-cli","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@aibotk/wms-cli","version":"0.1.0","keywords":["wms","weassist","wechat","cli","ai-agent","claude-code","openclaw","hermes","codex","微秘书","aibotk"],"author":{"url":"https://github.com/leochen-g","name":"leochen","email":"leochen@foxmail.com"},"license":"MIT","_id":"@aibotk/wms-cli@0.1.0","maintainers":[{"name":"leo_chen","email":"478914121@qq.com"}],"homepage":"https://github.com/leochen-g/wms-cli#readme","bugs":{"url":"https://github.com/leochen-g/wms-cli/issues"},"bin":{"wms":"bin/wms.js"},"dist":{"shasum":"9340fe65dfe8e0a51c712247def7031b3aac4faf","tarball":"https://registry.npmjs.org/@aibotk/wms-cli/-/wms-cli-0.1.0.tgz","fileCount":22,"integrity":"sha512-GIlT0DOwxumuXYV3uuTsi5hfMOTI3GUGJqaNvMgqEXoJMBFO+BRUYbCiCAlO24V8urhHbhsuLFhN/L8VsNzSyg==","signatures":[{"sig":"MEQCIAf8xPTrDip/x55ue5ASyjBthLF6ciqy8w7gFhmGt+t6AiAyu5XlDKtp7f0nVtpCdcx7ukPDGT6BVotPN4BEK6UM0w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":60004},"main":"src/index.js","engines":{"node":">=16"},"gitHead":"fe7b1d1f5e7753486314cdce28e6936ed547f405","scripts":{"lint":"node --check bin/wms.js","test":"jest","test:e2e":"jest --testMatch='**/test/e2e/**/*.test.js'","test:watch":"jest --watch","postinstall":"node scripts/postinstall.js"},"_npmUser":{"name":"leo_chen","email":"478914121@qq.com"},"repository":{"url":"git+https://github.com/leochen-g/wms-cli.git","type":"git"},"_npmVersion":"11.11.0","description":"微秘书 (WMS) CLI — AI-first WeChat assistant tooling. Query contacts/rooms and send messages via the WMS open API.","directories":{},"_nodeVersion":"24.14.1","dependencies":{"axios":"^1.6.0","chalk":"^4.1.2","commander":"^12.0.0","cli-table3":"^0.6.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","nock":"^13.5.0"},"_npmOperationalInternal":{"tmp":"tmp/wms-cli_0.1.0_1779530695103_0.01720102826224612","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@aibotk/wms-cli","version":"0.1.1","description":"微秘书 (WMS) CLI — AI-first WeChat assistant tooling. Query contacts/rooms and send messages via the WMS open API.","main":"src/index.js","bin":{"wms":"bin/wms.js"},"publishConfig":{"access":"public"},"scripts":{"test":"jest","test:watch":"jest --watch","test:e2e":"jest --testMatch='**/test/e2e/**/*.test.js'","lint":"node --check bin/wms.js","postinstall":"node scripts/postinstall.js"},"engines":{"node":">=16"},"keywords":["wms","weassist","wechat","cli","ai-agent","claude-code","openclaw","hermes","codex","微秘书","aibotk"],"license":"MIT","author":{"name":"leochen","email":"leochen@foxmail.com","url":"https://github.com/leochen-g"},"homepage":"https://github.com/leochen-g/wms-cli#readme","repository":{"type":"git","url":"git+https://github.com/leochen-g/wms-cli.git"},"bugs":{"url":"https://github.com/leochen-g/wms-cli/issues"},"dependencies":{"commander":"^12.0.0","axios":"^1.6.0","cli-table3":"^0.6.3","chalk":"^4.1.2"},"devDependencies":{"jest":"^29.0.0","nock":"^13.5.0"},"gitHead":"8e7e32163681578028edf4ab6f776fbe04d1739c","_id":"@aibotk/wms-cli@0.1.1","_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-n4yz6K0tlGV9Hn671N2z8M4Xan6IizHMMkiW5eHIQTNt17ar4qALDDDWU/gVuu5EYrj+d14RMpdGN+oGHjx0zQ==","shasum":"83c123df02f49cf4588cc977ee98698c253ea7ed","tarball":"https://registry.npmjs.org/@aibotk/wms-cli/-/wms-cli-0.1.1.tgz","fileCount":24,"unpackedSize":80776,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD0o/jeNx6p5L9p3kwruPNdlYpFMcS7HjjqJgaMNsqljQIgePJjdyGI5G/4yehssArGFaaLlpqAKwZDBk6X8cTC0ig="}]},"_npmUser":{"name":"leo_chen","email":"478914121@qq.com"},"directories":{},"maintainers":[{"name":"leo_chen","email":"478914121@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/wms-cli_0.1.1_1779601718125_0.7738396556738287"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-23T10:04:54.901Z","modified":"2026-05-24T05:48:38.433Z","0.1.0":"2026-05-23T10:04:55.234Z","0.1.1":"2026-05-24T05:48:38.286Z"},"bugs":{"url":"https://github.com/leochen-g/wms-cli/issues"},"author":{"name":"leochen","email":"leochen@foxmail.com","url":"https://github.com/leochen-g"},"license":"MIT","homepage":"https://github.com/leochen-g/wms-cli#readme","keywords":["wms","weassist","wechat","cli","ai-agent","claude-code","openclaw","hermes","codex","微秘书","aibotk"],"repository":{"type":"git","url":"git+https://github.com/leochen-g/wms-cli.git"},"description":"微秘书 (WMS) CLI — AI-first WeChat assistant tooling. Query contacts/rooms and send messages via the WMS open API.","maintainers":[{"name":"leo_chen","email":"478914121@qq.com"}],"readme":"# wms-cli\n\n微秘书 (WMS) 平台命令行工具，专为 AI Agent（Claude Code / OpenClaw / Hermes / Codex）与人工运维双场景设计。\n\n📖 **完整使用指南（推荐新手）：[GUIDE.md](GUIDE.md)** — 含准备工作、apiKey 获取、安装、8 个使用案例、AI Agent 接入、常见问题\n\n📝 **版本变更：[CHANGELOG.md](CHANGELOG.md)**\n\n## 安装\n\n```bash\nnpm i -g @aibotk/wms-cli\n```\n\n## 在 AI Agent 平台启用\n\n`wms-cli` 自带一份 SKILL（`skill/SKILL.md` + `skill/references/*.md`），让 AI Agent 能自动调用本 CLI。一行命令装到平台：\n\n```bash\nwms install-skill --platform all              # 装到所有检测到的平台\nwms install-skill --platform claude           # 或只装到某一个\nwms install-skill --platform claude --json    # 脚本友好输出\n```\n\n该命令把 `skill/` 拷贝到各平台的 skills 目录；目录不存在的平台会被静默跳过。\n\n| 平台 | 装到 | 如何让它生效 |\n|---|---|---|\n| **Claude Code** | `~/.claude/skills/wms/` | 新一轮对话自动加载（新版本无需重启）。触发：自然语言「用 wms 找好友 张三」或描述任务即可，Claude 根据 SKILL 的 `description` 自动匹配 |\n| **Codex**（OpenAI Codex CLI） | `~/.codex/skills/wms/` | 重启 `codex` CLI 会话。Codex 在启动时扫描 skills 目录 |\n| **OpenClaw** | `~/.openclaw/skills/wms/` | 重启 OpenClaw 会话 |\n| **Hermes** | `~/.hermes/skills/wms/` | 重启 Hermes 会话 |\n\n**验证 skill 已加载**（以 Claude Code 为例）：\n\n在新会话里问 Claude「你装了哪些 skill？」或「列一下你能用的 skill」，回答里应该包含：\n```\nwms: 微秘书 (WMS) CLI 工具。查询微信好友/群，按关键词模糊搜索...\n```\n\n或者直接给任务 ——「用 wms 找一下我的好友张三，给她发『你好』」—— Agent 会自动跑：\n```\nwms contact list --keyword 张三 --json    # 拿 wxid\nwms send contact --to <wxid> --text \"你好\" --json\n```\n\n> **注意 `bins` 约束**：SKILL 的 frontmatter 声明 `requires.bins: [\"wms\"]`，遵守这一字段的平台会先检查 `wms` 命令是否在 `$PATH`，所以必须先全局装 `@aibotk/wms-cli`，再装 skill。\n\n## 快速开始\n\n```bash\nwms auth token <你的 apiKey>                         # 默认 https://api-bot.aibotk.com\nwms auth whoami --json                                # 验证\nwms contact list --keyword \"张三\" --json\nwms send contact --to wxid_xxx --text \"你好\" --json\n```\n\n## 功能场景速查\n\n| 场景 | 命令 |\n|---|---|\n| 查机器人信息 | `wms auth whoami --json` |\n| 查好友（关键词模糊） | `wms contact list --keyword \"张三\" --json` |\n| 查好友详情（按 wxid） | `wms contact get --wxid <wxid> --json` |\n| 查群（关键词模糊） | `wms room list --keyword \"运营\" --json` |\n| 查群详情 | `wms room get --wxid <roomId> --json` |\n| 给好友发文字 | `wms send contact --to <wxid> --text \"...\" --json` |\n| 给好友发图片 | `wms send contact --to <wxid> --image <url> --json` |\n| 给好友发卡片 | `wms send contact --to <wxid> --card-url <u> --card-title <t> --card-desc <d> --card-thumb <th> --json` |\n| 给群发消息 | `wms send room --to <roomId> --text \"...\" --json` |\n| **设群公告**（@所有人） | `wms send multi --target roomnotice --groups <roomId> --text \"...\" --json` |\n| 批量多目标多消息 | `wms send multi --target room --groups r1,r2 --messages-json '[...]' --json` |\n\n> 群公告说明：调用 `/chat/multi` 接口，`target=roomnotice`，messages **仅支持 type=1（文字）**。机器人需为群主或管理员才能成功发送。\n\n## 命令清单\n\n| 命令 | 作用 |\n|---|---|\n| `wms auth token <key>` / `logout` / `whoami` | 凭证管理 |\n| `wms auth list` / `wms auth use <name>` | 多 profile 切换 |\n| `wms contact list/get` | 好友查询 |\n| `wms room list/get` | 群查询 |\n| `wms send contact/room/multi` | 发送消息 |\n| `wms spec` | 输出 OpenAPI YAML |\n| `wms install-skill --platform <p>` | 安装 SKILL 到 AI Agent 平台 |\n\n完整 Agent 指南：[skill/SKILL.md](skill/SKILL.md)\n\n## 多 apiKey / 多账号\n\n支持任意多个 profile（每个 profile 一个 apiKey + host）。\n\n```bash\n# 同时配置两个账号\nwms auth token <dev-key>  --profile-name dev\nwms auth token <prod-key> --profile-name prod --host https://prod.example.com\n\n# 查看所有 profile（apiKey 自动遮罩；✓ 标默认）\nwms auth list\nwms auth list --json\n\n# 切换默认 profile（之后命令不用再带 --profile）\nwms auth use prod\nwms contact list --keyword \"张三\" --json     # 走 prod\n\n# 单条命令临时切换，不影响默认\nwms --profile dev contact list --keyword \"张三\" --json\n\n# 删除某个 profile（删默认时自动指向剩余其一）\nwms auth logout --profile-name dev\n```\n\n也支持环境变量临时覆盖，优先级 `flag > 环境变量 > 配置文件`：\n\n```bash\nWMS_API_KEY=<key> WMS_HOST=https://x.com wms contact list --json\n```\n\n## 全局选项\n\n- `--json` AI Agent 必加\n- `--dry-run` 打印请求不发送\n- `--profile <name>` 多环境\n- `--host <url>` 覆盖 baseURL\n- `--debug` 打印请求/响应\n\n## 退出码\n\n| 码 | 含义 |\n|---|---|\n| 0 | 成功 |\n| 1 | api / validation |\n| 2 | auth |\n| 3 | network |\n| 4 | timeout |\n| 5 | vip_required |\n\n## 开发\n\n```bash\npnpm install\nnpm test               # 全部测试\nnpm run test:e2e       # 仅 e2e\n```\n","readmeFilename":"README.zh-CN.md"}