Lark CLI (飞书 CLI)
Website: https://www.larksuite.com CLI Tool: lark-cli NPM Package: @larksuite/cli Repository: https://github.com/larksuite/cli License: MIT
Description
Official command-line tool for Lark/Feishu Open Platform, built for humans and AI Agents. Covers 11 core business domains including Messenger, Docs, Base, Sheets, Calendar, Mail, Tasks, Meetings, and more. Features 200+ commands and 19 AI Agent Skills. Agent-native design with structured output optimized for AI tool calling.
Install
# Install CLI
npm install -g @larksuite/cli
# Install all Skills (required for AI agents)
npx skills add larksuite/cli --all -y -g
Setup
# 1. Configure app credentials (interactive, opens browser)
lark-cli config init --new
# 2. Login with recommended scopes
lark-cli auth login --recommend
# 3. Verify
lark-cli auth status
Commands
| Command | Description |
|---|---|
lark-cli auth login |
OAuth login |
lark-cli auth logout |
Sign out |
lark-cli auth status |
Show login status |
lark-cli calendar +agenda |
View calendar agenda |
lark-cli im +messages-send |
Send message |
lark-cli docs +create |
Create document |
lark-cli base +records |
Query Base records |
lark-cli sheets +read |
Read spreadsheet |
lark-cli mail +list |
List emails |
lark-cli task +list |
List tasks |
lark-cli contact +search |
Search contacts |
Skills (19 total)
| Skill | Description |
|---|---|
lark-shared |
Auth, config, identity (auto-loaded) |
lark-calendar |
Calendar events, agenda, free/busy |
lark-im |
Messages, group chats, reactions |
lark-doc |
Create/read/update documents |
lark-drive |
Upload/download files |
lark-sheets |
Spreadsheet operations |
lark-base |
Tables, records, views, dashboards |
lark-task |
Tasks, subtasks, reminders |
lark-mail |
Email read/send/reply |
lark-contact |
User search, profiles |
lark-wiki |
Knowledge spaces |
lark-vc |
Meeting records, minutes |
Examples
Send Message
# Send text to a chat
lark-cli im +messages-send --chat-id "oc_xxx" --text "Hello"
# Send as bot
lark-cli im +messages-send --as bot --chat-id "oc_xxx" --text "Bot message"
Calendar
# View today's agenda
lark-cli calendar +agenda
# Create event
lark-cli calendar +create --title "Meeting" --start "2024-01-15 10:00"
Documents
# Create doc with markdown
lark-cli docs +create --title "Weekly Report" --markdown "# Progress\n- Done X"
# Read document
lark-cli docs +read --doc-id "doccnXXX"
Base (多维表格)
# List records
lark-cli base +records --app-token "appXXX" --table-id "tblXXX"
# Create record
lark-cli base +record-create --app-token "appXXX" --table-id "tblXXX" --fields '{"Name":"Test"}'
Sheets
# Read spreadsheet data
lark-cli sheets +read --spreadsheet-id "shtcnXXX" --range "Sheet1!A1:D10"
# Append data
lark-cli sheets +append --spreadsheet-id "shtcnXXX" --range "Sheet1" --values '[["A","B"]]'
# List recent emails
lark-cli mail +list
# Send email
lark-cli mail +send --to "user@example.com" --subject "Hello" --body "Content"
Contact Search
# Search user by name
lark-cli contact +search --query "张三"
AI Agent Integration
Lark CLI is designed for AI agents like Claude Code, Cursor, OpenCode, OpenClaw.
# Install for AI agent use
npm install -g @larksuite/cli
npx skills add larksuite/cli --all -y -g
# Configure (agent extracts URL for user)
lark-cli config init --new
# Login (agent extracts URL for user)
lark-cli auth login --recommend
After setup, agents can directly operate Lark: - Send personalized messages to contacts - Query and analyze Base data - Create documents and reports - Schedule calendar events - Process emails
Notes
- Restart required: After installing skills, restart your AI agent (Claude Code, etc.)
- Identity switching: Use
--as useror--as botto switch identity - Scopes: Use
--domain calendar,taskto filter login scopes - Error handling: Returns actionable error messages with fix suggestions for AI retry
- Security: Credentials stored in OS-native keychain
Comments (0)
Add a Comment
No comments yet. Be the first to comment!