Feishu CLI Email Management

Compose, send, reply, and forward emails. Manage drafts, triage your inbox, and monitor incoming mail in real-time via WebSocket — all from the command line or through AI Agent automation.

Full Email Management from the Terminal

The Feishu CLI mail module provides 11 shortcut commands for full email management. Send new emails, reply to or forward existing ones, manage drafts, triage your inbox, and monitor incoming mail in real-time via WebSocket. Every shortcut maps directly to the Lark Open Platform Mail API, giving you complete programmatic access to Feishu/Lark Mail.

The mail skill includes robust security rules to guard against prompt injection when AI Agents process email content. All compose operations default to creating a draft first, requiring explicit confirmation before sending — a critical safety feature for automated workflows.

+send — Compose and Send Emails

Compose a new email with recipients, subject, HTML body, and optional attachments. By default, a draft is created. Add --confirm-send to send immediately.

# Send an email with an attachment (creates draft by default) $ lark-cli mail +send --to "user@example.com" --subject "Q1 Report" --body "<h1>Report</h1><p>See attached.</p>" --attach ./report.pdf
# Send immediately with CC and BCC recipients $ lark-cli mail +send --to "user@example.com" --cc "manager@example.com" --bcc "archive@example.com" --subject "Final Review" --body "<p>Please review and approve.</p>" --confirm-send
# Send with inline images and a custom sender alias $ lark-cli mail +send --from "team@example.com" --to "client@example.com" --subject "Design Mockups" --body "<p>See inline previews below.</p>" --inline ./mockup1.png --inline ./mockup2.png

Supported Parameters

ParameterDescription
--fromSender email address or alias
--toRecipient email address (required)
--ccCarbon copy recipients
--bccBlind carbon copy recipients
--subjectEmail subject line
--bodyHTML-formatted email body
--attachFile attachment (local path, repeatable)
--inlineInline image (local path, repeatable)
--confirm-sendSend immediately instead of creating a draft

+reply — Reply to an Email

Reply to a specific email by message ID. Defaults to creating a draft reply. The original sender becomes the recipient automatically.

# Reply to a specific email $ lark-cli mail +reply --message-id "msgXXX" --body "<p>Thanks, acknowledged.</p>"
# Reply and send immediately $ lark-cli mail +reply --message-id "msgXXX" --body "<p>Confirmed. Will proceed.</p>" --confirm-send

+reply-all — Reply to All Recipients

Reply to all recipients of an email. Use --remove to exclude specific addresses from the reply.

# Reply all to a thread $ lark-cli mail +reply-all --message-id "msgXXX" --body "<p>Noted by all.</p>"
# Reply all but exclude a specific recipient $ lark-cli mail +reply-all --message-id "msgXXX" --body "<p>Internal discussion only.</p>" --remove "external@partner.com"

+forward — Forward an Email

Forward an existing email to new recipients with an optional cover note.

# Forward an email to a colleague $ lark-cli mail +forward --message-id "msgXXX" --to "colleague@example.com" --body "<p>FYI — see the original thread below.</p>"

+draft-create & +draft-edit — Manage Email Drafts

Create new drafts or edit existing ones before sending. Drafts are the default output of all compose operations, providing a safe review step.

# Create a new draft $ lark-cli mail +draft-create --subject "Draft Report" --body "<p>Work in progress.</p>" --to "team@example.com"
# Edit an existing draft's subject $ lark-cli mail +draft-edit --draft-id "draftXXX" --set-subject "Updated Subject"
# Edit a draft's body and add an attachment $ lark-cli mail +draft-edit --draft-id "draftXXX" --set-body "<p>Revised content.</p>" --attach ./updated-report.pdf

+message, +messages, +thread — Read Emails

Retrieve individual messages, list multiple messages, or view an entire email thread.

# Read a single email by message ID $ lark-cli mail +message --message-id "msgXXX"
# List recent emails in the inbox $ lark-cli mail +messages
# View an entire email thread $ lark-cli mail +thread --thread-id "threadXXX"

+triage — Quick Inbox Overview

Get a prioritized overview of your inbox for rapid triage. Surfaces unread and important emails so you can quickly decide what needs attention.

# Triage your inbox $ lark-cli mail +triage

+watch — Monitor Incoming Mail via WebSocket

Establish a real-time WebSocket connection to monitor incoming mail. Filter by labels or folders and output events to a local directory for downstream processing.

# Watch inbox for new mail in real-time $ lark-cli mail +watch --labels "INBOX" --output-dir ./mail-events/
# Watch a specific folder $ lark-cli mail +watch --labels "IMPORTANT" --output-dir ./important-events/

Parameters

ParameterDescription
--labelsFilter by label or folder name (e.g., INBOX, IMPORTANT, SENT)
--output-dirLocal directory to write incoming mail event JSON files

Email Security Features

The Feishu CLI mail skill includes multiple layers of security designed specifically for AI Agent workflows where email content is processed automatically.

Untrusted Input Handling

All email content is treated as untrusted input. The mail skill applies strict sanitization before processing email bodies, subjects, and headers to prevent injection attacks.

Anti-Prompt Injection

Built-in rules in the lark-mail skill detect and neutralize prompt injection attempts embedded in email content, protecting AI Agents from malicious payloads.

Sender Identity Verification

The skill enforces awareness of sender identity verification status. AI Agents are instructed to treat unverified or spoofed sender addresses with appropriate caution.

Draft-First Workflow

All compose operations (send, reply, forward) default to creating a draft rather than sending immediately. This prevents accidental sends in automated pipelines.

Dry-Run Support

All write operations support the --dry-run flag, which simulates the action without making any changes. Essential for testing automated email workflows safely.

Scoped Permissions

Email access requires the mail:user_mailbox permission scope, ensuring that only authorized applications can read or send mail on a user’s behalf.

Required Permission Scopes

All email commands require the mail:user_mailbox scope for user mailbox access. This scope grants read and write access to the authenticated user’s mailbox, including sending, reading, and managing drafts.

All Email Shortcut Commands

ShortcutDescriptionRiskKey Parameters
+sendCompose and send a new emailMedium--to, --subject, --body, --attach, --confirm-send
+replyReply to a specific emailMedium--message-id, --body, --confirm-send
+reply-allReply to all recipientsMedium--message-id, --body, --remove
+forwardForward an email to new recipientsMedium--message-id, --to, --body
+draft-createCreate a new email draftLow--subject, --body, --to
+draft-editEdit an existing draftLow--draft-id, --set-subject, --set-body
+messageRead a single emailSafe--message-id
+messagesList recent emailsSafe
+threadView an email threadSafe--thread-id
+triageQuick inbox triage overviewSafe
+watchMonitor incoming mail via WebSocketSafe--labels, --output-dir

Related Feishu CLI Guides