@xiaojian-cli/wecom-cli 1.2.0-custom.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 WeCom
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,83 @@
1
+ # @xiaojian-cli/wecom-cli
2
+
3
+ > Unofficial npm build of [WecomTeam/wecom-cli](https://github.com/WecomTeam/wecom-cli) from the `wn0x00/wecom-cli` fork. The published native binaries are compiled with `--features custom-endpoint`, enabling `WECOM_CLI_BASE_URL`, `WECOM_CLI_AUTH_ENDPOINT`, and `WECOM_CLI_ACCESS_TOKEN`.
4
+
5
+ Install:
6
+
7
+ ```bash
8
+ npm install -g @xiaojian-cli/wecom-cli
9
+ ```
10
+
11
+ Example:
12
+
13
+ ```bash
14
+ export WECOM_CLI_BASE_URL=https://your-endpoint.example.com
15
+ wecom-cli --help
16
+ ```
17
+
18
+ ---
19
+
20
+ # wecom-cli
21
+
22
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
23
+ [![Rust](https://img.shields.io/badge/rust-%3E%3D1.75-orange.svg)](https://www.rust-lang.org/)
24
+
25
+ > 💬 扫码加入企业微信交流群:
26
+ >
27
+ > <img src="https://wwcdn.weixin.qq.com/node/wework/images/202603241759.3fb01c32cc.png" alt="扫码入群交流" width="200" />
28
+
29
+ 企业微信命令行工具,覆盖消息、邮件、文档、待办、日程、会议、微盘、通讯录等业务功能。支持机器人主动通知、新建与读取文档、文档搜索、新建与管理日程、预约与获取会议信息、新建与跟进待办、上传与获取微盘文件、发送与获取邮件、获取通讯录成员信息,以提升企业办公效率
30
+
31
+ ## 功能范围
32
+
33
+ 覆盖企业微信核心业务品类:
34
+
35
+ | 品类 | 能力 |
36
+ | ------------- | ----------------------------------------------------------------------- |
37
+ | 💬 消息 | 向机器人最近对话过的单聊/群聊主动推送消息,支持 Markdown/图片/文件/语音/视频消息 |
38
+ | 📧 邮件 | 邮件发送/回复/转发,邮件搜索,获取邮件内容详情 |
39
+ | 📄 文档 | 在线文档的新建、导入、读取、追加与覆盖写入 |
40
+ | 🗂️ 文档管理 | 多种文档类型的搜索,在线文档/在线表格/智能表格/智能文档的重命名、成员权限与加入规则管理 |
41
+ | 📊 在线表格 | 在线表格新建、CSV/Excel 导入、内容读改、追加行、子表管理 |
42
+ | 🧮 智能表格 | 智能表格创建,子表/字段/记录/视图/图表管理,行列样式修改 |
43
+ | 📰 智能文档 | 智能文档创建、获取页面内容、编辑文档内容、内置数据表信息获取 |
44
+ | ✅ 待办 | 创建/读取/更新/删除待办,分派参与人与完成待办等 |
45
+ | 📅 日程 | 日程增删改查、参与人管理、多成员闲忙查询、会议室查询预订等 |
46
+ | 🎥 会议 | 创建预约会议、取消会议、更新参会人、查询列表与详情、读取会议纪要与转写原文 |
47
+ | 💾 微盘 | 微盘文件的搜索、基础信息读取、上传、下载 |
48
+ | 👤 通讯录 | 按姓名/拼音/别名搜索成员,获取成员基本信息,以用于会议、日程等多人场景 |
49
+
50
+ ## 快速开始
51
+
52
+ ### 前置条件
53
+
54
+ - 支持平台:macOS (x64/arm64)、Linux (x64/arm64) 及 Windows (x64)
55
+ - Node.js `>= 18`
56
+ - 企业微信账号
57
+ - (可选)智能机器人 Bot ID 和 Secret,获取方式参考 [说明](https://open.work.weixin.qq.com/help2/pc/cat?doc_id=21677)
58
+
59
+ ### 安装 & 使用
60
+
61
+ ```bash
62
+ # 安装 CLI
63
+ npm install -g @wecom/cli
64
+
65
+ # 安装 CLI Skill(必需)
66
+ npx skills add WeComTeam/wecom-cli -y -g
67
+
68
+ # 配置凭证(交互式,仅需一次;默认扫码,--manual 可手动输入)
69
+ wecom-cli auth init
70
+
71
+ # 查看授权状态
72
+ wecom-cli auth show
73
+ ```
74
+
75
+ 📖 更多使用方法,请参阅 [CLI 命令参考](docs/cli-reference.md)。
76
+
77
+ ## Agent Skills
78
+
79
+ 🤖 支持的 Skills 使用说明,请参阅 [Skills 文档](docs/skills.md)。
80
+
81
+ ## 许可证
82
+
83
+ 本项目基于 [MIT 许可证](./LICENSE) 开源。
package/bin/wecom.js ADDED
@@ -0,0 +1,73 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { execFileSync } from 'node:child_process';
4
+ import { createRequire } from 'node:module';
5
+ import os from 'node:os';
6
+ import { join } from 'node:path';
7
+
8
+ const require = createRequire(import.meta.url);
9
+
10
+ /**
11
+ * Returns the platform-specific package name based on current OS and CPU architecture.
12
+ */
13
+ function getPlatformPackage() {
14
+ const platform = os.platform();
15
+ const arch = os.arch();
16
+
17
+ const platformMap = {
18
+ 'darwin-arm64': '@xiaojian-cli/wecom-cli-darwin-arm64',
19
+ 'darwin-x64': '@xiaojian-cli/wecom-cli-darwin-x64',
20
+ 'linux-arm64': '@xiaojian-cli/wecom-cli-linux-arm64',
21
+ 'linux-x64': '@xiaojian-cli/wecom-cli-linux-x64',
22
+ 'win32-x64': '@xiaojian-cli/wecom-cli-win32-x64',
23
+ };
24
+
25
+ const key = `${platform}-${arch}`;
26
+ const pkg = platformMap[key];
27
+
28
+ if (!pkg) {
29
+ console.error(
30
+ `Error: unsupported platform ${platform}-${arch}.\n` +
31
+ `Supported platforms: ${Object.keys(platformMap).join(', ')}`,
32
+ );
33
+ process.exit(1);
34
+ }
35
+
36
+ return pkg;
37
+ }
38
+
39
+ /**
40
+ * Resolves the path to the platform-specific binary.
41
+ */
42
+ function getBinaryPath() {
43
+ const pkg = getPlatformPackage();
44
+ const binaryName = os.platform() === 'win32' ? 'wecom-cli.exe' : 'wecom-cli';
45
+
46
+ try {
47
+ const pkgDir = require.resolve(`${pkg}/package.json`);
48
+ return join(pkgDir, '..', 'bin', binaryName);
49
+ } catch {
50
+ console.error(
51
+ `Error: cannot find @xiaojian-cli/wecom-cli binary.\n` +
52
+ `Please try reinstalling: npm install @xiaojian-cli/wecom-cli\n\n` +
53
+ `If the problem persists, check:\n` +
54
+ ` 1. Your npm config does not disable optional dependencies (--no-optional)\n` +
55
+ ` 2. Your platform (${os.platform()}-${os.arch()}) is supported`,
56
+ );
57
+ process.exit(1);
58
+ }
59
+ }
60
+
61
+ // Execute the binary, passing through all arguments
62
+ const binaryPath = getBinaryPath();
63
+
64
+ try {
65
+ execFileSync(binaryPath, process.argv.slice(2), {
66
+ stdio: 'inherit',
67
+ env: process.env,
68
+ });
69
+ } catch (error) {
70
+ if (error.status != null) {
71
+ process.exit(error.status);
72
+ }
73
+ }
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@xiaojian-cli/wecom-cli",
3
+ "version": "1.2.0-custom.1",
4
+ "description": "WeCom CLI build with custom-endpoint support enabled",
5
+ "keywords": [
6
+ "wecom-cli",
7
+ "wecom",
8
+ "custom-endpoint"
9
+ ],
10
+ "homepage": "https://github.com/wn0x00/wecom-cli#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/wn0x00/wecom-cli/issues"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/wn0x00/wecom-cli.git"
17
+ },
18
+ "license": "MIT",
19
+ "type": "module",
20
+ "bin": {
21
+ "wecom-cli": "bin/wecom.js"
22
+ },
23
+ "files": [
24
+ "bin",
25
+ "README.md",
26
+ "LICENSE"
27
+ ],
28
+ "optionalDependencies": {
29
+ "@xiaojian-cli/wecom-cli-darwin-arm64": "1.2.0-custom.1",
30
+ "@xiaojian-cli/wecom-cli-linux-x64": "1.2.0-custom.1"
31
+ },
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "engines": {
36
+ "node": ">=18"
37
+ }
38
+ }