SuperAPI AI Directory

wechat-cli

General & other

View repository

Updated 10-15 23:58

About this skill

wechat-cli — pure-background WeChat send

A CLI that sends WeChat messages without activating WeChat's window (no flash, no focus steal). Reverse-engineered via LLDB + macOS Accessibility API.

Quick usage

# Send to the currently open chat
wechat-cli --text "Hello 你好 🎉"

# Send to any wxid (regardless of which chat is currently open)
wechat-cli --text "会议马上开始" --wxid filehelper
wechat-cli --text "到家了吗" --wxid wxid_abc123

First-time setup (once per machine)

  1. Install: download the latest signed binary from Releases and put it on PATH:

    curl -L https://github.com/leeguooooo/wechat-skill/releases/latest/download/wechat-cli -o /usr/local/bin/wechat-cli
    chmod +x /usr/local/bin/wechat-cli
    # Bypass "can't verify developer" warning for ad-hoc signed binary:
    xattr -d com.apple.quarantine /usr/local/bin/wechat-cli 2>/dev/null || true
    
  2. Accessibility permission: System Settings → Privacy & Security → Accessibility → add Terminal.app (or iTerm / whatever runs wechat-cli).

  3. InputView bootstrap (once per WeChat restart):

    # WeChat must be running with any chat open
    wechat-cli --inputview 0x<ADDR> --text "init"
    

    To get the InputView address, use the helper (TODO: auto-bootstrap subcommand). Currently the address is captured once by running a companion tool (wx_send_hijack.py) and cached in /tmp/wx_send_state.json. See detailed bootstrap in the source repo's README.

Arguments

Arg Required Description
--text TEXT yes Message body (any length, any Unicode)
--wxid WXID no Target wxid; if omitted, sends to currently open chat
--mode MODE no Input method: ax (default, silent), heap, cgevent
--auto-hide default on Hide WeChat before send (prevents UI flash)
--no-auto-hide no Disable auto-hide (may flash when WeChat visible)
--seed SEED only for --mode heap Text currently in WeChat input field
--inputview 0xADDR first run Cache WeChat's InputView C++ instance address

When to use this skill (for AI agents)

Invoke wechat-cli when the user wants to:

  • Send a message to a specific contact/chat in WeChat
  • Schedule / automate periodic WeChat notifications
  • Pipe data from a script → WeChat chat
  • Send from a headless / background script without disturbing the user's focus

Example prompts that should trigger this skill:

  • "Send a message to Lisa: the meeting starts in 5 minutes"
  • "Send a WeChat notification to my mom 'I'm home'"
  • "send a WeChat to filehelper with today's PR summary"

Mechanism (brief)

  1. LLDB attaches to WeChat process
  2. AX API sets WeChat.AXHidden=True (equivalent of Cmd-H)
  3. AX setValue writes text into WeChat's chat_input_field (silent while hidden)
  4. LLDB WriteMemory overwrites InputView+0x2B8 with target wxid SSO std::string
  5. LLDB expression -i true -u false cold-calls mmui::InputView::Send(0) via the discovered rva — WeChat sends normally, believing user pressed Enter.

Full technical docs + LLDB anchors + rediscovery guide for future WeChat versions: leeguooooo/wechat-private-analysis-artifacts (private).

Notes / caveats

  • macOS only, Apple Silicon only, WeChat 4.1.8 verified. Other versions: anchors (slot_send rva, InputView+0x2B8) may drift; rebuild required.
  • Binary is ad-hoc signed (no paid Apple Developer cert). First launch may require right-click → Open, or xattr -d com.apple.quarantine to allow.
  • Not a WeChat API. This is a userland research artifact that pokes WeChat via the debugger. It works today; it may break on any WeChat update.
  • Ethics: only send messages you'd send yourself. This tool respects WeChat's normal send path — rate limits / account rules still apply.

Support

Issues / version-drift reports → leeguooooo/wechat-skill.