Skip to content

AaronWong1999/hermesclaw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

32 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

HermesClaw

Run Hermes Agent, OpenClaw, and OpenCode on the same WeChat account. One command to install.

ๅœจๅŒไธ€ไธชๅพฎไฟก่ดฆๅทไธŠๅŒๆ—ถๅคšๅผ€ Hermes Agentใ€OpenClaw ๅ’Œ OpenCodeใ€‚ไธ€ๆกๅ‘ฝไปคๅฎ‰่ฃ…ใ€‚

X / Twitter MIT License

HermesClaw โ€” One WeChat bot. Two AI brains. /hermes, /openclaw, /both.

One iLink account. Three AI brains. Switch with /hermes, /openclaw, /opencode, /both, /three.
ไธ€ไธช iLink ่ดฆๅท๏ผŒไธ‰ไธช AI ๅคง่„‘ใ€‚/hermesใ€/openclawใ€/opencodeใ€/bothใ€/three ไธ€ๅฅ่ฏๅˆ‡ๆขใ€‚


Why HermesClaw

Both 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.

HermesClaw 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.

The 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.

็Žฐๅœจ Hermes ๅ’Œ OpenClaw ้ƒฝๅŽŸ็”Ÿๆ”ฏๆŒๅพฎไฟกไบ†โ€”โ€”ไฝ†ไฝ ไธ่ƒฝๅœจๅŒไธ€ไธช่ดฆๅทไธŠๅŒๅผ€ใ€‚ ๆฏไธช Gateway ไผš็‹ฌๅ  iLink ่ฟžๆŽฅใ€‚HermesClaw ่งฃๅ†ณ่ฟ™ไธช้—ฎ้ข˜๏ผšๅฎƒไฝœไธบๅ”ฏไธ€็š„ iLink ่ฝฎ่ฏข่€…๏ผŒ่ฟ่กŒไธคไธชๆœฌๅœฐไปฃ็†๏ผŒ่ฎฉไธคไธช Gateway ๅ„่ฟžๅ„็š„ใ€‚

ๆ–ฐ็‰ˆ่ฟ˜ๅขžๅŠ ไบ† OpenCode ๆ”ฏๆŒ๏ผŒ็Žฐๅœจไฝ ๅฏไปฅ็”จๅพฎไฟก่ฏญ้Ÿณ็›ดๆŽฅ่ฟ›่กŒ Vibe Coding ไบ†๏ผŒ่ฐƒ็”จ็š„ๅฐฑๆ˜ฏ OpenCode ไธญๅŒ…ๅซ MiniMax M2.5 Free ๅœจๅ†…็š„ๅ››ไธชๅ…่ดนๆจกๅž‹ใ€‚ไฝ ไนŸๅฏไปฅ็”จๅฎƒๅ’Œๅฆๅค–ไธคไธช Agent ไบ’็›ธ่กฅๅ……ไฝฟ็”จ๏ผŒๆฏ”ๅฆ‚ๅธฎๅฎƒไปฌไฟฎ้—ฎ้ข˜ใ€ๆŸฅ bugใ€็œ‹ๆœฌๆœบ็Žฏๅขƒใ€‚


Special Thanks

Special thanks to the Hermes Agent team at Nous Research for recognizing and recommending HermesClaw in the Community section of their official GitHub README.

็‰นๅˆซๆ„Ÿ่ฐข Nous Research ็š„ Hermes Agent ๅ›ข้˜Ÿ๏ผŒๅœจๅ…ถ GitHub ๅฎ˜ๆ–น README ็š„ Community ๅŒบๆ”ถๅฝ•ๅนถๆŽจ่ HermesClawใ€‚

Hermes Agent README Community section highlighting HermesClaw

Official reference: Hermes Agent README - Community


Before / After

Without HermesClaw With HermesClaw
Hermes on WeChat โœ… Works (native gateway) โœ… Works
OpenClaw on WeChat โœ… Works (clawbot) โœ… Works
OpenCode on WeChat โŒ No WeChat support โœ… via ACP bridge
Both on same account โŒ Token conflict / 403 โœ… /both mode
All three on same account โŒ Impossible โœ… /three mode
Voice messages โœ… Each handles natively โœ… Transcription forwarded
Images / video / files โœ… Each handles natively โœ… Raw iLink msg forwarded
Switching agents โ€” /hermes, /openclaw, /opencode, /both, /three

Architecture

                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ iLink API โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚  ilinkai.weixin.qq.com        โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ”‚
                      (sole poller / token owner)
                               โ”‚
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚     HermesClaw v3              โ”‚
                    โ”‚  routes by /hermes /openclaw   โ”‚
                    โ”‚          /opencode /three      โ”‚
                    โ”‚  queues raw iLink messages     โ”‚
                    โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
                    โ”‚        โ”‚          โ”‚
              Proxy A      Proxy B    ACP Bridge
              (:19999)     (:19998)   (subprocess)
              openclaw     hermes     opencode acp
                    โ”‚        โ”‚          โ”‚
                    โ–ผ        โ–ผ          โ–ผ
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚ openclaw โ”‚ โ”‚ hermes   โ”‚ โ”‚ opencode โ”‚
              โ”‚ gateway  โ”‚ โ”‚ gateway  โ”‚ โ”‚ process  โ”‚
              โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜
                   โ”‚            โ”‚             โ”‚
              sendmessage  sendmessage   send_text_ilink
                   โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚
                         โ”‚ (proxy forwards)  โ”‚
                         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”˜
                                to iLink

HermesClaw 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.

HermesClaw ๅชๆ˜ฏไธ€ไธช่ฝป้‡่ฝฌๅ‘ไปฃ็†๏ผˆ~500 ่กŒ๏ผ‰๏ผŒไธๅค„็†ๅช’ไฝ“ใ€ไธ่ฐƒ Agent APIใ€ไธๅŠจ่ฎฐๅฟ†ใ€‚ๆฏไธช Gateway ๅŽŸ็”Ÿๅค„็†่‡ชๅทฑ็š„ๅช’ไฝ“่งฃๅฏ†ๅ’Œ AI ไบคไบ’ใ€‚


Prerequisites

Before installing HermesClaw, you need at least one of:

  1. OpenClaw + clawbot (openclaw-weixin) โ€” installed and logged into WeChat
  2. Hermes Agent + WeChat gateway โ€” installed with hermes gateway configured

Both installed = full dual-open. One installed = single-agent mode with the option to add the other later.

ๅฎ‰่ฃ… HermesClaw ๅ‰๏ผŒ้œ€่ฆ่‡ณๅฐ‘ๅฎ‰่ฃ…ไปฅไธ‹ๅ…ถไธญไธ€ไธช๏ผšOpenClaw ็š„ clawbot๏ผŒๆˆ–่€… Hermes ็š„ๅพฎไฟก Gatewayใ€‚


Quick Install

curl -fsSL https://raw.githubusercontent.com/AaronWong1999/hermesclaw/main/install.sh | bash

For non-interactive / automated installs (skips all confirmation prompts):

curl -fsSL https://raw.githubusercontent.com/AaronWong1999/hermesclaw/main/install.sh | HERMESCLAW_YES=1 bash
# or, when running the script directly:
bash install.sh -y

The installer will:

  1. Detect which gateways are installed and configured
  2. Extract the iLink token from gateway account files
  3. Patch openclaw-weixin baseUrl โ†’ http://127.0.0.1:19999 (proxy A)
  4. Patch Hermes WEIXIN_BASE_URL โ†’ http://127.0.0.1:19998 (proxy B)
  5. Detect OpenCode CLI (optional โ€” enables /opencode and /three)
  6. Install Python deps (requests, python-dotenv)
  7. Create OpenClaw media symlink (workaround for media path mismatch)
  8. Set up the hermesclaw systemd service

After install, restart your gateways and send /whoami in WeChat.

AI-assisted install

Drop this into any AI agent on the target machine:

Run: curl -fsSL https://raw.githubusercontent.com/AaronWong1999/hermesclaw/main/install.sh | bash

Then read README.md and install.sh from the installed HermesClaw directory.
Detect whether Hermes Agent, OpenClaw, their WeChat gateways, python3, pip3,
and systemd are present.  At least one gateway must be configured.  Extract
the iLink token from the first available gateway account file.  Patch
openclaw-weixin baseUrl to http://127.0.0.1:19999 and Hermes WEIXIN_BASE_URL
to http://127.0.0.1:19998.  Install dependencies and systemd service.

Also detect OpenCode CLI: run `command -v opencode` or check
~/.npm-global/bin/opencode.  If not found, suggest installing with:
  npm install -g opencode-ai
Set OPENCODE_CMD in .env to the detected path (or empty if not found).
OPENCODE_MODEL defaults to opencode/minimax-m2.5-free (free, no API key needed).

If Hermes Agent WeChat gateway is detected, the installer will offer to patch
weixin.py to disable newline-based message splitting (recommended).  Accept
this patch so long replies are sent as single messages instead of being split
by paragraphs.  The fix script is at fix_hermes_splitting.sh.

Restart gateways.  Verify /whoami works in WeChat.

Commands

Command Action
/hermes Route to Hermes only
/openclaw Route to OpenClaw only
/opencode Route to OpenCode only (via ACP bridge)
/both Route to Hermes + OpenClaw (reply from both)
/three Route to all three (reply from all)
/whoami Show current route and status
anything else Forward to the active agent(s)

Default route is Hermes. In /both and /three modes, proxy replies are prefixed with [Hermes Agent] / [OpenClaw] / [OpenCode] for attribution.

OpenCode setup

OpenCode connects via its native ACP subprocess protocol โ€” no proxy port needed. Install it first:

npm install -g opencode-ai

Then set OPENCODE_CMD in .env (the installer auto-detects it). Use /opencode or /three once OpenCode is installed.


Project layout

hermesclaw.py             # ~870 lines. Triple-proxy router + ACP bridge.
install.sh                # Smart auto-detecting installer (-y for non-interactive).
fix_hermes_splitting.sh   # Patch Hermes weixin.py (optional, recommended).
tests/                    # 82 pytest tests (core, proxy, ACP, recovery).
README.md
LICENSE
docs/                     # Screenshots and media.

Media handling

HermesClaw forwards raw iLink protocol messages to each gateway. This means:

  • Text โ€” forwarded as-is
  • Voice โ€” iLink includes a transcription; HermesClaw forwards the transcription text
  • Images / video / files โ€” the raw iLink message (with CDN URLs and AES keys) is forwarded; each gateway downloads and decrypts natively

HermesClaw does not do AES decryption, CDN downloads, or media re-encoding. That's each gateway's job.


Uninstall

AI-assisted

Stop and disable the hermesclaw systemd service.  Restore openclaw-weixin
account .bak files.  Remove WEIXIN_BASE_URL override from ~/.hermes/.env
(or restore .bak).  Optionally remove ~/hermesclaw directory.

Manual

sudo systemctl stop hermesclaw
sudo systemctl disable hermesclaw
sudo rm -f /etc/systemd/system/hermesclaw.service
sudo systemctl daemon-reload

# Restore openclaw-weixin configs:
find "$HOME" -maxdepth 5 -name "*.json.bak" -path "*/openclaw-weixin/accounts/*" \
  -exec sh -c 'for f; do cp "$f" "${f%.bak}"; done' sh {} +

# Restore Hermes .env:
[ -f "$HOME/.hermes/.env.bak" ] && cp "$HOME/.hermes/.env.bak" "$HOME/.hermes/.env"

rm -rf "$HOME/hermesclaw"

Star History

Star History Chart

Changelog

v0.3.6

  • 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.
  • 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 /dev/tty so users can still answer them; if /dev/tty is also unavailable (CI / Docker) it falls back to auto-yes. All three prompt calls also have || VAR="" guards as defence-in-depth.
  • 5 new regression tests โ€” tests/test_install_sh.py covers mapfile absence, bash syntax, read guards, tty detection, and non-interactive stdin.
  • Thanks to @ShxxxNewBee, @siasbaily, and @csloz for reporting and diagnosing these issues ๐Ÿ™

v0.3.0

  • OpenCode ACP bridge โ€” New OpenCodeBridge + ACPSession classes implement JSON-RPC 2.0 over NDJSON for opencode acp subprocess. Per-user sessions with automatic reconnect.
  • /opencode command โ€” Route messages to OpenCode only.
  • /three command โ€” Route messages to all three agents simultaneously (Hermes + OpenClaw + OpenCode).
  • "Not installed" detection โ€” If opencode binary is not found, /opencode and /three show a helpful install hint instead of crashing.
  • Tagging in THREE mode โ€” Proxy tags Hermes/OpenClaw replies; OpenCode worker tags its own replies with [OpenCode].
  • Dead subprocess recovery โ€” If OpenCode exits mid-session, pending prompts unblock immediately with an error instead of hanging for the full 120 s timeout.
  • 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 (~/.config/opencode/opencode.json) is also set to "permission": "allow" by the installer so tool calls are approved at the OpenCode level without round-tripping through ACP.
  • OpenCode typing indicator โ€” OpenCode mode now sends and keeps alive the WeChat typing indicator while the ACP agent is working.
  • Non-interactive installer โ€” bash install.sh -y (or HERMESCLAW_YES=1 bash install.sh) skips all confirmation prompts; OpenCode appears in the discovery summary.
  • Installer git pull โ€” Re-running install.sh on an existing install now pulls the latest code before continuing.
  • 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.

v0.2.1 (2026-04-12)

  • 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.

v0.2.0

  • Complete rewrite: dual-proxy gateway architecture.
  • Removed ~400 lines of AES/CDN media processing.
  • 59 pytest tests (core, proxy, recovery).
  • Smart 8-case detection installer.
  • Fix: Hermes "Response formatting failed" โ€” Proxy servers now use ThreadingHTTPServer instead of single-threaded HTTPServer.
  • Fix: OpenClaw ENOENT on media files โ€” Installer now creates symlink for media path mismatch.
  • Improved error handling โ€” BrokenPipeError now caught and logged as DEBUG.

License

MIT โ€” by @AaronWong1999 ยท X @AaronYonW


Credits

  • NousResearch/hermes-agent โ€” the agent that grows with you.
  • openclaw/openclaw โ€” your own personal AI assistant. The lobster way. ๐Ÿฆž
  • The Clawbot / openclaw-weixin maintainers for the iLink WeChat bridge.

HermesClaw is a community bridge. It is not affiliated with NousResearch or OpenClaw.