# im +messages-search > **Prerequisite:** Read [`../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) first to understand authentication, global parameters, and safety rules. Search Feishu messages across conversations. This shortcut automatically performs a multi-step workflow: search for message IDs, batch fetch message details, then enrich the results with chat context. > **User identity only** (`--as user`). Bot identity is not supported. This skill maps to the shortcut: `lark-cli im +messages-search` (internally calls `POST /open-apis/im/v1/messages/search` + batched `GET /open-apis/im/v1/messages/mget`, then batch-fetches chat context). ## Commands ```bash # Search by keyword lark-cli im +messages-search --query "project progress" # Restrict search to a specific group chat lark-cli im +messages-search --query "weekly report" --chat-id oc_xxx # Filter by sender (comma-separated) lark-cli im +messages-search --query "requirement" --sender ou_xxx,ou_yyy # Filter by attachment type lark-cli im +messages-search --query "report" --include-attachment-type file # Filter by chat type (group / p2p) lark-cli im +messages-search --query "progress" --chat-type group # Filter by sender type (user / bot) lark-cli im +messages-search --query "reminder" --sender-type bot # Exclude bot senders lark-cli im +messages-search --query "reminder" --exclude-sender-type bot # Only messages that @me lark-cli im +messages-search --query "announcement" --is-at-me # Combined filters + time range lark-cli im +messages-search --query "meeting" --sender ou_xxx --chat-type group --start "2026-03-13T00:00:00+08:00" --end "2026-03-20T23:59:59+08:00" # Specific time range (ISO 8601) lark-cli im +messages-search --query "release" --start "2026-03-01T00:00:00+08:00" --end "2026-03-10T00:00:00+08:00" # Output format options lark-cli im +messages-search --query "test" --format pretty lark-cli im +messages-search --query "test" --format table lark-cli im +messages-search --query "test" --format csv # Pagination lark-cli im +messages-search --query "test" --page-token # Auto-pagination across multiple pages lark-cli im +messages-search --query "test" --page-all --format json # Auto-pagination with an explicit page cap lark-cli im +messages-search --query "test" --page-limit 5 --format json # Preview the request without executing it lark-cli im +messages-search --query "test" --dry-run ``` ## Parameters | Parameter | Required | Description | |------|------|------| | `--query ` | No | Search keyword (may be empty when used with other filters) | | `--chat-id ` | No | Restrict to chat IDs, comma-separated (`oc_xxx,oc_yyy`) | | `--sender ` | No | Sender open_ids, comma-separated (`ou_xxx`) | | `--include-attachment-type ` | No | Attachment filter: `file` / `image` / `video` / `link` | | `--chat-type ` | No | Chat type: `group` / `p2p` | | `--sender-type ` | No | Sender type: `user` / `bot` | | `--exclude-sender-type ` | No | Exclude messages from `user` or `bot` senders | | `--is-at-me` | No | Only return messages that mention `@me` | | `--start