Install
openclaw skills install feishu-masterAI Tool Extension for Feishu API - A progressively extensible skill that enables AI tools (OpenClaw, Claude Code, etc.) to leverage Feishu capabilities on-de...
openclaw skills install feishu-masterA progressively extensible skill designed for AI tools to leverage Feishu capabilities. The core philosophy is implement only what you need, when you need it.
You MUST update scripts/script_index.json immediately after creating any new script.
Failure to update the index will cause:
Action required: Add an entry to scripts/script_index.json with fields: name, description, usage_hint, added_date, tags
This skill is designed specifically for AI tools, not for human manual use.
When an AI tool receives a task involving Feishu:
scripts/script_index.json for already-implemented APIsThis approach ensures:
This skill works out of the box once authentication is configured:
# Configure authentication (one-time setup)
cd scripts/env
echo '{"app_id": "your_app_id", "app_secret": "your_app_secret"}' > app.json
When AI encounters a Feishu-related task, follow this decision tree:
Step 1: Check index file
Read scripts/script_index.json
Search by: description, tags
If match found:
python3 script.py --help to understand parametersIf NO match found:
Library: open.feishu.cn / larksuite
Query: "[specific requirement, e.g., 如何获取群组成员列表]"
scripts/script_index.json to add the new scriptIf execution fails:
references/doc_urls.txt to consult documentationWhen deciding between "use existing" vs "implement new", consider:
scripts/script_index.json structure:
{
"version": "1.0",
"last_updated": "2026-02-12T12:00:00Z",
"scripts": [
{
"name": "get_group_members",
"description": "获取指定群组的人员列表",
"usage_hint": "python3 get_group_members.py <open_chat_id>",
"added_date": "2026-02-12",
"tags": ["group", "member", "user"]
}
]
}
Key fields for AI search:
description: Human-readable explanation of functionalitytags: Array of keywords for matching (prioritize these for fuzzy matching)Configuration file: scripts/env/app.json
{
"app_id": "cli_xxxxxxxxxxxxxxxx",
"app_secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
To obtain credentials:
Token management: get_token.py handles token lifecycle:
scripts/env/token_cache.jsonWhen implementing new APIs, use this template:
#!/usr/bin/env python3
"""
[Complete functional description]
Usage:
python3 script.py <param1> <param2> [options]
Parameters:
param1: Parameter description
param2: Parameter description
Options:
--page-size: Page size (default: 20)
--page-token: Pagination token
Output:
JSON format output:
{
"code": 0,
"msg": "success",
"data": { ... }
}
References:
Feishu API: https://open.feishu.cn/document/...
"""
import sys
import json
import subprocess
from pathlib import Path
import requests
# Configuration
TOKEN_SCRIPT = Path(__file__).parent / "get_token.py"
BASE_URL = "https://open.feishu.cn"
def get_token():
"""Get Feishu access token"""
result = subprocess.run(
[sys.executable, str(TOKEN_SCRIPT)],
capture_output=True,
text=True,
check=True
)
return result.stdout.strip()
def api_function(param1, param2, token, **kwargs):
"""API call function"""
headers = {"Authorization": f"Bearer {token}"}
# ... implement API call
pass
def main():
# Handle --help
if "--help" in sys.argv or "-h" in sys.argv:
print(__doc__)
return
# Parse required parameters
if len(sys.argv) < 3:
print(__doc__, file=sys.stderr)
sys.exit(1)
param1 = sys.argv[1]
param2 = sys.argv[2]
kwargs = {}
# Parse optional parameters
for i in range(3, len(sys.argv)):
if sys.argv[i].startswith("--"):
key = sys.argv[i][2:].replace("-", "_")
i += 1
if i < len(sys.argv):
kwargs[key] = sys.argv[i]
# Get token
token = get_token()
# Call API
result = api_function(param1, param2, token, **kwargs)
# Output JSON
print(json.dumps(result, indent=2, ensure_ascii=False))
if __name__ == "__main__":
main()
Development standards:
scripts/script_index.json immediately--help parameterget_token.py for authenticationWhen implementing a new API, you MUST complete ALL steps:
scripts/script_index.json ← Don't forget this!references/doc_urls.txtWhen implementing new APIs, query Feishu documentation via Context7:
Library ID: open.feishu.cn / larksuite
Query examples:
- "如何获取群组成员列表"
- "发送消息到飞书群组的 API 使用方法"
- "飞书文档操作的 OpenAPI"
Why Context7?
User request: "Get the member list for group oc_xxxxxxxxxxxxx"
AI decision process:
scripts/script_index.json → Found match: get_group_memberspython3 scripts/get_group_members.py oc_xxxxxxxxxxxxxUser request: "Delete a message from the group"
AI decision process:
scripts/script_index.json → No matchmessage/delete endpointdelete_message.py scriptscripts/script_index.json with new entry - DO NOT skip this!Why step 6 is critical:
delete_message.py in the index