Lark CLI - Lark/Feishu Open Platform Integration
A command-line tool for Lark/Feishu Open Platform with 200+ commands and AI Agent Skills covering Calendar, Messenger, Docs, Base, Sheets, Slides, Tasks, Mail, Meetings, and more.
Installation
The Lark CLI is automatically installed in the sandbox via npm:
npm install -g @larksuite/cli@1.0.93
Authentication
User Mode (OAuth)
For user-level operations, use OAuth login:
# Interactive login with recommended scopes
lark-cli auth login --recommend
# Login with specific domain scopes
lark-cli auth login --domain calendar,messenger
# Check authentication status
lark-cli auth status
Bot Mode (App ID/Secret)
For bot-level operations, configure App ID and Secret through middleware config. The credentials are securely provisioned in the sandbox.
Available Skills
The following skills are downloaded from the larksuite/cli GitHub repository:
lark-shared- App config, auth login, identity switching (auto-loaded)lark-calendar- Calendar events, agenda, free/busy querieslark-im- Send/reply messages, group chat managementlark-doc- Create, read, update documentslark-drive- Upload, download files, manage permissionslark-sheets- Create, read, write spreadsheetslark-slides- Plan, create, validate, inspect, and edit native Feishu presentationslark-base- Tables, fields, records, dashboardslark-task- Tasks, task lists, subtaskslark-mail- Browse, search, send emailslark-contact- Search users, get profileslark-wiki- Knowledge spaces, nodeslark-event- Real-time event subscriptionslark-vc- Meeting records, minuteslark-whiteboard- Whiteboard/chart renderinglark-minutes- Meeting minutes metadatalark-openapi-explorer- Explore underlying APIslark-skill-maker- Custom skill creationlark-workflow-meeting-summary- Meeting summary workflowlark-workflow-standup-report- Standup report workflow
Usage Examples
Calendar
# View today's agenda
lark-cli calendar +agenda
# Create an event
lark-cli calendar +create --title "Team Meeting" --start "2024-01-15T10:00:00" --end "2024-01-15T11:00:00"
Messenger
# Send a message to a chat
lark-cli im +messages-send --chat-id "oc_xxx" --text "Hello from AI Agent!"
# List recent chats
lark-cli im +chats
Documents
# Create a document
lark-cli doc +create --title "Weekly Report" --markdown "# Progress\n- Completed feature X"
# Read a document
lark-cli doc +read --doc-id "doxcn_xxx"
Sheets
# Read spreadsheet data
lark-cli sheets +read --spreadsheet-token "shtcn_xxx" --range "A1:D10"
# Write data to a sheet
lark-cli sheets +write --spreadsheet-token "shtcn_xxx" --range "A1" --values '[["Name", "Value"], ["Test", "123"]]'
Slides / PPT
Before creating or editing a presentation, read lark-slides/SKILL.md and every operation-specific reference it requires. For new decks and major rewrites, follow the complete planning and validation workflow:
- Create
.lark-slides/plan/<deck-id>/slide_plan.json. - Generate one complete SML
<slide>XML file per page. - Run
lark-slides/scripts/xml_lint.py; publish only whensummary.error_countis zero. - Create or update the deck with
lark-cli slidesusing--as userby default. - Read the deck back with
slides +xml-get, validate it, and useslides +screenshotwhen available before returning the Feishu link.
lark-cli auth login --domain slides
lark-cli slides +create --as user --title "Project update" --slide @.lark-slides/plan/project/slide-01.xml
lark-cli slides +xml-get --as user --presentation <xml_presentation_id> --output .lark-slides/plan/project/readback.xml
The Slides skill guides the Agent and lark-cli executes official Open Platform operations. It does not invoke Feishu's private Doubao PPT product or the Feishu template gallery.
For a finished presentation that also needs a local copy, use lark-cli drive +export with
.pptx and save the result inside the current sandbox working directory. Return the
sandbox-relative path together with the Feishu Slides link. No Xpert workspace import is needed
for this workflow.
Identity Switching
Execute commands as user or bot:
# As user (default)
lark-cli calendar +agenda --as user
# As bot
lark-cli im +messages-send --as bot --chat-id "oc_xxx" --text "Bot message"
Output Formats
# JSON output (default)
lark-cli calendar +agenda --format json
# Table format
lark-cli calendar +agenda --format table
# CSV format
lark-cli sheets +read --spreadsheet-token "xxx" --format csv
Dry Run
Preview operations before executing:
lark-cli im +messages-send --chat-id "oc_xxx" --text "Test" --dry-run
Troubleshooting
auth loginrequired: Runlark-cli auth login --recommendfirst- Permission denied: Check if the required scopes are granted
- Command not found: Ensure
@larksuite/cliis installed globally - Network issues: Check internet connectivity for API calls
Security Notes
- Credentials are securely stored in the OS keychain
- Bot credentials are provisioned via secure file upload
- Never hardcode secrets in commands
- Use
--dry-runfor potentially destructive operations