ai_member_xiaobian/TOOLS.md
2026-05-15 10:57:05 +08:00

57 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# TOOLS.md - 环境配置备注
## 飞书应用配置
### Bot 凭证
- **应用名称:** 小编xiaobian
- **App ID** cli_a9311be796f85cbd
- **凭证位置:** `/root/.openclaw/credentials/xiaobian/config.json`
- **权限范围:** 消息收发、知识库读取、文档读写、电子表格读写
- **Bot身份调用方式** `LARKSUITE_CLI_CONFIG_DIR=/root/.openclaw/credentials/xiaobian lark-cli <command> --as bot`
### 辅助凭证(读取知识库用)
- **应用名称:** 小研xiaoyan
- **App ID** cli_a931175d41799cc7
- **凭证位置:** `/root/.openclaw/credentials/xiaoyan/config.json`
- **用途:** 知识库文档读取(部分知识空间仅对小研授权)
### 飞书CLI版本
- **lark-cli** v1.0.27
- **官方Skills位置** `~/.openclaw/workspace-xiaobian/.agents/skills/lark-*`24个官方技能
## 飞书电子表格读取
直接通过飞书 Sheets V2 API + Bot身份的 `tenant_access_token` 调用:
```bash
# 获取token
APP_ID=$(jq -r '.apps[0].appId' /root/.openclaw/credentials/xiaoyan/config.json)
APP_SECRET=$(jq -r '.apps[0].appSecret' /root/.openclaw/credentials/xiaoyan/config.json)
TOKEN=$(curl -s -X POST "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal" \
-H "Content-Type: application/json" \
-d "{\"app_id\":\"$APP_ID\",\"app_secret\":\"$APP_SECRET\"}" | jq -r '.tenant_access_token')
# 获取表格元数据
curl -s "https://open.feishu.cn/open-apis/sheets/v2/spreadsheets/<TOKEN>/metainfo" -H "Authorization: Bearer $TOKEN"
# 读取数据
curl -s "https://open.feishu.cn/open-apis/sheets/v2/spreadsheets/<TOKEN>/values/<sheetId>!A1:Z50" -H "Authorization: Bearer $TOKEN"
```
## Office 文档处理
- **工具:** office-document-specialist-suiteskills/office-document-specialist-suite/
- **依赖:** python-docx 1.2.0, openpyxl 3.1.5, python-pptx 1.0.2
- **虚拟环境:** `skills/office-document-specialist-suite/.venv/`
- **激活方式:** `source skills/office-document-specialist-suite/.venv/bin/activate`
## 密钥存储
- **位置:** `/root/.openclaw/workspace-xiaobian/secrets.md`
- **规则:** 所有密钥/Token仅存于此文件禁止在其他文件中出现
## 安全提示
- 所有飞书操作使用Bot身份禁止触发用户授权
- 数据库操作默认只读
- 外部API密钥管理由技术负责人负责