{"id":47590072,"url":"https://github.com/foxzool/openlark","last_synced_at":"2026-04-05T16:01:32.697Z","repository":{"id":232387567,"uuid":"784210473","full_name":"foxzool/openlark","owner":"foxzool","description":"飞书开放平台的非官方 Rust SDK，支持自定义机器人、长连接机器人、云文档、飞书卡片、消息、群组等 API 调用。","archived":false,"fork":false,"pushed_at":"2026-03-28T02:46:37.000Z","size":406569,"stargazers_count":77,"open_issues_count":6,"forks_count":22,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-28T07:57:16.036Z","etag":null,"topics":["feishu","feishu-bot","feishu-sdk","lark","lark-bot","lark-sdk","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/foxzool.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2024-04-09T12:05:55.000Z","updated_at":"2026-03-28T00:04:38.000Z","dependencies_parsed_at":"2024-04-09T16:25:06.722Z","dependency_job_id":"75b7dd9b-8383-40b9-89d2-6d661dd8c7dd","html_url":"https://github.com/foxzool/openlark","commit_stats":null,"previous_names":["foxzool/open-lark","foxzool/openlark"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/foxzool/openlark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxzool%2Fopenlark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxzool%2Fopenlark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxzool%2Fopenlark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxzool%2Fopenlark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foxzool","download_url":"https://codeload.github.com/foxzool/openlark/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxzool%2Fopenlark/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31290537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["feishu","feishu-bot","feishu-sdk","lark","lark-bot","lark-sdk","rust"],"created_at":"2026-04-01T17:14:43.643Z","updated_at":"2026-04-05T16:01:32.690Z","avatar_url":"https://github.com/foxzool.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![crates.io](https://img.shields.io/crates/v/openlark)](https://crates.io/crates/openlark)\n[![MIT/Apache 2.0](https://img.shields.io/badge/license-MIT%2FApache-blue.svg)](https://github.com/foxzool/openlark#license)\n[![Quality](https://github.com/foxzool/openlark/actions/workflows/quality.yml/badge.svg)](https://github.com/foxzool/openlark/actions/workflows/quality.yml)\n[![Documentation](https://docs.rs/openlark/badge.svg)](https://docs.rs/openlark)\n\n# 飞书开放平台非官方SDK - 企业级高覆盖率Rust实现\n\n\u003e 🏗️ 19 个业务模块，1,560+ 个 API，企业级质量保证。\n\u003e\n\u003e 🎯 测试覆盖率 ~47%，已通过工作区 check/test，全模块 Builder 模式统一。\n\n支持自定义机器人、长连接机器人、云文档、飞书卡片、消息、群组、招聘管理等API调用。\n\n## 🚀 快速开始\n\n### 1. 添加依赖\n\n在您的 `Cargo.toml` 中添加：\n\n```toml\n[dependencies]\nopenlark = { version = \"0.15.0\", default-features = false, features = [\"auth\"] }\n```\n\n### 2. 选择功能组合\n\n**默认配置**（仅认证能力）：\n```toml\nopenlark = \"0.15.0\"\n```\n\n**推荐业务开发**：\n```toml\nopenlark = { version = \"0.15.0\", default-features = false, features = [\"auth\", \"communication\"] }\n```\n\n**按需选择**：\n```toml\n# 文档协作：多维表格 + Sheets helper\nopenlark = { version = \"0.15.0\", default-features = false, features = [\"auth\", \"docs-bitable\"] }\n\n# 云盘上传/文件夹遍历\nopenlark = { version = \"0.15.0\", default-features = false, features = [\"auth\", \"docs-drive\"] }\n\n# 自定义机器人卡片 + 签名\nopenlark = { version = \"0.15.0\", default-features = false, features = [\"webhook-card\", \"webhook-signature\"] }\n\n# 通讯 + 文档组合\nopenlark = { version = \"0.15.0\", default-features = false, features = [\"auth\", \"communication\", \"docs-bitable\"] }\n\n# 文档全量能力\nopenlark = { version = \"0.15.0\", default-features = false, features = [\"auth\", \"docs-full\"] }\n```\n\n### 2.1 选择平台 Endpoint\n\nOpenLark 默认使用国内飞书开放平台 endpoint：\n\n- 国内飞书：`https://open.feishu.cn`\n- 国际版 Lark：`https://open.larksuite.com`\n\n两者的 API 路径结构保持一致，通常都是 `/open-apis/...`，切换时只需要修改 `base_url`。\n\n### 2.2 配置 Endpoint\n\n可以通过构建器或环境变量切换：\n\n```rust,no_run\nuse open_lark::prelude::*;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let _client = Client::builder()\n        .app_id(\"your_app_id\")\n        .app_secret(\"your_app_secret\")\n        .base_url(\"https://open.larksuite.com\")\n        .build()?;\n\n    Ok(())\n}\n```\n\n```bash\nexport OPENLARK_BASE_URL=\"https://open.larksuite.com\"\n```\n\n### 3. 基础使用\n\n```rust,no_run\nuse open_lark::prelude::*;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let client = Client::builder()\n        .app_id(\"your_app_id\")\n        .app_secret(\"your_app_secret\")\n        .build()?;\n\n    // 自动分页读取文件夹子项\n    let children = client\n        .docs\n        .list_folder_children_all(\"folder_token\", Some(\"sheet\"))\n        .await?;\n    println!(\"文件夹子项数量: {}\", children.len());\n\n    // 按标题查找工作表并批量读取范围\n    let sheet = client\n        .docs\n        .find_sheet_by_title(\"spreadsheet_token\", \"汇总表\")\n        .await?;\n    let ranges = client\n        .docs\n        .read_multiple_ranges(\n            \"spreadsheet_token\",\n            vec![format!(\"{}!A1:C10\", sheet.sheet_id)],\n        )\n        .await?;\n    println!(\"读取范围数量: {}\", ranges.value_ranges.len());\n\n    // 多维表格全量读取\n    let records = client\n        .docs\n        .search_bitable_records_all(\"app_token\", \"table_id\")\n        .await?;\n    println!(\"记录数量: {}\", records.len());\n\n    Ok(())\n}\n```\n\n对应的可编译示例见 `examples/01_getting_started/readme_quick_start.rs`。\n\n## 🔄 架构重构\n\n### 重构原因\n\n本次重构旨在将项目从早期快速开发模式升级为企业级 SDK 架构：\n\n| 目标 | 说明 |\n|------|------|\n| **🔗 统一 API 调用模式** | 将散乱的 API 实现统一为 Builder 模式，提供一致的开发体验 |\n| **🚪 单入口架构** | 实现 ServiceRegistry 统一服务注册，所有服务通过 `Client` 单入口访问 |\n| **📦 模块化设计** | 按业务领域拆分为独立 crates（通讯、文档、HR、会议等），支持按需引入 |\n| **🧹 技术债务清理** | 清理过时模块、简化 trait 系统、移除死代码和硬编码 URL |\n\n### 重构进度\n\n| 模块 | 状态 | API 数量 | 说明 |\n|------|------|---------|------|\n| openlark-core | ✅ 完成 | - | 核心基础设施，HTTP 客户端，错误处理 |\n| openlark-client | ✅ 完成 | - | 单入口架构，ServiceRegistry |\n| openlark-protocol | ✅ 完成 | - | WebSocket 协议 |\n| openlark-auth | ✅ 完成 | 15 | Token 管理，认证服务 |\n| openlark-hr | ✅ 完成 | 562 | 招聘、CoreHR、考勤、薪酬等 |\n| openlark-docs | ✅ 完成 | 158 | 云文档、多维表格、知识库、会议纪要 |\n| openlark-communication | ✅ 完成 | 175 | IM 消息、联系人、群组 |\n| openlark-workflow | ✅ 完成 | 117 | 任务、审批、看板 |\n| openlark-meeting | ✅ 完成 | 117 | 视频会议、日历 |\n| openlark-platform | ✅ 完成 | 102 | 平台服务、Transport API |\n| openlark-application | ✅ 完成 | 83 | 应用管理 |\n| openlark-mail | ✅ 完成 | 68 | 邮件服务 |\n| openlark-helpdesk | ✅ 完成 | 56 | 帮助台 |\n| openlark-security | ✅ 完成 | 38 | 安全服务 |\n| openlark-ai | ✅ 完成 | 29 | AI 智能助手 |\n| openlark-analytics | ✅ 完成 | 20 | 数据分析 |\n| openlark-cardkit | ✅ 完成 | 10 | 卡片组件 |\n| openlark-webhook | ✅ 完成 | 8 | 自定义机器人、Webhook |\n| openlark-user | ✅ 完成 | 9 | 用户设置 |\n\n### 新架构特点\n\n```rust\n// 根 crate 单入口\nlet client = Client::from_env()?;\n\n// 文档 helper\nclient.docs.list_folder_children_all(\"folder_token\", None).await?;\nclient.docs.find_sheet_by_title(\"spreadsheet_token\", \"汇总表\").await?;\n\n// 通讯模块\nlet endpoint = open_lark::communication::endpoints::IM_V1_MESSAGES;\nprintln!(\"{}\", endpoint);\n```\n\n- **🔗 单入口访问** - 从 `Client` 出发，按 feature 打开需要的能力\n- **🛡️ 类型安全** - 编译时验证所有 API 调用参数\n- **⚡ 按需编译** - 50+ feature flags 支持按需引入功能\n- **🏢 企业级质量** - 零警告构建，严格 clippy 检查\n\n## 📖 文档和资源\n\n- **[openlark-docs AGENTS.md](crates/openlark-docs/AGENTS.md)** - 文档服务模块知识库\n- **[快速启动示例](examples/)** - 完整功能演示示例集\n\n## ​​📊 项目状态\n\n- 核心模块稳定 - openlark-core、openlark-client、openlark-auth 生产就绪\n- 功能模块持续完善 - 各业务模块 API 持续补充中\n- 测试覆盖率 ~47% - 核心模块完整测试覆盖\n\n**已完成**：\n- ✅ 核心基础设施（core、client、protocol、auth）\n- ✅ 18 个业务模块全部实现，共 1,560+ 个 API\n- ✅ openlark-hr 562 个 API（招聘、CoreHR、考勤、薪酬）\n- ✅ openlark-communication 175 个 API\n- ✅ openlark-docs 158 个 API（云文档、多维表格、知识库）\n- ✅ openlark-workflow 117 个 API（任务、审批、看板）\n- ✅ openlark-meeting 117 个 API（视频会议、日历）\n- ✅ 链式调用架构 + Builder 模式统一\n- ✅ Feature flags 按需编译\n- ✅ 测试覆盖率 ~47%\n\n**进行中**：\n- 🔄 部分 API 结构体字段文档补充\n- 🔄 更多示例和文档完善\n\n**计划中**：\n- [ ] 更多事件处理器支持\n- [ ] WebSocket 功能完善\n\n## 🤝 贡献\n\n欢迎提交 Issue 和 Pull Request！\n\n## 📄 许可证\n\nMIT OR Apache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxzool%2Fopenlark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoxzool%2Fopenlark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxzool%2Fopenlark/lists"}