Bridge WeChat chat messages to any ACP-compatible AI agent (Claude, Codex, Copilot, Qwen, Gemini, OpenCode, OpenClaw, Hermes, Kiro, Kimi, Pi and more)
Bridge WeChat chat messages to any ACP-compatible AI agent (Claude, Codex, Copilot, Qwen, Gemini, OpenCode, OpenClaw, Hermes, Kiro, Kimi, Pi and more)
Bridge WeChat direct messages to any ACP-compatible AI agent.
wechat-acp logs in with the WeChat iLink bot API, polls incoming 1:1 messages, forwards them to an ACP agent over stdio, and sends the agent reply back to WeChat.
npxStart with a built-in agent preset:
npx -y wechat-acp@latest --agent copilotOr use a raw custom command:
npx -y wechat-acp@latest --agent "npx my-agent --acp"On first run, the bridge will:
~/.wechat-acpEvery push to main is automatically published to npm under the next dist-tag, so you can try unreleased changes without waiting for a tagged release:
npx -y wechat-acp@next --agent copilotThese versions are tagged -next.. (e.g. 0.7.1-next.202605311530.abc1234, where 0.7.1 is the next patch above whatever @latest is). They are built from main after CI passes, but have not been through a release review — expect rough edges. Stable users should keep using wechat-acp@latest.
List the bundled presets:
npx wechat-acp agentsCurrent presets:
copilotclaudegeminiqwencodexopencodeopenclawkirohermeskimipiThese presets resolve to concrete command + args pairs internally, so users do not need to type long npx ... commands.
wechat-acp --agent [options]
wechat-acp agents
wechat-acp inject --text
wechat-acp stop
wechat-acp statusOptions:
--agent : built-in preset name or raw agent command--cwd : working directory for the agent process--login: force QR re-login and replace the saved token--daemon: run in background after startup--config : load JSON config file--instance : run as a named, isolated instance. See "Running multiple instances" below.--idle-timeout : session idle timeout, default 1440 (use 0 for unlimited)--max-sessions : maximum concurrent user sessions, default 10--session-resume : persistence policy across bridge restarts: off (default), auto, or required--turn-end-message : send a standalone message after each completed agent turn (default: disabled)--inbox-dir : directory where received binary files are saved (default: /inbox). The agent sees the absolute saved path in the prompt and can read the file directly.--no-inbox: do not save received files; the agent only sees a size notice.--hide-thoughts: do not forward agent thinking to WeChat (default: forwarded)--show-diffs: forward ACP file diffs to WeChat (default: hidden)--hide-images: suppress inline images from tool calls. Explicit agent message images and attachments are still sent.--hide-audio: do not forward agent audio output to WeChat (default: forwarded)--hide-resources: do not forward intermediate tool resources to WeChat (default: forwarded). Explicit agent resources and files sent with attach_file are still delivered.--resource-inline-limit : render tool text resources up to this length inline and send longer ones as file attachments (default: 1000; range: 0 to 4000; use 0 to attach all non-empty tool text resources)inject --text : enqueue a local text message for the running daemon-V, --version: print version and exit-h, --help: show helpExamples:
npx -y wechat-acp@latest --agent copilot
npx -y wechat-acp@latest --agent claude --cwd D:\code\project
npx -y wechat-acp@latest --agent "npx @github/copilot --acp"
npx -y wechat-acp@latest --agent gemini --daemonBy default everything (saved login token, daemon pid/log, sync state, telemetry id) lives under ~/.wechat-acp/, which means a single machine can only host one bridge at a time. Pass --instance to namespace all of that under ~/.wechat-acp/instances// and run several bridges side by side, each with its own WeChat account and project directory.
Typical setup: WeChat account 1 drives project A, WeChat account 2 drives project B.
# Terminal 1: scan with WeChat account 1
npx -y wechat-acp@latest --instance projA --agent copilot --cwd D:\code\repo-a
# Terminal 2: scan with WeChat account 2
npx -y wechat-acp@latest --instance projB --agent copilot --cwd D:\code\repo-bThe first run of each instance prints its own QR code. Tokens are saved per instance, so subsequent runs reuse them independently.
The stop and status subcommands also honor --instance:
npx -y wechat-acp@latest status --instance projA
npx -y wechat-acp@latest stop --instance projBWithout --instance, paths fall back to ~/.wechat-acp/ exactly as before, so existing installs are unaffected.
You can provide a JSON config file with --config.
Example:
{
"agent": {
"preset": "copilot",
"cwd": "D:/code/project",
"showDiffs": true,
"resourceInlineLimit": 1000
},
"session": {
"idleTimeoutMs": 86400000,
"maxConcurrentUsers": 10,
"resume": "auto",
"turnEndMessage": "✅ Turn complete"
}
}session.resume controls whether each WeChat user's ACP conversation is
restored after the bridge restarts:
off keeps the existing behavior and always starts a new ACP session.auto loads a saved session when the agent advertises the ACP
loadSession capability. It starts a new session when loading is unsupported
or the saved session no longer exists, but surfaces other load failures.required requires an existing saved session to load successfully. A user
without a saved session can still start their first conversation.Session IDs are saved only after the first prompt completes. Loading replays history at the ACP protocol level, but the bridge suppresses that replay so old messages are not sent to WeChat again. Sessions are isolated by agent and absolute working directory: built-in presets use their stable preset ID, while raw agents use their command and arguments. Environment variables are never stored or included in the identity.
session.turnEndMessage is optional. When set to a non-empty string, the
bridge sends it as a standalone WeChat message after the ACP prompt resolves
and all output from that turn has been delivered. This makes the real turn
boundary visible even when the agent streamed several earlier messages or was
silent during a long-running tool call. The bridge generates this signal, so it
does not depend on the model following a prompt instruction. The
--turn-end-message CLI option overrides the config file value.
You can also override or add agent presets:
{
"agent": {
"preset": "my-agent"
},
"agents": {
"my-agent": {
"label": "My Agent",
"description": "Internal team agent",
"command": "npx",
"args": ["my-agent-cli", "--acp"]
}
}
}Bridge slash commands like /acp-config and /acp-cancel have fixed
built-in names that may not feel natural to everyone, and can clash with
slash commands built into the underlying agent. You can map any bridge
command to one or more custom aliases via the commandAliases config map:
{
"commandAliases": {
"/acp-cancel": ["/cancel", "/取消", "取消"],
"/acp-config": ["/config", "/设置"],
"/acp-new": ["/acp-clear", "/new"]
}
}With this config:
/取消 cancels the current turn (same as /acp-cancel), and
/取消 all works like /acp-cancel all./设置 lists ACP session config (same as /acp-config), and
/设置 set works like /acp-config set ....Two alias styles are supported:
/, e.g. /cancel) behave like the
built-in commands: they match the command token and may be followed by
arguments (/cancel all). They must not contain whitespace./, e.g. 取消) match only when
they equal the entire message. This is handy for WeChat voice input,
where saying /取消 out loud feels unnatural — a transcribed 取消
triggers the command. Because they require an exact full-message match,
they take no arguments.Notes:
/acp-config, /acp-cancel, /acp-new, /acp-more, /acp-prompt-start, or /acp-prompt-done).idleTimeoutMs to 0 to disable idle cleanup).WeChat iLink limits how many outbound messages can use one inbound context token. If a long agent reply reaches that limit and iLink reports send failures, the bridge keeps the failed text segments for 10 minutes. Send this command in a new WeChat message to deliver them with its fresh context token:
/acp-moreThe command is handled by the bridge and never becomes an ACP prompt. It sends
pending segments in order and stops at the first segment that still fails after
retries. That segment and the remaining segments stay pending for the next
/acp-more. A new normal agent prompt clears older pending output. Storage is
in memory, limited to 50 text segments per active user, and does not include
images, audio, or files.
Aliases work through commandAliases. Bare aliases must match the whole
message, so they are intercepted before the normal ACP enqueue path.
This mitigation can only retain failures reported by iLink. If iLink returns success but silently drops a message, the bridge cannot detect or replay it.
Interactive agent commands such as Copilot CLI's /clear cannot clear context
when they are forwarded as normal ACP prompt text. Use the bridge command
instead:
/acp-newThe command stops the current user's active turn and agent subprocess, drops
messages queued behind that turn, clears any multi-part prompt buffer, and
removes the saved ACP session ID. The user's next normal message starts a new
agent subprocess and session/new conversation with the same agent, working
directory, environment, and bridge configuration.
Reset is isolated to the requesting WeChat user. Other users and the bridge
process keep running. It works with session.resume set to off, auto, or
required, and it is handled by wechat-acp rather than forwarded to the
underlying agent.
Use commandAliases to add names such as /acp-clear or /new.
wechat-acp reserves a bridge-level chat command for inspecting and changing ACP session configuration without exposing a UI picker in WeChat:
/acp-config
/acp-config set Examples:
/acp-config
/acp-config set model gpt-5-mini
/acp-config set mode plan
/acp-config set reasoning_effort low
/acp-coNo open issues yet, or sync has not completed.