中文 / English 对照项目说明(Bilingual Project Introduction)
中文: NeoClaw Weixin Plugin 是一个将微信能力接入 NeoClaw Gateway 架构的适配项目。它通过原生网关方式(非 OpenClaw plugin-sdk 依赖)提供登录、轮询同步、消息收发和状态持久化能力。
English: NeoClaw Weixin Plugin integrates Weixin capabilities into the NeoClaw Gateway architecture. It uses a native gateway approach (without OpenClaw plugin-sdk coupling) to provide login, polling sync, message send/receive, and state persistence.
| 中文功能 | English Feature |
|---|---|
| 原生 Weixin Gateway 接入 | Native Weixin Gateway integration |
| 二维码登录流程(CLI 触发) | QR-code login flow (CLI driven) |
| 轮询消息同步与去重/防抖处理 | Polling-based sync with dedup/debounce |
标准化入站消息到 InboundMessage |
Normalize inbound events into InboundMessage |
统一状态目录 ~/.neoclaw/weixin/ |
Unified state dir ~/.neoclaw/weixin/ |
| CLI 管理命令(init/login/status/logout) | CLI management commands (init/login/status/logout) |
# 初始化微信配置模板 | Initialize Weixin config
neoclaw weixin init
# 二维码登录并写入 token | QR login and persist token
neoclaw weixin login
# 查看账号状态与同步游标 | Check account status and sync cursor
neoclaw weixin status
# 清理本地凭证 | Clear local credentials
neoclaw weixin logoutsrc/
gateway/
weixin/
gateway.ts # 网关主适配器 | gateway adapter
client.ts # 协议请求与状态管理 | protocol client + state
types.ts # 类型定义 | type definitions
cli/
commands/
weixin.ts # CLI 子命令 | CLI subcommands
中文:
- 安装依赖:
bun install - 初始化配置:
neoclaw weixin init - 修改配置中的
apiBaseUrl/accountId - 执行登录:
neoclaw weixin login - 启动服务:
neoclaw start
English:
- Install dependencies:
bun install - Initialize config:
neoclaw weixin init - Update
apiBaseUrl/accountIdin config - Run login:
neoclaw weixin login - Start daemon:
neoclaw start
中文:
- 若登录失败,请先检查
weixin.apiBaseUrl对应服务是否可达。 - 状态文件只写入
~/.neoclaw/weixin/,避免与~/.openclaw双栈冲突。
English:
- If login fails, verify that
weixin.apiBaseUrlis reachable. - State is persisted only under
~/.neoclaw/weixin/to avoid dual-stack drift with~/.openclaw.
{ "weixin": { "enabled": true, "accountId": "YOUR_WEIXIN_ACCOUNT_ID", "routeTag": "default", "pollInterval": 3000, "apiBaseUrl": "http://127.0.0.1:17888", "stateDir": "~/.neoclaw/weixin" } }