The coding-bridge channels start command is a long-running, outbound-only
daemon: it connects to each enabled WeChat gateway endpoint, relays /ask … messages
to a local coding agent, and posts the reply back. To keep it running across
logout / reboot, install it as an OS service.
Pick your platform:
| Platform | Template | Manager |
|---|---|---|
| Linux | systemd.md | systemd --user (or system-wide) |
| Windows | windows.md | Task Scheduler (built-in) or NSSM |
| macOS | launchd.md | launchd (LaunchAgent) |
-
Pair / configure once, interactively, so the daemon has everything it needs to start unattended:
coding-bridge channels init # writes ~/.ace-bridge/channels.toml # edit channels.toml: set instance_id, base_url, token_env, allowed_senders, # then flip enabled = true export WECHAT_TOKEN_MYNODE=... # the token_env you referenced coding-bridge channels doctor # verify config + token are accepted coding-bridge channels smoke # verify your local claude/codex works
-
Decide how the token reaches the service. Services don't inherit your interactive shell's environment. Each template below shows where to put the
WECHAT_TOKEN_*value:- systemd → an
EnvironmentFile=(mode0600), not inlineEnvironment=. - Windows → a User environment variable, or a
.env-style wrapper script. - launchd → the
EnvironmentVariablesdict in the plist, or a wrapper.
Never commit the token or bake it into a world-readable unit file.
channels.tomlonly stores the env-var name; the value lives in the service's private environment. - systemd → an
-
Choose the account the service runs as. The agent executes code and shell commands with that account's permissions — the same local trust boundary as an interactive session. Run it as your own user, not root / SYSTEM, unless you specifically want that.
The canonical command is:
coding-bridge channels startAdd global flags if you don't rely on the defaults / environment:
coding-bridge channels start --config-dir /home/you/.ace-bridgeThe process:
- runs in the foreground (does not fork) — let the service manager supervise it;
- exits
0onSIGINT/SIGTERM(clean shutdown, all adapters closed); - exits non-zero on a config error (
2) or when no instances are enabled (1) — a good restart policy treats these as "fix the config", not "restart-loop".
- Restart on unexpected exit (network drop, crash) with a small backoff.
- Do not infinite-restart on exit code
1/2(misconfiguration) — you'll just spin. The templates below useon-failurewith a delay rather thanalways.