@moodcc/wechat-opencode 0.1.3
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/README.md +82 -0
- package/bin/wechat-opencode-win32-x64.exe +0 -0
- package/install.js +7 -0
- package/package.json +29 -0
package/README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# wechat-opencode
|
|
2
|
+
|
|
3
|
+
通过微信与 [OpenCode](https://opencode.ai) 交互的 CLI 桥接工具。在微信里给机器人发消息,OpenCode 处理并回复。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
### 方式一:npm(推荐)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @moodcc/wechat-opencode
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
安装后全局可用 `wechat-opencode` 命令。
|
|
14
|
+
|
|
15
|
+
### 方式二:GitHub Release 下载
|
|
16
|
+
|
|
17
|
+
1. 打开 [Releases 页面](https://github.com/chenjin-go/wechat-opencode/releases)
|
|
18
|
+
2. 下载最新版 `.exe` 文件
|
|
19
|
+
3. 放到 `C:\Windows\System32\` 或任意 `%PATH%` 目录,或直接双击运行
|
|
20
|
+
|
|
21
|
+
### 方式三:源码运行
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
git clone https://github.com/chenjin-go/wechat-opencode.git
|
|
25
|
+
cd wechat-opencode
|
|
26
|
+
bun install
|
|
27
|
+
bun run src/index.ts start
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 快速开始
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# 1. 创建工作目录
|
|
34
|
+
mkdir wxo-work && cd wxo-work
|
|
35
|
+
|
|
36
|
+
# 2. 扫码登录(仅首次)
|
|
37
|
+
wechat-opencode login
|
|
38
|
+
|
|
39
|
+
# 3. 启动桥接
|
|
40
|
+
wechat-opencode start
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
> OpenCode 默认地址 `http://127.0.0.1:4096`,可通过 `--url` 指定:
|
|
44
|
+
> `wechat-opencode start --url http://192.168.1.100:4096`
|
|
45
|
+
|
|
46
|
+
成功后,向你的机器人微信账号发送消息,OpenCode 会自动处理并回复。
|
|
47
|
+
|
|
48
|
+
## CLI 命令
|
|
49
|
+
|
|
50
|
+
| 命令 | 功能 |
|
|
51
|
+
|------|------|
|
|
52
|
+
| `wechat-opencode start [--url <地址>]` | 启动桥接(可选指定 OpenCode 地址) |
|
|
53
|
+
| `wechat-opencode login` | 扫码登录 |
|
|
54
|
+
| `wechat-opencode --version` | 显示版本号 |
|
|
55
|
+
| `wechat-opencode help` | 帮助信息 |
|
|
56
|
+
|
|
57
|
+
## 微信命令
|
|
58
|
+
|
|
59
|
+
启动后,向机器人微信账号发送:
|
|
60
|
+
|
|
61
|
+
| 命令 | 功能 |
|
|
62
|
+
|------|------|
|
|
63
|
+
| `/help` | 帮助信息 |
|
|
64
|
+
| `/status` | 查看当前项目、会话、模型 |
|
|
65
|
+
| `/projects` | 列出项目,`/projects <序号>` 选择 |
|
|
66
|
+
| `/sessions` | 列出会话,`/sessions <序号>` 选择,`/sessions new` 新建 |
|
|
67
|
+
| `/model` | 列出模型,`/model <序号>` 选择 |
|
|
68
|
+
| `/new` | 快捷新建会话 |
|
|
69
|
+
| `/abort` | 中止当前 AI 任务 |
|
|
70
|
+
|
|
71
|
+
非命令消息自动发送给 OpenCode AI 处理。
|
|
72
|
+
|
|
73
|
+
## 技术栈
|
|
74
|
+
|
|
75
|
+
- **Bun** — TypeScript 运行时 + 打包器
|
|
76
|
+
- **TypeScript** — 语言
|
|
77
|
+
- **@opencode-ai/sdk** — OpenCode API
|
|
78
|
+
- **@wechatbot/wechatbot** — 微信 iLink Bot API
|
|
79
|
+
|
|
80
|
+
## 许可
|
|
81
|
+
|
|
82
|
+
MIT
|
|
Binary file
|
package/install.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { spawn } = require("child_process")
|
|
3
|
+
const path = require("path")
|
|
4
|
+
|
|
5
|
+
const binPath = path.join(__dirname, "bin", "wechat-opencode-win32-x64.exe")
|
|
6
|
+
const child = spawn(binPath, process.argv.slice(2), { stdio: "inherit" })
|
|
7
|
+
child.on("exit", (code) => process.exit(code ?? 1))
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@moodcc/wechat-opencode",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "微信与 OpenCode CLI 桥接工具",
|
|
5
|
+
"author": "moodcc",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "commonjs",
|
|
8
|
+
"bin": {
|
|
9
|
+
"wechat-opencode": "install.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"bin",
|
|
13
|
+
"install.js",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=18"
|
|
18
|
+
},
|
|
19
|
+
"os": [
|
|
20
|
+
"win32"
|
|
21
|
+
],
|
|
22
|
+
"cpu": [
|
|
23
|
+
"x64"
|
|
24
|
+
],
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/chenjin-go/wechat-opencode.git"
|
|
28
|
+
}
|
|
29
|
+
}
|