Connect your account
-
Run
wx auth login.In a terminal,
wx auth loginguides 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_filesis present) attach your existing WeChat for Linux files after a backup confirmation.
Terminal window wx auth loginFor 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 startwx accounts create --alias mewx auth loginKeeps your chat history by using WeChat for Linux’s files where they are. Quit WeChat and back them up first:
Terminal window wx daemon starttar -czf ~/wechat-profile-backup.tgz -C ~ xwechat_files .xwechatwx auth login --official--officiallooks in your home directory. If the files are elsewhere, pass the folder that contains them:--official=/path/to/home. -
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 withevent: "login.progress"andstate: "awaiting_approval". Read the final operation result as a single JSON document on stdout. -
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.