feishu-integration
2
总安装量
1
周安装量
#72326
全站排名
安装命令
npx skills add https://github.com/etzhang/openclaw-skills --skill feishu-integration
Agent 安装分布
amp
1
cline
1
openclaw
1
opencode
1
cursor
1
kimi-cli
1
Skill 文档
Feishu Integration
OpenClaw ä¸é£ä¹¦ï¼Feishu/Larkï¼çéææè½ï¼æ¯æææ¡£ç®¡çãæä»¶å¤¹æä½åæéæ¥è¯¢ã
Features
- ð ææ¡£ç®¡ç – å建ã读åãæ´æ°ãå é¤é£ä¹¦ææ¡£
- ð æä»¶å¤¹æä½ – ååºææ¡£ååæä»¶å¤¹
- ð æéæ¥è¯¢ – æ¥è¯¢åºç¨æéèå´
- âï¸ å 容ç¼è¾ – 追å ãæ´æ°ãå é¤ææ¡£å
- ð åæä½ – è·ååæä½ææ¡£ç»æ
Available Tools
| Tool | Description |
|---|---|
feishu_doc_read |
è¯»åææ¡£çº¯ææ¬å 容åå æ°æ® |
feishu_doc_create |
å建æ°ç©ºç½ææ¡£ |
feishu_doc_write |
åå ¥Markdownå 容ï¼è¦çï¼ |
feishu_doc_append |
追å Markdownå 容尿«å°¾ |
feishu_doc_update_block |
æ´æ°ç¹å®åçææ¬å 容 |
feishu_doc_delete_block |
å é¤ç¹å®å |
feishu_doc_list_blocks |
ååºææ¡£ææåï¼è·åç»æï¼ |
feishu_doc_get_block |
è·åç¹å®åç详ç»å 容 |
feishu_folder_list |
ååºæä»¶å¤¹ä¸çææ¡£ååæä»¶å¤¹ |
feishu_app_scopes |
ååºå½ååºç¨æéèå´ |
Setup
1. Create Feishu App
- Go to Feishu Open Platform
- Create a new application
- Get App ID and App Secret
- Enable required permissions:
docx:document– Document read/writedocx:folder– Folder accessapproval:instance– Approval (optional)
2. Configure Credentials
Create .env file in the skill directory:
# Feishu App Credentials
FEISHU_APP_ID=your_app_id_here
FEISHU_APP_SECRET=your_app_secret_here
# Optional: Custom API endpoint
FEISHU_API_BASE_URL=https://open.feishu.cn/open-apis
Or set environment variables:
export FEISHU_APP_ID="your_app_id"
export FEISHU_APP_SECRET="your_app_secret"
3. Install Dependencies
cd feishu-integration
pip install -r requirements.txt # If needed
Usage
Create a New Document
from openclaw.tools import feishu_doc_create
result = feishu_doc_create(
folder_token="optional_parent_folder_token",
title="My New Document"
)
doc_token = result.doc_token
Read Document Content
from openclaw.tools import feishu_doc_read
result = feishu_doc_read(
doc_token="your_document_token"
)
# Returns: plain text content and metadata
Write Content
from openclaw.tools import feishu_doc_write
feishu_doc_write(
doc_token="your_document_token",
content="# Hello World\n\nThis is a **Feishu** document!"
)
Append Content
from openclaw.tools import feishu_doc_append
feishu_doc_append(
doc_token="your_document_token",
content="## Additional Section\n\nMore content here."
)
Update a Block
from openclaw.tools import feishu_doc_update_block
feishu_doc_update_block(
doc_token="your_document_token",
block_id="block_id_from_list_blocks",
content="Updated text content"
)
List Document Blocks
from openclaw.tools import feishu_doc_list_blocks
result = feishu_doc_list_blocks(
doc_token="your_document_token"
)
# Returns: list of all blocks with their IDs
List Folder Contents
from openclaw.tools import feishu_folder_list
result = feishu_folder_list(
folder_token="your_folder_token"
)
# Returns: documents and subfolders in the folder
Check App Permissions
from openclaw.tools import feishu_app_scopes
result = feishu_app_scopes()
# Returns: list of available permissions/scopes
Document Structure
Feishu documents are block-based. Common block types:
paragraph– ææ¬æ®µè½heading1– ä¸çº§æ é¢heading2– äºçº§æ é¢heading3– ä¸çº§æ é¢bullet– æ åºå表ordered– æåºå表code– 代ç åquote– å¼ç¨table– è¡¨æ ¼image– å¾ç
Best Practices
-
Security First
- Never commit
.envor credentials - Use
.gitignoreto exclude sensitive files - Rotate app secrets periodically
- Never commit
-
Error Handling
- Check
resultfor success status - Handle rate limits gracefully
- Log errors for debugging
- Check
-
Content Format
- Use Markdown for content
- Note: Tables not supported in write/append
- Use blocks API for complex structures
-
Rate Limits
- Respect Feishu API rate limits
- Implement backoff for retries
- Cache frequently accessed data
Example Workflow
# Create a meeting notes document
from openclaw.tools import (
feishu_doc_create,
feishu_doc_write,
feishu_doc_append
)
# 1. Create new document
doc = feishu_doc_create(title="Meeting Notes - 2024-01-15")
# 2. Write initial content
feishu_doc_write(
doc_token=doc.doc_token,
content="# Team Meeting\n\n## Attendees\n- Alice\n- Bob\n- Charlie\n\n## Agenda\n1. Project updates\n2. Q1 planning"
)
# 3. Append action items
feishu_doc_append(
doc_token=doc.doc_token,
content="## Action Items\n- [ ] Review PR #123 (Alice)\n- [ ] Update documentation (Bob)"
)
print(f"Document created: https://example.feishu.cn/docx/{doc.doc_token}")
Troubleshooting
“App not found” Error
- Verify App ID and Secret are correct
- Check app is published (not in draft mode)
“Permission denied” Error
- Check required permissions are enabled
- Verify tenant-level consent if needed
“Rate limit exceeded” Error
- Implement exponential backoff
- Reduce API call frequency
Document not updating
- Check block_id is valid
- Ensure content format is correct
- Verify document hasn’t been deleted
Resources
License
MIT