agentleFS
yjwongyjwong/lark-cli/skills/messages/SKILL.md

messages

Skill54 starsChanged 11 months agoMITView on GitHub

Retrieve chat message history, send messages, and manage reactions in Lark - get messages from group chats, private chats, threads, send messages to users or chats, and add/list/remove reactions. Use when user asks about chat messages, conversation history, what was discussed in a group, or wants to send a message or react.

5 other projects use a version of this, 1 of them edited.

Adopted by

Most recently taken up by

  • Other versions5 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 1

    1. seahyc/lark-cowork-plugin★ 094% same

    Wrote their own version · 4

    1. github/gh-aw★ 5.3ksame name
    2. ayrshare/ayrshare-social-media-api-claude-plugin★ 19same name
    3. wende/macbeth★ 4same name
    4. jootsing-research/skills★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository8 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 5 are distinctive, and 8 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add/list/remove emoji reactions

    line 16
  2. Distinctive:

    Read chat history (chat or thread)

    line 18
  3. Distinctive:

    Use clear, flag-based CLI with consistent JSON output

    line 21
  4. Very specific:

    Ensure lark is in your PATH, or use the full path to the binary.

    line 59
  5. Distinctive:

    Add a reaction to a message as the bot.

    line 136
  6. Distinctive:

    Use this command to list the supported emoji types for reactions.

    line 169
  7. Very specific:

    Use \n for line breaks and \t for indentation in --text

    line 244
  8. Very specific:

    Use @{ou_xxx} to mention users in group chats

    line 245
  9. Very specific:

    Use {{image}} in text to place images in order

    line 246
  10. Very specific:

    Use lark msg react list to discover reaction_id for removal

    line 248
  11. Very specific:

    If a message has a thread_id, it is part of a thread (or is the root).

    line 266
  12. Distinctive:

    All commands output JSON.

    line 277
  13. Very specific:

    Add/remove reactions requires im:message.reactions:write_only

    line 322

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Messages Skill

Retrieve chat message history, send messages, manage reactions, and search for chats/groups via the lark CLI.

🤖 Capabilities and Use Cases

  • Send markdown-lite messages with links and mentions
  • Send images with --image and {{image}} placement
  • Reply to messages and threads with --parent-id / --root-id
  • Message recall/delete for cleanup
  • Add/list/remove emoji reactions
  • Browse emoji catalog reference
  • Read chat history (chat or thread)
  • Download message resources (images/files/audio/video)
  • Find chats by name or member
  • Use clear, flag-based CLI with consistent JSON output

🚀 Quick Reference

Send message:

lark msg send --to user@example.com --text "Hello!"

Reply in thread:

lark msg send --to oc_12345 --parent-id om_abcdef --msg-type text --text "Replying here"

Read messages:

lark msg history --chat-id oc_12345 --limit 10

Find chats:

lark chat search "project team"

React / list / remove reaction:

lark msg react --message-id om_123456789abcdef --reaction SMILE
lark msg react list --message-id om_123456789abcdef
lark msg react remove --message-id om_123456789abcdef --reaction-id ZCaCIjUBVVWSrm5L-3ZTw...

Download resource:

lark msg resource --message-id om_xxx --file-key img_v3_xxx --type image --output ./image.png

Running Commands

Ensure lark is in your PATH, or use the full path to the binary. Set the config directory if not using the default:

lark msg <command>
lark chat <command>
# Or with explicit config:
LARK_CONFIG_DIR=/path/to/.lark lark msg <command>

Commands Reference

Search for Chats/Groups

lark chat search "project" --limit 10

Available flags:

  • --limit: Maximum number of chats to retrieve (0 = no limit)

Output fields include:

  • chats[] with chat_id, name, description, owner_id, external, chat_status
  • count, query

Send Messages

Send messages to users or group chats as the bot.

lark msg send --to ou_xxxx --text "Hello!"

Reply in thread:

lark msg send --to oc_xxxx --parent-id om_xxxx --msg-type text --text "Replying here"

Available flags:

  • --to (required): Recipient identifier (user ID, open_id, email, or chat_id)
  • --to-type: Explicitly specify ID type (open_id, user_id, email, chat_id) - auto-detected if omitted
  • --text: Message text content (markdown-lite). Use {{image}} to place images.
  • --image: Image file path (repeatable)
  • --msg-type: Message type: post (default) or text
  • --parent-id: Parent message ID to reply in thread (optional)
  • --root-id: Root message ID for thread replies (optional)

Output:

{
  "success": true,
  "message_id": "om_dc13264520392913993dd051dba21dcf",
  "chat_id": "oc_xxxxx",
  "create_time": "2026-01-14T10:30:00+08:00"
}

Get Chat History

lark msg history --chat-id oc_xxxxx --limit 50 --sort desc

Available flags:

  • --chat-id (required): Chat ID or thread ID
  • --type: Container type - chat (default) or thread
  • --start: Start time (Unix timestamp or ISO 8601)
  • --end: End time (Unix timestamp or ISO 8601)
  • --sort: Sort order - asc (default) or desc
  • --limit: Maximum number of messages (0 = no limit)

Output fields include:

  • messages[] with message_id, msg_type, content, sender, create_time, mentions, is_reply, thread_id, deleted
  • count, chat_id

React to Message

Add a reaction to a message as the bot.

lark msg react --message-id om_dc13264520392913993dd051dba21dcf --reaction SMILE

Available flags:

  • --message-id (required): Message ID to react to
  • --reaction (required): Reaction ID or emoji name
  • --type: Reaction type (default: emoji)

Output:

{
  "success": true,
  "message_id": "om_dc13264520392913993dd051dba21dcf",
  "reaction_type": "emoji",
  "reaction_id": "ZCaCIjUBVVWSrm5L-3ZTw...",
  "emoji_type": "SMILE"
}

Notes:

  • Reactions are added as the bot/app. The bot must be in the chat to react.
  • Emoji types must match the Lark emoji catalog (e.g., SMILE, LAUGH).
  • Replies sent with --parent-id are always created in a thread.

Emoji Catalog Reference

lark msg react emojis

Use this command to list the supported emoji types for reactions.

Custom Emojis: Organization-specific custom emojis can be configured in .lark/config.yaml:

custom_emojis:
  "7405453485858095136": "ez-pepe"

Custom emoji IDs will appear in the custom_emojis field of the output.

List Message Reactions

lark msg react list --message-id om_dc13264520392913993dd051dba21dcf --reaction SMILE --limit 50

Available flags:

  • --message-id (required): Message ID to list reactions for
  • --reaction: Emoji type filter (e.g., SMILE)
  • --limit: Maximum number of reactions to retrieve (0 = no limit)

Output fields include:

  • message_id, reactions[], count

Remove Message Reaction

lark msg react remove --message-id om_dc13264520392913993dd051dba21dcf --reaction-id ZCaCIjUBVVWSrm5L-3ZTw...

Available flags:

  • --message-id (required): Message ID to remove reaction from
  • --reaction-id (required): Reaction ID to remove

Output fields include:

  • success, message_id, reaction_type, reaction_id, emoji_type

Recall Messages

Recall/delete previously sent messages from chats.

lark msg recall om_dc13264520392913993dd051dba21dcf

Output fields include:

  • success, message_id

Downloading Resource Files

Download images, files, audio, and video from messages using msg resource:

lark msg resource --message-id om_xxx --file-key img_v3_xxx --type image --output ./image.png
lark msg resource --message-id om_xxx --file-key file_v2_xxx --type file --output ./document.pdf

Available flags:

  • --message-id (required): Message ID containing the resource
  • --file-key (required): Resource key from message content (image_key or file_key)
  • --type (required): image for images, file for files/audio/video
  • --output (required): Output file path

Output fields include:

  • success, message_id, file_key, output_path, content_type, bytes_written

Limitations:

  • Maximum file size: 100MB
  • Emoji resources cannot be downloaded
  • Resources from card, merged, or forwarded messages are not supported
  • The message_id and file_key must match

Tips

  • Use \n for line breaks and \t for indentation in --text
  • Use @{ou_xxx} to mention users in group chats
  • Use {{image}} in text to place images in order
  • Chat IDs start with oc_; thread IDs start with thread_ or omt_
  • Use lark msg react list to discover reaction_id for removal
  • The CLI auto-detects recipient type; override with --to-type if needed

Message Types

  • text - Plain text message
  • post - Rich text post
  • image - Image
  • file - File attachment
  • audio - Audio message
  • media - Video/media
  • sticker - Sticker/emoji
  • interactive - Interactive card
  • share_chat - Shared chat
  • share_user - Shared user contact

Reading Thread Replies

If a message has a thread_id, it is part of a thread (or is the root). To fetch replies:

lark msg history --chat-id oc_xxxxx --limit 10 --sort desc
lark msg history --chat-id omt_1a3b99f9d2cfd982 --type thread

Thread messages will have is_reply: true for replies (root message has is_reply: false).

Output Format

All commands output JSON.

Error Handling

Errors return JSON:

{
  "error": true,
  "code": "ERROR_CODE",
  "message": "Description"
}

Common error codes:

  • AUTH_ERROR - Need to run lark auth login
  • SCOPE_ERROR - Missing messages permissions
  • VALIDATION_ERROR - Missing required fields (e.g., chat-id)
  • API_ERROR - Lark API issue (e.g., bot not in group, missing permissions)

Required Permissions

This skill requires the messages scope group. If you see a SCOPE_ERROR, add permissions:

lark auth login --add --scopes messages

To check current permissions:

lark auth status

Additional requirements:

For reading messages:

  • The bot must be in the group chat
  • Group chat reads require the "Read all messages in associated group chat" permission
  • Private chat reads require im:message:readonly

For sending messages:

  • Requires im:message or im:message:send_as_bot
  • The bot must be added to group chats before it can send messages to them

For reactions:

  • List reactions requires im:message.reactions:read
  • Add/remove reactions requires im:message.reactions:write_only

Notes

  • Messages are sent as the bot/app
  • Messages are sorted by creation time ascending by default
  • Time filters do not work for thread container type
  • Message IDs typically start with om_

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.