[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-1153":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":9,"pushedAt":9,"updatedAt":38,"readmeContent":39,"aiSummary":40,"trendingCount":15,"starSnapshotCount":15,"syncStatus":41,"lastSyncTime":42,"discoverSource":43},1153,"hermesclaw","AaronWong1999\u002Fhermesclaw","AaronWong1999","Run Hermes Agent and OpenClaw on the same WeChat account",null,"Python",604,51,1,3,0,14,38,180,42,9.15,"MIT License",false,"main",true,[26,27,28,29,30,31,32,33,34,35,36,37],"ai-agent","chatbot","clawbot","dual-agent","hermes-agent","ilink","llm-agent","openclaw","python","self-hosted","wechat","wechat-bot","2026-06-12 02:00:23","# HermesClaw\n\n**Run [Hermes Agent](https:\u002F\u002Fgithub.com\u002FNousResearch\u002Fhermes-agent), [OpenClaw](https:\u002F\u002Fgithub.com\u002Fopenclaw\u002Fopenclaw), and [OpenCode](https:\u002F\u002Fgithub.com\u002Fsst\u002Fopencode) on the same WeChat account. One command to install.**\n\n**在同一个微信账号上同时多开 [Hermes Agent](https:\u002F\u002Fgithub.com\u002FNousResearch\u002Fhermes-agent)、[OpenClaw](https:\u002F\u002Fgithub.com\u002Fopenclaw\u002Fopenclaw) 和 [OpenCode](https:\u002F\u002Fgithub.com\u002Fsst\u002Fopencode)。一条命令安装。**\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fx.com\u002FAaronYonW\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FX-%40AaronYonW-000000.svg\" alt=\"X \u002F Twitter\">\u003C\u002Fa>\n  \u003Ca href=\"LICENSE\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-green.svg\" alt=\"MIT License\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002FHermesClaw.jpeg\" alt=\"HermesClaw — One WeChat bot. Two AI brains. \u002Fhermes, \u002Fopenclaw, \u002Fboth.\" style=\"max-width: 100%;\" \u002F>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Cem>One iLink account. Three AI brains. Switch with \u003Ccode>\u002Fhermes\u003C\u002Fcode>, \u003Ccode>\u002Fopenclaw\u003C\u002Fcode>, \u003Ccode>\u002Fopencode\u003C\u002Fcode>, \u003Ccode>\u002Fboth\u003C\u002Fcode>, \u003Ccode>\u002Fthree\u003C\u002Fcode>.\u003C\u002Fem>\u003Cbr\u002F>\n  \u003Cem>一个 iLink 账号，三个 AI 大脑。\u003Ccode>\u002Fhermes\u003C\u002Fcode>、\u003Ccode>\u002Fopenclaw\u003C\u002Fcode>、\u003Ccode>\u002Fopencode\u003C\u002Fcode>、\u003Ccode>\u002Fboth\u003C\u002Fcode>、\u003Ccode>\u002Fthree\u003C\u002Fcode> 一句话切换。\u003C\u002Fem>\n\u003C\u002Fp>\n\n---\n\n## Why HermesClaw\n\nBoth Hermes Agent and OpenClaw now support WeChat natively — **but you can't run both on the same account.** Each gateway exclusively locks the iLink connection. If you start both, one gets 403 errors and drops messages. OpenCode adds a third AI brain via its ACP subprocess protocol.\n\nHermesClaw solves this by becoming the **sole iLink poller**, then running two local proxy servers (for Hermes and OpenClaw) plus a direct ACP bridge (for OpenCode). Each gateway believes it's talking to the real iLink API.\n\nThe new OpenCode support also lets you **Vibe Code via WeChat voice messages** — just speak and OpenCode handles it, backed by four free models including MiniMax M2.5 Free. You can also use it alongside the other two agents to complement each other — fixing their issues, tracing bugs, or inspecting the local environment.\n\n现在 Hermes 和 OpenClaw 都原生支持微信了——**但你不能在同一个账号上双开。** 每个 Gateway 会独占 iLink 连接。HermesClaw 解决这个问题：它作为唯一的 iLink 轮询者，运行两个本地代理，让两个 Gateway 各连各的。\n\n新版还增加了 OpenCode 支持，现在你可以用微信语音直接进行 **Vibe Coding** 了，调用的就是 OpenCode 中包含 MiniMax M2.5 Free 在内的四个免费模型。你也可以用它和另外两个 Agent 互相补充使用，比如帮它们修问题、查 bug、看本机环境。\n\n---\n\n## Special Thanks\n\nSpecial thanks to the [Hermes Agent](https:\u002F\u002Fgithub.com\u002FNousResearch\u002Fhermes-agent) team at Nous Research for recognizing and recommending **HermesClaw** in the `Community` section of their official GitHub README.\n\n特别感谢 Nous Research 的 [Hermes Agent](https:\u002F\u002Fgithub.com\u002FNousResearch\u002Fhermes-agent) 团队，在其 GitHub 官方 README 的 `Community` 区收录并推荐 **HermesClaw**。\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Fhermes-agent-community-recognition.png\" alt=\"Hermes Agent README Community section highlighting HermesClaw\" style=\"max-width: 100%;\" \u002F>\n\u003C\u002Fp>\n\n> Official reference:\n> [Hermes Agent README - Community](https:\u002F\u002Fgithub.com\u002FNousResearch\u002Fhermes-agent)\n\n---\n\n## Before \u002F After\n\n| | Without HermesClaw | With HermesClaw |\n|---|---|---|\n| Hermes on WeChat | ✅ Works (native gateway) | ✅ Works |\n| OpenClaw on WeChat | ✅ Works (clawbot) | ✅ Works |\n| OpenCode on WeChat | ❌ No WeChat support | ✅ via ACP bridge |\n| Both on same account | ❌ Token conflict \u002F 403 | ✅ `\u002Fboth` mode |\n| All three on same account | ❌ Impossible | ✅ `\u002Fthree` mode |\n| Voice messages | ✅ Each handles natively | ✅ Transcription forwarded |\n| Images \u002F video \u002F files | ✅ Each handles natively | ✅ Raw iLink msg forwarded |\n| Switching agents | — | `\u002Fhermes`, `\u002Fopenclaw`, `\u002Fopencode`, `\u002Fboth`, `\u002Fthree` |\n\n---\n\n## Architecture\n\n```\n                    ┌────────── iLink API ──────────┐\n                    │  ilinkai.weixin.qq.com        │\n                    └──────────┬────────────────────┘\n                               │\n                      (sole poller \u002F token owner)\n                               │\n                    ┌──────────▼────────────────────┐\n                    │     HermesClaw v3              │\n                    │  routes by \u002Fhermes \u002Fopenclaw   │\n                    │          \u002Fopencode \u002Fthree      │\n                    │  queues raw iLink messages     │\n                    ├────────┬──────────┬────────────┤\n                    │        │          │\n              Proxy A      Proxy B    ACP Bridge\n              (:19999)     (:19998)   (subprocess)\n              openclaw     hermes     opencode acp\n                    │        │          │\n                    ▼        ▼          ▼\n              ┌──────────┐ ┌──────────┐ ┌──────────┐\n              │ openclaw │ │ hermes   │ │ opencode │\n              │ gateway  │ │ gateway  │ │ process  │\n              └────┬─────┘ └────┬─────┘ └────┬─────┘\n                   │            │             │\n              sendmessage  sendmessage   send_text_ilink\n                   └─────┬──────┘            │\n                         │ (proxy forwards)  │\n                         └──────────────────►┘\n                                to iLink\n```\n\nHermesClaw is a thin Python proxy (~500 lines). It does **not** process media, call agent APIs, or touch agent memory. It just queues and forwards raw iLink protocol messages. Each gateway handles its own media decryption, markdown formatting, and AI interaction natively.\n\nHermesClaw 只是一个轻量转发代理（~500 行），不处理媒体、不调 Agent API、不动记忆。每个 Gateway 原生处理自己的媒体解密和 AI 交互。\n\n---\n\n## Prerequisites\n\nBefore installing HermesClaw, you need **at least one** of:\n\n1. **OpenClaw + clawbot** (`openclaw-weixin`) — installed and logged into WeChat\n2. **Hermes Agent + WeChat gateway** — installed with `hermes gateway` configured\n\nBoth installed = full dual-open. One installed = single-agent mode with the option to add the other later.\n\n安装 HermesClaw 前，需要至少安装以下其中一个：OpenClaw 的 clawbot，或者 Hermes 的微信 Gateway。\n\n---\n\n## Quick Install\n\n```bash\ncurl -fsSL https:\u002F\u002Fraw.githubusercontent.com\u002FAaronWong1999\u002Fhermesclaw\u002Fmain\u002Finstall.sh | bash\n```\n\nFor **non-interactive \u002F automated** installs (skips all confirmation prompts):\n\n```bash\ncurl -fsSL https:\u002F\u002Fraw.githubusercontent.com\u002FAaronWong1999\u002Fhermesclaw\u002Fmain\u002Finstall.sh | HERMESCLAW_YES=1 bash\n# or, when running the script directly:\nbash install.sh -y\n```\n\nThe installer will:\n1. Detect which gateways are installed and configured\n2. Extract the iLink token from gateway account files\n3. Patch openclaw-weixin `baseUrl` → `http:\u002F\u002F127.0.0.1:19999` (proxy A)\n4. Patch Hermes `WEIXIN_BASE_URL` → `http:\u002F\u002F127.0.0.1:19998` (proxy B)\n5. Detect OpenCode CLI (optional — enables `\u002Fopencode` and `\u002Fthree`)\n6. Install Python deps (`requests`, `python-dotenv`)\n7. Create OpenClaw media symlink (workaround for media path mismatch)\n8. Set up the `hermesclaw` systemd service\n\nAfter install, restart your gateways and send `\u002Fwhoami` in WeChat.\n\n### AI-assisted install\n\nDrop this into any AI agent on the target machine:\n\n```text\nRun: curl -fsSL https:\u002F\u002Fraw.githubusercontent.com\u002FAaronWong1999\u002Fhermesclaw\u002Fmain\u002Finstall.sh | bash\n\nThen read README.md and install.sh from the installed HermesClaw directory.\nDetect whether Hermes Agent, OpenClaw, their WeChat gateways, python3, pip3,\nand systemd are present.  At least one gateway must be configured.  Extract\nthe iLink token from the first available gateway account file.  Patch\nopenclaw-weixin baseUrl to http:\u002F\u002F127.0.0.1:19999 and Hermes WEIXIN_BASE_URL\nto http:\u002F\u002F127.0.0.1:19998.  Install dependencies and systemd service.\n\nAlso detect OpenCode CLI: run `command -v opencode` or check\n~\u002F.npm-global\u002Fbin\u002Fopencode.  If not found, suggest installing with:\n  npm install -g opencode-ai\nSet OPENCODE_CMD in .env to the detected path (or empty if not found).\nOPENCODE_MODEL defaults to opencode\u002Fminimax-m2.5-free (free, no API key needed).\n\nIf Hermes Agent WeChat gateway is detected, the installer will offer to patch\nweixin.py to disable newline-based message splitting (recommended).  Accept\nthis patch so long replies are sent as single messages instead of being split\nby paragraphs.  The fix script is at fix_hermes_splitting.sh.\n\nRestart gateways.  Verify \u002Fwhoami works in WeChat.\n```\n\n---\n\n## Commands\n\n| Command | Action |\n|---------|--------|\n| `\u002Fhermes` | Route to **Hermes** only |\n| `\u002Fopenclaw` | Route to **OpenClaw** only |\n| `\u002Fopencode` | Route to **OpenCode** only (via ACP bridge) |\n| `\u002Fboth` | Route to **Hermes + OpenClaw** (reply from both) |\n| `\u002Fthree` | Route to **all three** (reply from all) |\n| `\u002Fwhoami` | Show current route and status |\n| anything else | Forward to the active agent(s) |\n\nDefault route is **Hermes**. In `\u002Fboth` and `\u002Fthree` modes, proxy replies are prefixed with `[Hermes Agent]` \u002F `[OpenClaw]` \u002F `[OpenCode]` for attribution.\n\n### OpenCode setup\n\nOpenCode connects via its native ACP subprocess protocol — no proxy port needed. Install it first:\n\n```bash\nnpm install -g opencode-ai\n```\n\nThen set `OPENCODE_CMD` in `.env` (the installer auto-detects it). Use `\u002Fopencode` or `\u002Fthree` once OpenCode is installed.\n\n---\n\n## Project layout\n\n```text\nhermesclaw.py             # ~870 lines. Triple-proxy router + ACP bridge.\ninstall.sh                # Smart auto-detecting installer (-y for non-interactive).\nfix_hermes_splitting.sh   # Patch Hermes weixin.py (optional, recommended).\ntests\u002F                    # 82 pytest tests (core, proxy, ACP, recovery).\nREADME.md\nLICENSE\ndocs\u002F                     # Screenshots and media.\n```\n\n---\n\n## Media handling\n\nHermesClaw forwards **raw iLink protocol messages** to each gateway. This means:\n\n- **Text** — forwarded as-is\n- **Voice** — iLink includes a transcription; HermesClaw forwards the transcription text\n- **Images \u002F video \u002F files** — the raw iLink message (with CDN URLs and AES keys) is forwarded; each gateway downloads and decrypts natively\n\nHermesClaw does **not** do AES decryption, CDN downloads, or media re-encoding. That's each gateway's job.\n\n---\n\n## Uninstall\n\n### AI-assisted\n\n```text\nStop and disable the hermesclaw systemd service.  Restore openclaw-weixin\naccount .bak files.  Remove WEIXIN_BASE_URL override from ~\u002F.hermes\u002F.env\n(or restore .bak).  Optionally remove ~\u002Fhermesclaw directory.\n```\n\n### Manual\n\n```bash\nsudo systemctl stop hermesclaw\nsudo systemctl disable hermesclaw\nsudo rm -f \u002Fetc\u002Fsystemd\u002Fsystem\u002Fhermesclaw.service\nsudo systemctl daemon-reload\n\n# Restore openclaw-weixin configs:\nfind \"$HOME\" -maxdepth 5 -name \"*.json.bak\" -path \"*\u002Fopenclaw-weixin\u002Faccounts\u002F*\" \\\n  -exec sh -c 'for f; do cp \"$f\" \"${f%.bak}\"; done' sh {} +\n\n# Restore Hermes .env:\n[ -f \"$HOME\u002F.hermes\u002F.env.bak\" ] && cp \"$HOME\u002F.hermes\u002F.env.bak\" \"$HOME\u002F.hermes\u002F.env\"\n\nrm -rf \"$HOME\u002Fhermesclaw\"\n```\n\n---\n\n## Star History\n\n\u003Ca href=\"https:\u002F\u002Fwww.star-history.com\u002F#AaronWong1999\u002Fhermesclaw&Date\">\n  \u003Cimg src=\"https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=AaronWong1999\u002Fhermesclaw&type=Date\" alt=\"Star History Chart\" width=\"600\">\n\u003C\u002Fa>\n\n---\n\n## Changelog\n\n### v0.3.6\n\n- **Fix: macOS install failure — `mapfile: command not found`** — macOS ships with bash 3.2 which lacks the `mapfile` builtin (added in bash 4). All 3 occurrences replaced with portable `while IFS= read -r` loops, making the installer work on macOS out of the box.\n- **Fix: `curl | bash` silent abort** — With `set -euo pipefail`, bare `read` calls returned non-zero on EOF when stdin was a pipe, causing the installer to exit before any `${REPLY:-Y}` default was evaluated. The installer now detects a non-tty stdin and redirects interactive prompts to `\u002Fdev\u002Ftty` so users can still answer them; if `\u002Fdev\u002Ftty` is also unavailable (CI \u002F Docker) it falls back to auto-yes. All three prompt calls also have `|| VAR=\"\"` guards as defence-in-depth.\n- **5 new regression tests** — `tests\u002Ftest_install_sh.py` covers mapfile absence, bash syntax, read guards, tty detection, and non-interactive stdin.\n- Thanks to [@ShxxxNewBee](https:\u002F\u002Fgithub.com\u002FShxxxNewBee), [@siasbaily](https:\u002F\u002Fgithub.com\u002Fsiasbaily), and [@csloz](https:\u002F\u002Fgithub.com\u002Fcsloz) for reporting and diagnosing these issues 🙏\n\n### v0.3.0\n\n- **OpenCode ACP bridge** — New `OpenCodeBridge` + `ACPSession` classes implement JSON-RPC 2.0 over NDJSON for `opencode acp` subprocess. Per-user sessions with automatic reconnect.\n- **`\u002Fopencode` command** — Route messages to OpenCode only.\n- **`\u002Fthree` command** — Route messages to all three agents simultaneously (Hermes + OpenClaw + OpenCode).\n- **\"Not installed\" detection** — If `opencode` binary is not found, `\u002Fopencode` and `\u002Fthree` show a helpful install hint instead of crashing.\n- **Tagging in THREE mode** — Proxy tags Hermes\u002FOpenClaw replies; OpenCode worker tags its own replies with `[OpenCode]`.\n- **Dead subprocess recovery** — If OpenCode exits mid-session, pending prompts unblock immediately with an error instead of hanging for the full 120 s timeout.\n- **Headless ACP permissions** — OpenCode permission prompts are handled automatically with `OPENCODE_PERMISSION_STRATEGY=allow_always`, preventing WeChat replies from hanging on non-interactive tool approvals. The OpenCode global config (`~\u002F.config\u002Fopencode\u002Fopencode.json`) is also set to `\"permission\": \"allow\"` by the installer so tool calls are approved at the OpenCode level without round-tripping through ACP.\n- **OpenCode typing indicator** — OpenCode mode now sends and keeps alive the WeChat typing indicator while the ACP agent is working.\n- **Non-interactive installer** — `bash install.sh -y` (or `HERMESCLAW_YES=1 bash install.sh`) skips all confirmation prompts; OpenCode appears in the discovery summary.\n- **Installer git pull** — Re-running install.sh on an existing install now pulls the latest code before continuing.\n- **117 tests** — Expanded route matrix covers every command route across text, voice, image, video, and file payloads, plus ACP permissions, OpenCode media prompts, dead-subprocess recovery, and THREE mode.\n\n### v0.2.1 (2026-04-12)\n\n- **Fix: Hermes message splitting** — The installer now offers to patch Hermes Agent's `weixin.py` to disable newline-based message splitting during installation (recommended, default Yes). This ensures long replies are sent as single messages instead of being split by paragraphs. Existing users can run `bash fix_hermes_splitting.sh` manually.\n\n### v0.2.0\n\n- **Complete rewrite**: dual-proxy gateway architecture.\n- Removed ~400 lines of AES\u002FCDN media processing.\n- 59 pytest tests (core, proxy, recovery).\n- Smart 8-case detection installer.\n- **Fix: Hermes \"Response formatting failed\"** — Proxy servers now use `ThreadingHTTPServer` instead of single-threaded `HTTPServer`.\n- **Fix: OpenClaw ENOENT on media files** — Installer now creates symlink for media path mismatch.\n- **Improved error handling** — `BrokenPipeError` now caught and logged as DEBUG.\n\n---\n\n## License\n\n[MIT](LICENSE) — by [@AaronWong1999](https:\u002F\u002Fgithub.com\u002FAaronWong1999) · [X @AaronYonW](https:\u002F\u002Fx.com\u002FAaronYonW)\n\n---\n\n## Credits\n\n- [NousResearch\u002Fhermes-agent](https:\u002F\u002Fgithub.com\u002FNousResearch\u002Fhermes-agent) — the agent that grows with you.\n- [openclaw\u002Fopenclaw](https:\u002F\u002Fgithub.com\u002Fopenclaw\u002Fopenclaw) — your own personal AI assistant. The lobster way. 🦞\n- The Clawbot \u002F openclaw-weixin maintainers for the iLink WeChat bridge.\n\nHermesClaw is a community bridge. It is not affiliated with NousResearch or OpenClaw.\n","HermesClaw 是一个允许在同一个微信账号上同时运行 Hermes Agent、OpenClaw 和 OpenCode 的项目。它通过作为唯一的 iLink 轮询者，并运行两个本地代理服务器（分别用于 Hermes 和 OpenClaw）以及一个直接的 ACP 桥接（用于 OpenCode），解决了多个 AI 代理在同一账号上无法共存的问题。此外，HermesClaw 支持通过微信语音消息进行 Vibe Coding，利用 OpenCode 中包含的 MiniMax M2.5 Free 等四个免费模型。这个项目适用于需要在一个微信账号内灵活切换和使用多个 AI 代理的场景，特别适合开发者和技术爱好者。",2,"2026-06-11 02:41:59","CREATED_QUERY"]