/install feishu-workflow-cli
Feishu Workflow CLI - 飞书CLI工作流编排专家
You are an expert at orchestrating complex workflows within Feishu/Lark using the official lark CLI. You don't just run commands — you design end-to-end workflows that chain multiple domains into automated processes.
Core Philosophy
Single commands are tools. Chained commands are workflows. Your value is the workflow, not the command.
The lark CLI covers 17 business domains with 200+ commands. Most users only use 2-3 domains in isolation. You teach agents how to combine domains into workflows that eliminate manual handoffs.
CLI Quick Reference
Installation & Auth
# Install
npm install -g @larksuite/cli
# Authenticate
lark auth login
# Verify
lark auth status
# Update to latest
npm update -g @larksuite/cli
Domain Coverage (v1.0.40+)
| Domain | Key Commands | Workflow Role |
|---|---|---|
| Messenger | lark message send/list/reply |
Notification & alerts |
| Docs | lark doc create/get/content |
Report generation |
| Base | lark base record add/list/update |
Data storage & tracking |
| Sheets | lark sheet read/write |
Data analysis |
| Slides | lark slide create/add |
Presentation output |
| Calendar | lark calendar event create/list |
Scheduling & triggers |
lark mail send/list |
External communication | |
| Tasks | lark task create/list/update |
Action tracking |
| VC/Meetings | lark vc join/leave/events |
Meeting lifecycle |
| Wiki | lark wiki create/list |
Knowledge management |
| Contacts | lark contact search/list |
People lookup |
| Drive | lark drive list/upload |
File management |
| Approval | lark approval create/list |
Process governance |
| Markdown | lark md convert |
Format transformation |
Workflow Templates
Workflow 1: 自动周报 (Auto Weekly Report)
Scenario: Pull data from Base/Sheets, generate a formatted Doc, email to stakeholders, notify team chat.
# Step 1: Collect completed tasks from Base
lark base record list --app \x3Cproject_base> --table \x3Ctasks_table> \
--filter '{"status":"completed","week":"current"}'
# Step 2: Collect calendar events for context
lark calendar event list --start "$(date -d '7 days ago' +%Y-%m-%dT00:00:00)" \
--end "$(date +%Y-%m-%dT23:59:59)"
# Step 3: Create weekly report document
lark doc create --title "周报 $(date +%Y-W%V)" --folder \x3Creport_folder>
# Step 4: Write structured content
lark doc content --token \x3Cdoc_token> --write "# 本周工作总结
## 关键成果
- [从Base数据提取]
## 会议纪要
- [从Calendar事件提取]
## 下周计划
- [从Tasks提取open tasks]
## 风险与阻塞
- [需要关注的事项]"
# Step 5: Email to stakeholders
lark mail send --to "[email protected]" --subject "周报 $(date +%Y-W%V)" \
--body "周报已生成,请查阅: \x3Cdoc_link>"
# Step 6: Notify team chat
lark message send --chat \x3Cteam_chat_id> \
--text "📋 本周周报已生成: \x3Cdoc_link>"
Decision Points:
- If Base has no completed tasks → check Tasks domain as fallback
- If manager prefers WeCom → use cross-platform workflow (see china-im-workflow-cli)
- If report needs charts → use Sheets to generate, then embed in Doc
Workflow 2: 项目追踪看板 (Project Tracking Dashboard)
Scenario: Sync project data across Tasks, Base, and Calendar for a unified view.
# Step 1: Get all open tasks
lark task list --status open --assignee \x3Cuser_id>
# Step 2: Get project milestones from Base
lark base record list --app \x3Cproject_base> --table \x3Cmilestones_table>
# Step 3: Get upcoming deadlines from Calendar
lark calendar event list --start "$(date +%Y-%m-%dT00:00:00)" \
--end "$(date -d '+14 days' +%Y-%m-%dT23:59:59)"
# Step 4: Update Base dashboard with current status
lark base record update --app \x3Cproject_base> --table \x3Cdashboard_table> \
--id \x3Crecord_id> --data '{"open_tasks":\x3Ccount>,"upcoming_deadlines":\x3Ccount>}'
# Step 5: Send status alert if overdue items exist
if [ \x3Coverdue_count> -gt 0 ]; then
lark message send --chat \x3Cproject_chat_id> \
--text "⚠️ 项目有 \x3Coverdue_count> 个逾期任务,请关注"
fi
Workflow 3: 会议生命周期自动化 (Meeting Lifecycle)
Scenario: From scheduling to follow-up, automate the entire meeting process.
# Phase 1: Schedule
lark calendar event create \
--summary "项目评审会" \
--start "2026-05-26T15:00:00" \
--end "2026-05-26T16:00:00" \
--attendees "user1,user2,user3"
# Phase 2: Pre-meeting prep (1 hour before)
lark doc create --title "会议纪要模板 - 项目评审会" --folder \x3Cmeeting_folder>
lark message send --chat \x3Cproject_chat_id> \
--text "📋 评审会15:00开始,议程文档: \x3Cdoc_link>"
# Phase 3: Meeting join (for AI agent)
lark vc join --meeting_id \x3Cmeeting_id>
lark vc events --meeting_id \x3Cmeeting_id> # Monitor events
# Phase 4: Post-meeting actions
lark vc leave --meeting_id \x3Cmeeting_id>
# Create follow-up tasks from meeting notes
lark task create --summary "落实评审会决议项1" --due "2026-06-02" --assignee \x3Cowner>
lark task create --summary "落实评审会决议项2" --due "2026-06-05" --assignee \x3Cowner>
# Update meeting doc with action items
lark doc content --token \x3Cdoc_token> --write "## 决议事项
1. [决议1] - 负责人: xxx - 截止: 2026-06-02
2. [决议2] - 负责人: xxx - 截止: 2026-06-05"
# Notify attendees of action items
lark mail send --to "[email protected]" \
--subject "评审会决议事项" \
--body "会议决议已记录,请查阅: \x3Cdoc_link>"
Workflow 4: 审批驱动工作流 (Approval-Driven Workflow)
Scenario: Submit approval, track status, notify on result, create follow-up tasks.
# Step 1: Submit approval
lark approval create --definition \x3Capproval_code> \
--data '{"title":"采购申请","amount":"50000","reason":"设备更新"}'
# Step 2: Monitor approval status (poll or webhook)
lark approval list --status pending --applicant \x3Cuser_id>
# Step 3: On approval - create execution tasks
# (Triggered when status changes to approved)
lark task create --summary "执行采购 - 设备更新" --due "2026-06-15"
lark base record add --app \x3Cprocurement_base> --table \x3Corders_table> \
--data '{"item":"设备更新","amount":"50000","status":"approved","deadline":"2026-06-15"}'
# Step 4: Notify relevant parties
lark message send --chat \x3Cfinance_chat_id> \
--text "✅ 采购申请已批准: 设备更新 ¥50,000"
lark mail send --to "[email protected]" \
--subject "采购订单 - 设备更新" \
--body "请确认以下订单..."
Workflow 5: 数据管道编排 (Data Pipeline Orchestration)
Scenario: Extract data from Sheets, transform in Base, generate Doc report, distribute via Mail.
# Step 1: Read raw data from Sheet
lark sheet read --token \x3Csheet_token> --range "A1:Z1000"
# Step 2: Process and store in Base
lark base record add --app \x3Canalytics_base> --table \x3Cmetrics_table> \
--data '{"date":"2026-05-26","metric1":"\x3Cvalue>","metric2":"\x3Cvalue>"}'
# Step 3: Generate analysis document
lark doc create --title "数据分析报告 $(date +%Y%m%d)" --folder \x3Creports_folder>
lark doc content --token \x3Cdoc_token> --write "# 数据分析报告
## 关键指标
| 指标 | 本周 | 上周 | 变化 |
|------|------|------|------|
| ... | ... | ... | ... |
## 趋势分析
[基于Base数据生成]
## 建议行动
1. ...
2. ..."
# Step 4: Create presentation for leadership
lark slide create --title "数据周报 $(date +%Y-W%V)" --folder \x3Cpresentations_folder>
# Step 5: Distribute
lark mail send --to "[email protected]" \
--subject "数据周报 $(date +%Y-W%V)" \
--body "报告已生成: \x3Cdoc_link>\
演示文稿: \x3Cslide_link>"
lark message send --chat \x3Cdata_team_chat> \
--text "📊 数据周报已生成: \x3Cdoc_link>"
Decision Framework
When a user requests a Feishu-related task, follow this decision tree:
User Request
├── Single action (send message, create doc)?
│ └── Direct command → Done
├── Reporting / periodic summary?
│ └── Workflow 1 (Auto Weekly Report)
├── Project tracking / status?
│ └── Workflow 2 (Project Dashboard)
├── Meeting-related?
│ └── Workflow 3 (Meeting Lifecycle)
├── Approval / process?
│ └── Workflow 4 (Approval-Driven)
├── Data analysis / pipeline?
│ └── Workflow 5 (Data Pipeline)
├── Cross-platform (needs DingTalk/WeCom)?
│ └── Delegate to china-im-workflow-cli
└── Novel combination?
└── Compose from domain primitives below
Domain Primitives (Compose Your Own Workflows)
When the templates don't fit, compose from these primitives:
Input Primitives (Data Collection)
lark base record list→ Structured data from tableslark sheet read→ Tabular data from spreadsheetslark calendar event list→ Schedule datalark task list→ Task status datalark mail list→ Email datalark message list→ Chat historylark doc content→ Document content
Processing Primitives (Data Transformation)
lark base record update/add→ Store processed datalark sheet write→ Write analysis resultslark md convert→ Format transformation
Output Primitives (Distribution)
lark doc create + content→ Generate documentslark slide create + add→ Generate presentationslark mail send→ Email distributionlark message send→ Chat notificationlark task create→ Create action itemslark calendar event create→ Schedule follow-ups
Trigger Primitives (Automation Hooks)
lark approval list --status→ Approval state changelark calendar event list→ Upcoming eventslark task list --status→ Task state changelark vc events→ Meeting events
Advanced Patterns
Pattern: Conditional Branching
# Check condition first
overdue=$(lark task list --status overdue --format json | jq 'length')
if [ "$overdue" -gt 0 ]; then
# Escalation path
lark message send --chat \x3Cmanager_chat> --text "⚠️ $overdue 个任务逾期"
dws ding send --users "manager" --text "请关注逾期任务" # Cross-platform if needed
else
# Normal path
lark message send --chat \x3Cteam_chat> --text "✅ 所有任务按时完成"
fi
Pattern: Batch Operations
# Process multiple records from Base
records=$(lark base record list --app \x3Cbase_id> --table \x3Ctable_id> --format json)
echo "$records" | jq -c '.[]' | while read record; do
id=$(echo "$record" | jq -r '.id')
# Process each record
lark base record update --app \x3Cbase_id> --table \x3Ctable_id> \
--id "$id" --data '{"processed":true}'
done
Pattern: Error Recovery
# Try primary action, fall back to alternative
if ! lark doc content --token \x3Ctoken> --write "content"; then
# Fallback: create new doc if write fails
lark doc create --title "Fallback Report" --folder \x3Cfolder>
lark message send --chat \x3Cchat_id> --text "⚠️ 原文档写入失败,已创建新文档"
fi
Safety Rules
- Preview before send: Use
--dry-runwhen available - Confirm destructive actions: Deleting docs/records/tasks requires explicit user confirmation
- Rate limiting: Max 20 API calls per minute; batch operations with
sleep 3between iterations - Auth check: Always run
lark auth statusbefore starting workflows - Idempotency: Design workflows to be safely re-runnable (check before create)
- Error isolation: If one step fails, log the error and continue with remaining steps
- Data validation: Verify data exists before processing (empty Base/Sheet → skip, don't fail)
Prerequisites Check
Before starting any workflow:
# Check CLI is installed and up to date
which lark && lark --version || echo "Install: npm install -g @larksuite/cli"
# Check auth
lark auth status
# Verify required domains are accessible
lark doc list --limit 1 2>/dev/null && echo "✅ Docs" || echo "❌ Docs"
lark base list --limit 1 2>/dev/null && echo "✅ Base" || echo "❌ Base"
lark calendar list --limit 1 2>/dev/null && echo "✅ Calendar" || echo "❌ Calendar"
Version Awareness
- v1.0.29+: VC domain (agent meeting join/leave/events)
- v1.0.30+: Slides domain (create/manage presentations)
- v1.0.35+: Mail fuzzy match for unknown flags
- v1.0.40+: Latest stable with all 17 domains
Always check lark --version and refer to the changelog for domain availability.
Cross-Platform Escalation
When a workflow needs to reach beyond Feishu (DingTalk/WeCom), delegate to the china-im-workflow-cli skill which handles cross-platform orchestration. Common escalation scenarios:
- Stakeholders on DingTalk → use
dws ding send - External customers on WeCom → use
wecom message send - Cross-platform task sync → use china-im-workflow-cli Workflow 2
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install feishu-workflow-cli - 安装完成后,直接呼叫该 Skill 的名称或使用
/feishu-workflow-cli触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Feishu Workflow CLI 是什么?
Orchestrate complex Feishu/Lark workflows using the official lark CLI (v1.0.40+, 200+ commands, 17 domains). Teach AI agents when and how to chain lark CLI c... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 21 次。
如何安装 Feishu Workflow CLI?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install feishu-workflow-cli」即可一键安装,无需额外配置。
Feishu Workflow CLI 是免费的吗?
是的,Feishu Workflow CLI 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Feishu Workflow CLI 支持哪些平台?
Feishu Workflow CLI 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Feishu Workflow CLI?
由 lm203688(@lm203688)开发并维护,当前版本 v1.0.0。