- 添加rich库依赖以改进日志显示 - 在各模块添加详细调试日志,包括消息处理、命令执行和工具调用过程 - 使用RichHandler美化日志输出并抑制第三方库的噪音日志 - 在关键路径添加日志记录,便于问题排查
PhoneWork
Feishu bot integration with Claude Code CLI.
Architecture
- Agent CLI: Claude Code (print mode)
- Chat Server: FastAPI
- Client: Feishu bot API (long-connection)
Setup
1. Feishu App
Create app at https://open.feishu.cn:
- Enable Bot capability
- Enable long-connection event subscription (no public URL needed)
- Get
FEISHU_APP_IDandFEISHU_APP_SECRET
2. LLM Endpoint
Configure OpenAI-compatible endpoint:
OPENAI_BASE_URLOPENAI_API_KEYOPENAI_MODEL
3. Claude Code CLI
- Install and authenticate
claudecommand - Ensure available in PATH
4. Configuration
cp keyring.example.yaml keyring.yaml
# Edit keyring.yaml with your credentials
5. Run
pip install -r requirements.txt
python main.py
Requirements
| Item | Notes |
|---|---|
| Python 3.11+ | Required |
| Feishu App | Bot + long-connection enabled |
| OpenAI-compatible LLM | API endpoint and key |
| Claude Code CLI | Installed + authenticated |
Description
Languages
Python
100%