tgcli icon indicating copy to clipboard operation
tgcli copied to clipboard

Global message search across all chats (messages.searchGlobal)

Open kfastov opened this issue 8 months ago • 0 comments

Problem

messages search without --chat only searches the local archive. There's no way to search across all joined chats for a specific text.

This makes it impossible to find which chat a message came from if you don't already know the chat ID.

Repro

# Search for a known message text without specifying chat
tgcli messages search --query "some unique phrase" --json
# → {"source": "archive", "returned": 0, "messages": []}

# Live search requires --chat
tgcli messages search --query "some unique phrase" --source live --json
# → error: --chat is required for live search

Use case

Agent needs to find a group by a quoted message from it. Without knowing the chat ID, there's no way to locate it.

Telegram API supports messages.searchGlobal which searches across all dialogs — this would solve the problem.

Expected

tgcli messages search --query "some unique phrase" --source live --json
# → returns matches from any chat, with channelId included

kfastov avatar Mar 28 '26 08:03 kfastov