Skip to content

feat: add Windows platform support (lightweight, seamless)#32

Closed
Slldyd2077 wants to merge 1 commit into
Wechat-ggGitHub:mainfrom
Slldyd2077:feat/windows-support
Closed

feat: add Windows platform support (lightweight, seamless)#32
Slldyd2077 wants to merge 1 commit into
Wechat-ggGitHub:mainfrom
Slldyd2077:feat/windows-support

Conversation

@Slldyd2077

Copy link
Copy Markdown
Contributor

概述

为 wechat-claude-code 添加 Windows (Git Bash) 支持,使用户可以在 Windows 上使用与 macOS/Linux 完全一致的命令管理 daemon。

改动内容

1. scripts/daemon.sh — 新增 Windows (MINGW/MSYS/CYGWIN) 分支

  • 新增 windows_startwindows_stopwindows_statuswindows_logs 四个函数
  • 使用 PID 文件 + nohup 后台运行(Git Bash 环境下均可用)
  • taskkill //F //PID 作为强制停止的兜底方案
  • 统一入口:所有平台均使用 npm run daemon -- {start|stop|status|logs}

2. src/wechat/send.ts — 修复 homedir() 兼容性

  • process.env.HOME 在 Windows 上为空,改用 homedir() from node:os

3. src/tools/visualize-logs.ts — 跨平台文件打开

  • macOS: open,Windows: cmd /c start,Linux: xdg-open

4. 文档更新

  • README.mdREADME_en.mdSKILL.md 前置条件更新为 macOS、Windows 或 Linux

设计特点

  • 轻量化:仅修改 6 个文件,新增约 110 行,不新增任何文件
  • 无缝衔接:统一入口 npm run daemon -- start,Windows 用户无需学习新命令
  • 零破坏:macOS/Linux 的所有逻辑完全未动,不影响现有用户

对比其他 Windows 支持方案

本 PR PR #24 (PowerShell) PR #26 (Node.js)
统一入口 ❌ 需用 daemon:ps
新增文件 0 1 (daemon.ps1) 1 (daemon.js)
改动量 ~130 行 ~120 行 ~500 行
源码 bug 修复
macOS/Linux 影响 替换 daemon 入口

测试

已在 Windows 11 (Git Bash/MINGW64) 上验证:

  • npm run build 编译通过
  • npm run daemon -- start 启动成功
  • npm run daemon -- status 状态检测正确
  • npm run daemon -- stop 停止成功
  • npm run daemon -- logs 日志输出正常

- Add MINGW/MSYS/CYGWIN branch to daemon.sh with PID file + nohup backend
- Fix send.ts: process.env.HOME -> homedir() for Windows compatibility
- Fix visualize-logs.ts: cross-platform file opening (cmd /c start / open / xdg-open)
- Update prerequisites in README.md, README_en.md, SKILL.md
@Slldyd2077 Slldyd2077 force-pushed the feat/windows-support branch from 596848d to bbf3c97 Compare June 12, 2026 07:30
@Slldyd2077 Slldyd2077 closed this Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant