Skip to content

Connect your account

  1. Run wx auth login.

    In a terminal, wx auth login guides you through first-time setup:

    • If no local daemon is running, it offers to start one in the background.
    • If no account exists yet, it lets you create a new profile or (on Linux, when ~/xwechat_files is present) attach your existing WeChat for Linux files after a backup confirmation.
    Terminal window
    wx auth login

    For scripts or non-interactive terminals, run the steps directly:

    Works on every platform. agent-wechat creates a fresh WeChat profile in its own data folder.

    Terminal window
    wx daemon start
    wx accounts create --alias me
    wx auth login
  2. Scan the QR code with WeChat on your phone. When the terminal says it is waiting for confirmation, approve the login in WeChat.

    With wx --json auth login, the waiting notice is a JSON line on stderr with event: "login.progress" and state: "awaiting_approval". Read the final operation result as a single JSON document on stdout.

    Terminal showing wx auth login printing a QR code, then confirming the login
  3. Check it worked.

    Terminal window
    wx messages list filehelper --limit 1
    {
    "items": [
    {
    "id": "msg_eyJkYXRhYmFzZSI6Im1lc3NhZ2UvbWVzc2FnZV8wLmRi…",
    "threadId": "filehelper",
    "direction": "outgoing",
    "type": 1,
    "body": "notes for Monday",
    "createdAt": "2026-10-21T09:14:03+00:00"
    }
    ],
    "nextCursor": "…"
    }

You’re connected. Next: keep it running in the background, then use it from the CLI, OpenClaw or your own code.

Signing out and removing a profile are covered in Back up and maintain.