Skip to content

Read and follow chats

Read your chats from the CLI or the HTTP API. Add --json to a wx command when a script will parse the output. With several accounts, add --account ID or an alias.

List and read chats

  1. List recent chats. Each row shows unread counts:

    Terminal window
    wx chats list --limit 20
    Name Chat ID Kind Unread Last message
    Book club books@chatroom group 2 See you Friday

    If another page is available, the output shows a cursor. Pass it with --cursor CURSOR.

  2. Read one chat, including its muted and pinned settings:

    Terminal window
    wx chats get CHAT_ID
  3. Read messages in a chat. The newest come first. Page with --cursor:

    Terminal window
    wx messages list CHAT_ID --limit 50

    The table shows the sender, a preview, the time and a short message ID. A note appears below it if history is partial. Add --json for full text and IDs.

filehelper is your File Transfer chat, which is handy for testing. For contacts, see Find and manage contacts; for groups and their members, see Manage groups.

Find a chat by its name or ID:

Terminal window
wx chats find "Book club"

The CLI has no command for searching message text. Use the HTTP API for that.

Search ignores letter case, and every word must match, so invoice march finds messages containing both words.

Pin chats

Terminal window
wx chats pin CHAT_ID --idempotency-key pin-001
wx chats unpin CHAT_ID --idempotency-key unpin-001

If the response is lost, run the same command again with the same key.

Pinning works on ordinary direct chats and groups already in your chat list. To mute a direct chat, use wx chats mute or wx chats unmute with the same key option; for groups, see Manage groups.

Follow new messages

Print events as they arrive:

Terminal window
wx events watch --cursor-file ~/.cache/wx-events.cursor

Add --json for one JSON event per line. The first run starts from the newest event, and the cursor file lets the next run resume. To use a cursor you saved yourself, pass --after CURSOR. To list recent events without watching, run wx events list.

Mark a chat read

  1. Read the chat to get its current read-state version:

    Terminal window
    wx chats get CHAT_ID
  2. Mark the whole chat read, passing that version:

    Terminal window
    wx chats read CHAT_ID --expected-version VERSION

This marks the whole chat read on your other devices too. If the chat changed since you read it, the request is refused. Read the chat again and retry.