Prerequisite: Read
../lark-shared/SKILL.mdfirst to understand authentication, global parameters, and safety rules.
Reply to a specific message. Supports both user identity (--as user) and bot identity (--as bot). Also supports thread replies.
This skill maps to the shortcut: lark-cli im +messages-reply (internally calls POST /open-apis/im/v1/messages/:message_id/reply).
Replies sent by this tool are visible to other people. Before calling it, you must confirm with the user:
Do not send a reply without explicit user approval.
When using --as bot, the reply is sent in the app's name, so make sure the app has already been added to the target chat.
When using --as user, the reply is sent as the authorized end user and requires the im:message.send_as_user and im:message scopes.
| Need | Recommended flag | Why |
|---|---|---|
| Reply with plain text exactly as written | --text |
Wrapped directly to {"text":"..."} |
| Reply with simple Markdown and accept conversion | --markdown |
Automatically converted to post JSON |
| Precisely control the reply payload | --content |
You provide the exact JSON |
| Reply with media | --image / --file / --video / --audio |
Shortcut uploads local files automatically |
--text vs --markdown--text when the reply should remain plain text and you want exact control over line breaks, spacing, indentation, code samples, or literal Markdown characters.--markdown when you want a lightweight formatted reply and you accept that the shortcut will normalize and rewrite parts of the content before sending.--content when you need exact post JSON, a card, a title, multiple locales, or any structure that --markdown cannot express reliably.--markdown Really Does--markdown does not send arbitrary raw Markdown to the API.
The shortcut:
msg_type=postWraps the final content as:
{"zh_cn":{"content":[[{"tag":"md","text":"..."}]]}}
So --markdown is a convenience mode, not a full Markdown compatibility layer.
post payload with a single zh_cn locale.post title.# Title becomes #### Title## to ###### are normalized to ##### when the content contains H1-H3http://..., https://..., or already-uploaded img_xxx Markdown images are kept reliably. are not auto-uploaded by --markdown.If you need exact output, use --msg-type post --content ... instead of --markdown.
If the reply contains multiple lines, code blocks, indentation, tabs, or a lot of escaping, prefer $'...'.
Use --text plus $'...':
lark-cli im +messages-reply --message-id om_xxx --text $'Received\nI will check this today.\nOwner: alice'
lark-cli im +messages-reply --message-id om_xxx --text $'```sql\nselect * from jobs;\n```'
This keeps the reply as plain text instead of converting it to a post.
Use --markdown:
lark-cli im +messages-reply --message-id om_xxx --markdown $'## Follow-up\n\n- I reproduced it\n- I am fixing it'
This is better for quick readable formatting, but the final payload may still differ from the source text because headings and spacing are normalized before sending.
# Reply to a message (plain text, --text is recommended for normal replies)
lark-cli im +messages-reply --message-id om_xxx --text "Received"
# Equivalent manual JSON
lark-cli im +messages-reply --message-id om_xxx --content '{"text":"Received"}'
# Reply as a bot
lark-cli im +messages-reply --message-id om_xxx --text "bot reply" --as bot
# Reply with preserved multi-line text
lark-cli im +messages-reply --message-id om_xxx --text $'Line 1\nLine 2\n indented line'
# Reply inside the thread (message appears in the target thread)
lark-cli im +messages-reply --message-id om_xxx --text "Let's discuss this" --reply-in-thread
# Reply with basic Markdown (will be converted to post JSON)
lark-cli im +messages-reply --message-id om_xxx --markdown $'## Reply\n\n- item 1\n- item 2'
# If you need exact post structure, send JSON directly
lark-cli im +messages-reply --message-id om_xxx --msg-type post --content '{"zh_cn":{"title":"Reply","content":[[{"tag":"text","text":"Detailed content"}]]}}'
# Reply with a local image (uploaded automatically before sending)
lark-cli im +messages-reply --message-id om_xxx --image ./photo.png
# Reply with a local file (uploaded automatically before sending)
lark-cli im +messages-reply --message-id om_xxx --file ./report.pdf
# Reply with a local video (--video-cover is required as the video cover)
lark-cli im +messages-reply --message-id om_xxx --video ./demo.mp4 --video-cover ./cover.png
# With an idempotency key
lark-cli im +messages-reply --message-id om_xxx --text "Received" --idempotency-key my-unique-id
# Preview the request without executing it
lark-cli im +messages-reply --message-id om_xxx --markdown $'## Test\n\nhello' --dry-run
| Parameter | Required | Description |
|---|---|---|
--message-id <id> |
Yes | ID of the message being replied to (om_xxx) |
--msg-type <type> |
No | Message type (default text). If you use --text / --markdown / media flags, the effective type is inferred automatically. Explicitly setting a conflicting --msg-type fails validation |
--content <json> |
One content option | Exact reply content as JSON. The JSON must match the effective --msg-type |
--text <string> |
One content option | Plain text reply. Best default when you need exact text and formatting preservation |
--markdown <string> |
One content option | Convenience Markdown input. Internally converted to post JSON with Feishu-specific normalization |
--image <path\|key> |
One content option | Local image path or image_key (img_xxx) |
--file <path\|key> |
One content option | Local file path or file_key (file_xxx) |
--video <path\|key> |
One content option | Local video path or file_key; must be used together with --video-cover |
--video-cover <path\|key> |
Required with --video |
Video cover image path or image_key (img_xxx) |
--audio <path\|key> |
One content option | Local audio path or file_key |
--reply-in-thread |
No | Reply inside the thread. The reply appears in the target message's thread instead of the main chat stream |
--idempotency-key <key> |
No | Idempotency key; the same key sends only one reply within 1 hour |
--as <identity> |
No | Identity type: bot or user (default bot) |
--dry-run |
No | Print the request only, do not execute it |
Mutual exclusivity rule:
--text,--markdown,--content, and--image/--file/--video/--audiocannot be used together. Media flags are also mutually exclusive with each other.Video cover rule:
--videomust be accompanied by--video-cover. Omitting--video-coverwhen using--videowill fail validation.--video-covercannot be used without--video.
--markdown when you actually need exact plain text. If exact line breaks and spacing matter, use --text, usually with $'...'.--markdown supports all Markdown features. It does not; it is converted into a Feishu post payload and rewritten first.. --markdown does not auto-upload those paths.--content without making the JSON match the effective --msg-type.--msg-type to something that conflicts with --text, --markdown, or media flags.--text, --markdown, or --content with media flags in one command.{
"message_id": "om_xxx",
"chat_id": "oc_xxx",
"create_time": "1234567890"
}
lark-cli im +messages-reply --message-id om_xxx --text "OK, I will handle it"
The reply appears in the main chat stream and references the target message.
lark-cli im +messages-reply --message-id om_xxx --text "Let me take a look at this" --reply-in-thread
The reply appears in the target message's thread and does not show up in the main chat stream.
<at user_id="ou_xxx">name</at><at user_id="all"></at><at id=...> and <at open_id=...> into user_id, but user_id remains the recommended documented form--message-id must be a valid message ID in om_xxx format--content must be valid JSON--content, you are responsible for making the JSON structure match the effective msg_type--reply-in-thread adds reply_in_thread=true to the API request--reply-in-thread is mainly meaningful in chats that support thread replies--image/--file/--video/--audio/--video-cover support local file paths; the shortcut uploads first and then sends the reply; both the upload and send steps use the same identity (UAT when --as user, TAT when --as bot)img_ or file_, it is treated as an existing key and used directly--markdown always sends msg_type=post--msg-type and it conflicts with the chosen content flag, validation fails--video, --video-cover is required as the video cover--dry-run uses placeholder image keys for remote Markdown images and placeholder media keys for local uploads--as user uses a user access token (UAT) and requires the im:message.send_as_user and im:message scopes; the reply is sent as the authorized end user--as bot uses a tenant access token (TAT), and requires the im:message:send_as_bot scope