@lark-people/cli 0.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/CHANGELOG.md +324 -0
  2. package/LICENSE +21 -0
  3. package/README.md +232 -0
  4. package/README.zh.md +232 -0
  5. package/bin/people-cli_darwin_amd64 +0 -0
  6. package/bin/people-cli_darwin_arm64 +0 -0
  7. package/bin/people-cli_linux_amd64 +0 -0
  8. package/bin/people-cli_linux_arm64 +0 -0
  9. package/bin/people-cli_windows_amd64.exe +0 -0
  10. package/bin/people-cli_windows_arm64.exe +0 -0
  11. package/package.json +41 -0
  12. package/scripts/install-wizard.js +700 -0
  13. package/scripts/install.js +56 -0
  14. package/scripts/run.js +36 -0
  15. package/skills/people-attendance/SKILL.md +667 -0
  16. package/skills/people-attendance/references/people-attendance-submission.md +426 -0
  17. package/skills/people-attendance/scripts/resolve_date.py +894 -0
  18. package/skills/people-corehr/references/people-corehr-pre-hire-search.md +0 -0
  19. package/skills/people-corehr-employee/SKILL.md +111 -0
  20. package/skills/people-corehr-employee/references/people-corehr-employee-basic-info-query.md +97 -0
  21. package/skills/people-corehr-employee/references/people-corehr-employee-fields-list.md +87 -0
  22. package/skills/people-corehr-employee/references/people-corehr-employee-filter.md +403 -0
  23. package/skills/people-corehr-employee/references/people-corehr-employee-search.md +73 -0
  24. package/skills/people-corehr-job-change/SKILL.md +212 -0
  25. package/skills/people-corehr-job-change/references/people-job-change-business-rules.md +113 -0
  26. package/skills/people-corehr-job-change/references/people-job-change-lookup-filters.md +82 -0
  27. package/skills/people-corehr-job-change/references/people-job-change-output-and-empty.md +207 -0
  28. package/skills/people-corehr-job-change/references/people-job-change-search-advanced.md +226 -0
  29. package/skills/people-corehr-job-change/references/people-job-change-search-fields.md +119 -0
  30. package/skills/people-corehr-job-change/references/people-job-change-search-option.md +72 -0
  31. package/skills/people-corehr-job-change/references/people-job-change-search.md +215 -0
  32. package/skills/people-corehr-offboarding/SKILL.md +188 -0
  33. package/skills/people-corehr-offboarding/references/people-corehr-offboarding-business-knowledge.md +27 -0
  34. package/skills/people-corehr-offboarding/references/people-corehr-offboarding-search-option.md +187 -0
  35. package/skills/people-corehr-offboarding/references/people-corehr-offboarding-search.md +54 -0
  36. package/skills/people-corehr-organization/SKILL.md +42 -0
  37. package/skills/people-corehr-organization/references/aggregate.md +11 -0
  38. package/skills/people-corehr-organization/references/detail.md +39 -0
  39. package/skills/people-corehr-organization/references/field-values.md +44 -0
  40. package/skills/people-corehr-organization/references/hierarchy.md +61 -0
  41. package/skills/people-corehr-organization/references/lookup.md +41 -0
  42. package/skills/people-corehr-organization/references/metadata.md +40 -0
  43. package/skills/people-corehr-organization/references/tree.md +45 -0
  44. package/skills/people-corehr-prehire/SKILL.md +160 -0
  45. package/skills/people-corehr-prehire/references/command-resolution.md +48 -0
  46. package/skills/people-corehr-prehire/references/filter-fields.md +151 -0
  47. package/skills/people-corehr-prehire/references/return-fields.md +153 -0
  48. package/skills/people-corehr-prehire/references/templates.md +202 -0
  49. package/skills/people-corehr-prehire/references/troubleshooting.md +93 -0
  50. package/skills/people-corehr-query-id-by-name/SKILL.md +154 -0
  51. package/skills/people-corehr-renewal/SKILL.md +186 -0
  52. package/skills/people-corehr-renewal/references/people-corehr-renewal-fields-query.md +62 -0
  53. package/skills/people-corehr-renewal/references/people-corehr-renewal-routing.md +54 -0
  54. package/skills/people-corehr-renewal/references/people-corehr-renewal-search.md +137 -0
  55. package/skills/people-corehr-renewal/references/people-corehr-renewal.md +39 -0
  56. package/skills/people-corehr-workforce-plan/SKILL.md +52 -0
  57. package/skills/people-corehr-workforce-plan/references/people-corehr-workforce-plan-detail-list.md +238 -0
  58. package/skills/people-corehr-workforce-plan/references/people-corehr-workforce-plan-detail-summary.md +221 -0
  59. package/skills/people-corehr-workforce-plan/references/people-corehr-workforce-plan.md +79 -0
  60. package/skills/people-hire/SKILL.md +255 -0
  61. package/skills/people-hire/references/people-hire-application.md +334 -0
  62. package/skills/people-hire/references/people-hire-evaluation-task-list.md +233 -0
  63. package/skills/people-hire/references/people-hire-evaluation.md +127 -0
  64. package/skills/people-hire/references/people-hire-interview-record.md +109 -0
  65. package/skills/people-hire/references/people-hire-interview-task-list.md +250 -0
  66. package/skills/people-hire/references/people-hire-interview.md +146 -0
  67. package/skills/people-hire/references/people-hire-job-process.md +93 -0
  68. package/skills/people-hire/references/people-hire-job-requirement.md +227 -0
  69. package/skills/people-hire/references/people-hire-job.md +277 -0
  70. package/skills/people-hire/references/people-hire-minutes.md +91 -0
  71. package/skills/people-hire/references/people-hire-talent.md +105 -0
  72. package/skills/people-hire/references/people-hire-test.md +197 -0
  73. package/skills/people-overtime/SKILL.md +992 -0
  74. package/skills/people-overtime/references/people-attendance-overtime-apply.md +491 -0
  75. package/skills/people-overtime/references/people-attendance-overtime.md +51 -0
  76. package/skills/people-overtime/references/people-attendance-submission.md +203 -0
  77. package/skills/people-overtime/scripts/resolve_date.py +894 -0
  78. package/skills/people-shared/SKILL.md +94 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,324 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [0.0.1]
6
+
7
+ 商业化首发版本(commercial first release)。仅分发预编译二进制、`skills/` 目录与安装脚本,源代码不随包投递。
8
+
9
+ ### Changed
10
+
11
+ - 元数据下发切换至公网网关,不再依赖内网地址。
12
+ - Token 仅存储于系统钥匙串(keychain),移除工作目录明文落盘模式。
13
+ - 配置仅识别全局 `~/.people-cli/` 目录,不再探测当前工作目录。
14
+
15
+ ### Removed
16
+
17
+ - 移除内部沙箱鉴权集成与相关提示。
18
+ - 移除内部运维命令(环境泳道、预发/BOE 主机覆盖、UAT 覆盖)。
19
+ - 移除内部打点上报与数据导出管控逻辑。
20
+
21
+ ## [v1.0.11] - 2026-04-29
22
+
23
+ ### Features
24
+
25
+ - **Hire 招聘域全面重构(Skill v2.0.0)**:从"面试 + 评估"两个查询场景扩展为 **8 大招聘查询场景**(评估任务、面试任务、招聘需求、职位、人才、投递、面试记录、评估记录)
26
+ - `skills/people-hire/SKILL.md` 重写(+282/-x),明确触发条件、禁用场景、字段来源(以 `people-cli schema hire.<resource>.<method>` 为准)
27
+ - 旧 reference 移除:`evaluation-task-list.md`、`interview-task-list.md`
28
+ - 新增 8 份按场景组织的 reference(均位于 `skills/people-hire/references/`):
29
+ - `skills/people-hire/references/people-hire-application.md`(投递,+104)
30
+ - `skills/people-hire/references/people-hire-evaluation.md`(评估记录,+105)
31
+ - `skills/people-hire/references/people-hire-evaluation-task-list.md`(评估任务,+301)
32
+ - `skills/people-hire/references/people-hire-interview.md`(面试记录,+110)
33
+ - `skills/people-hire/references/people-hire-interview-task-list.md`(面试任务,+306)
34
+ - `skills/people-hire/references/people-hire-job.md`(职位,+185)
35
+ - `skills/people-hire/references/people-hire-job-requirement.md`(招聘需求,+137)
36
+ - `skills/people-hire/references/people-hire-talent.md`(人才,+92)
37
+ - `shortcuts/hire/helpers.go` 扩展(+181)支撑新场景
38
+ - **QueryIDByName 重构为可复用公共能力**:从 shortcut 内聚功能提升为 `shortcuts/corehr/common` 包的公共 API
39
+ - 路径迁移(`git mv`,相似度 65%):`shortcuts/corehr/query_id_by_name.go` → `shortcuts/corehr/common/query_id_by_name.go`
40
+ - 新增 `shortcuts/corehr/common/model.go` +86:对外暴露 `QueryRequest` / `QueryIDByNameInput` / `QueryIDByNameMatch` / `QueryIDByNameItem` 等模型,供 `job_change_search` / `offboarding_search` / `employee_search` 等 shortcut 批量并发查询 ID 使用
41
+ - 新增 `Language` 字段:支持 `zh-CN` / `en-US`,可自动检测或显式指定(name-to-id by language)
42
+
43
+ ### Security / Safety
44
+
45
+ - **强约束:只能查询当前登录用户数据**:
46
+ - `skills/people-attendance/SKILL.md` 对"假期余额 / 请假记录 / 加班记录"三类场景增加 **"不支持查询其他人 / 只支持查询当前登录账号本人"** 的强提示
47
+ - Hire SKILL 同步强约束:`+interview-task-list` / `+evaluation-task-list` 禁止传入 `user_id` 等参数
48
+ - **拒绝 leave 的 create / update / delete 操作**:Attendance Skill 明确只支持查询场景,遇到"提交 / 修改 / 删除 / 撤销请假"或"修改 / 更新 / 删除假期余额"等请求直接返回"不支持",杜绝越权写操作路径
49
+
50
+ ### Changed
51
+
52
+ - **Attendance 查询约束与示例扩写**:
53
+ - 加班查询:仅支持 2022-01-01 之后的数据;**仅按加班日期筛选**,不支持按发起/创建/更新时间;审批中/待审批通过数据暂不支持
54
+ - 假期余额查询 `--as-of-date` 日期必须为 `YYYY-MM-DD`(`YYYYMMDD` 会被拒),新增时区支持场景(如 `--time-zone=GMT-5`)与自然语言日期映射("明年 / 国庆节 / 年底" 等)
55
+ - 请假记录状态枚举重写:`1=已通过`、`2=审批中`、`3=审批中(更正)`、`4=审批中(取消休假)`、`5=审批中(返岗)`、`8=已取消` 等更精细的状态分层
56
+ - **CoreHR Skill references 大面积打磨**:
57
+ - `skills/people-corehr/references/people-corehr-job-change-search.md` 重写(+452/-?)
58
+ - `skills/people-corehr/references/people-corehr-offboarding-search.md` 精简重写(+271/-?)
59
+ - `skills/people-corehr/references/people-corehr-workforce-plan-detail-list.md` / `skills/people-corehr/references/people-corehr-workforce-plan-detail-summary.md` / `skills/people-corehr/references/people-corehr-workforce-plan.md` 全量刷新
60
+ - `employee-filter` / `employee` / `pre-hire-search` / `query-id-by-name` / `concepts` 同步调整,命令样例与字段语义统一
61
+ - 新增占位文件 `references/search-pre_hire.md`(预留后续合并)
62
+
63
+ ### Fixed
64
+
65
+ - **`job_change_search` 命中 `query-id-by-name` 的逻辑修复**(多次 commit:`fix: fix job_change search skill query-id-by-name`、`fix: fix job_change search skill`)
66
+ - **请假记录状态筛选兼容**:`feat: 兼容审批中的请假记录查询场景`、`feat: 兼容已通过的请假记录查询场景`
67
+ - **CoreHR name-to-id 按语言自动切换**:`feat: name to id by language` / `feat: name to id params`
68
+ - **过度简化回滚**:`Revert "feat: simplify offboarding search skills"`,恢复更完整的 offboarding 搜索能力
69
+
70
+ ### Technical
71
+
72
+ - `shortcuts/register.go` / `shortcuts/corehr/shortcuts.go` 跟随 `common` 子包拆分调整注册
73
+ - 统计:`38 files changed, 3148 insertions(+), 1081 deletions(-)`
74
+
75
+ > 升级提示:
76
+ > 1. 如果你之前基于 `shortcuts/corehr/query_id_by_name.go` 的内部符号做二次开发,现在应从 `shortcuts/corehr/common` 包 import。
77
+ > 2. 请假记录状态枚举发生了变化(尤其是 `2=审批中` 与早期的 `2=已通过`),脚本/Skill 中硬编码状态值的场景请对照新表调整。
78
+ > 3. 假期余额 `--as-of-date` 的日期格式由 `YYYYMMDD` 统一收紧为 `YYYY-MM-DD`。
79
+
80
+ ## [v1.0.10] - 2026-04-28
81
+
82
+ ### Security
83
+
84
+ - **UAT 迁移至 OS 钥匙串**:`set_uat` / `clear_uat` 由"本地文件存储"改为"OS Keychain 存储",配套 help 文案与错误提示同步更新
85
+ - `cmd/uat.go`:`Short` 描述改为 `Store/Clear UAT in/from OS keychain`,成功/失败提示改为 `UAT stored in OS keychain` / `UAT cleared from keychain`
86
+ - `internal/core/config.go`:`ResolveUATOverride` 的 source 从 `"file"` 更名为 `"keychain"`,新增 `manualUATAccount = "manual-uat:override"` 与 OAuth 账号区分
87
+ - **`GetConfigDir` 越权/世界可写目录加固**:新增 `validateConfigDir`,对 `LARKSUITE_CLI_CONFIG_DIR` 做安全校验
88
+ - 拦截 `/proc`、`/sys`、`/dev` 等系统关键路径,出现即 fallback 回 `~/.people-cli` 并 stderr 告警
89
+ - 对 world-writable(权限位含 `0002`)目录给出"凭据可能泄露"警告(仍允许使用)
90
+ - **Debug Transport 凭据脱敏增强**:`internal/cmdutil/debug_transport.go` 重写 `sanitizeTokenFields`
91
+ - 支持 `application/x-www-form-urlencoded` 形式的请求体:通过 `looksLikeFormURLEncoded` 启发式识别,识别后**整体替换 value 为 `***`**,防止 OAuth `client_secret` / `code` / `refresh_token` 意外打印
92
+ - 保留原 JSON 路径:继续按 key 黑名单做字段级脱敏
93
+ - `debug_transport_test.go` 同步重构(-151/+x)
94
+ - **其他安全修复**:`.gitignore` 扩展 `*.zip` 与 `dist/*.zip`,避免本地打包产物被误提交;`internal/registry/remote.go` 相关安全点位调整
95
+
96
+ ### Features
97
+
98
+ - **Skill 打包工具链(全新)**:交付可上架的 Skill zip 包生成链路
99
+ - `scripts/pack-skills.sh` +216:把 `skills/` 下每个业务 Skill 打包成 `dist/<skill-name>.zip`,支持 `--list` / `--dry-run` / 指定 Skill;在打包时会把 `people-shared/SKILL.md` 嵌入到各业务 Skill 的 `references/people-shared.md`
100
+ - `scripts/rewrite_shared_refs.py` +121:重写所有 `.md` 中对 `people-shared` 的引用路径(`SKILL.md` → `references/people-shared.md`;`references/*.md` → `people-shared.md`),并提供残留检测
101
+ - **CoreHR Workforce Plan Detail List 新增**:新增 reference `skills/people-corehr/references/people-corehr-workforce-plan-detail-list.md` +233,配套 `skills/people-corehr/references/people-corehr-workforce-plan.md` 补充说明
102
+ - **终端控制字符防御**:复用并扩充 `shortcuts/common/sanitize.go`(+39)
103
+ - 新增 `IsDangerousUnicode`:覆盖 ZWSP / ZWJ / ZWNJ / BOM、BiDi override(LRE/RLE/PDF/LRO/RLO/LRI/RLI/FSI/PDI)、LS / PS 等
104
+ - `SanitizeForPretty` / `SanitizeValueForPretty`:在 pretty 输出前递归清洗 string / []string / []interface{} / map[string]interface{},**修复 `leave_request_history` pretty 模式未过滤终端控制字符的问题**
105
+
106
+ ### Fixed
107
+
108
+ - **Leave Duration Unit 解析**:修复 `leave duration unit` 字段因 API 返回 `int` / `float64` 两种类型导致的解析失败(`shortcuts/attendance/leave_balances.go` +153、`shortcuts/attendance/leave_request_history.go` +285 大幅重构)
109
+ - **请假记录状态枚举优化**:`leave_request_status` 枚举/展示更统一,新增提交时间范围约束与字段精简
110
+ - **加班记录文档修正**:`skills/people-attendance/references/people-attendance-overtime.md` 同步更新
111
+
112
+ ### Changed
113
+
114
+ - **CoreHR Skill references 大面积打磨**:`employee-filter` / `employee-search` / `employee-job-data-detail-query` / `employee-fields-list` / `job-change-search` / `offboarding-search` / `pre-hire-search` / `workforce-plan` 全量重审,命令样例与字段语义更一致
115
+ - **Attendance Skill 主文档**:`skills/people-attendance/SKILL.md` +42,补充假勤能力说明
116
+ - `shortcuts/corehr/pre_hire/pre_hire_search.go` 微调以契合 reference 规范
117
+
118
+ ### Technical
119
+
120
+ - `go.mod` 依赖轻量更新
121
+ - 统计:`29 files changed, 1433 insertions(+), 531 deletions(-)`
122
+
123
+ > 升级提示:若之前依赖 `set_uat` 把 token 写到本地文件,升级到 1.0.10 后会改写入 OS Keychain;在 headless/无 keychain 环境(如部分 Linux CI)请确认依赖路径。
124
+
125
+ ## [v1.0.9] - 2026-04-28
126
+
127
+ ### Changed (Breaking)
128
+
129
+ - **Leave 能力域归属调整:`corehr` → `attendance`**。假期余额与请假记录两个 Shortcut 从 CoreHR 迁移到 Attendance 域,业务归属更贴合"考勤/假期"场景。
130
+ - Shortcut 调用路径变化:
131
+ - `people-cli corehr +leave-balances` → `people-cli attendance +leave-balances`
132
+ - `people-cli corehr +leave-request-history` → `people-cli attendance +leave-request-history`
133
+ - 代码搬迁(`git mv`,保留 99% 相似度):
134
+ - `shortcuts/corehr/leave_balances.go` → `shortcuts/attendance/leave_balances.go`
135
+ - `shortcuts/corehr/leave_request_history.go` → `shortcuts/attendance/leave_request_history.go`
136
+ - 文档随迁(相似度 92%):
137
+ - `skills/people-corehr/references/people-corehr-leave-balances.md` → `skills/people-attendance/references/people-attendance-leave-balances.md`
138
+ - `skills/people-corehr/references/people-corehr-leave-request-history.md` → `skills/people-attendance/references/people-attendance-leave-request-history.md`
139
+ - 注册入口:新增 `shortcuts/attendance/shortcuts.go`,并在 `shortcuts/register.go` 接入;`shortcuts/corehr/shortcuts.go` 同步移除 `LeaveBalances` / `LeaveRequestHistory` 注册项
140
+ - README(中英)同步更新示例命令,把 `corehr +leave-balances` 改为 `attendance +leave-balances`
141
+
142
+ ### Features
143
+
144
+ - **`people-attendance` Skill 大幅升级至 `v1.1.0`**:
145
+ - description 扩写:明确覆盖"加班、请假、休假、假期余额、年假、病假、调休"等关键词,保证 AI 路由更准确命中
146
+ - 场景示例 3 类:加班记录、假期余额(含 `--as-of-date` / `--include-offboard` / `--include-subtype`)、休假记录(含 `--leave-request-status` / `--leave-submit-date-min` / `--leave-type-id`)
147
+ - 新增"命令速查"表与"参考文档"索引,引导用户优先走 reference 文档
148
+ - **加班记录返回值说明补强**:`people-attendance-overtime.md` 增加返回字段表,明确 `duration` / `unit`(1=天, 2=小时, 3=半天, 4=半小时)/ `start_time` / `end_time` 的语义,禁止用 `start_time - end_time` 计算时长
149
+
150
+ ### Technical
151
+
152
+ - `shortcuts/corehr/shortcuts.go` 中 `LeaveBalances` / `LeaveRequestHistory` 两项引用清理
153
+ - `shortcuts/register.go` 新增 `attendance` 域注册
154
+
155
+ > 迁移提示:如果你的脚本或 SKILL 里硬编码了 `corehr +leave-balances` / `corehr +leave-request-history`,升级到 1.0.9 后需要替换为 `attendance +leave-balances` / `attendance +leave-request-history`。
156
+
157
+ ## [v1.0.8] - 2026-04-27
158
+
159
+ ### Features
160
+
161
+ - **Hire 招聘域(全新)**:引入独立的 `people-hire` Skill 与顶层 `shortcuts/hire/*`,打通招聘面试 / 评估场景
162
+ - 新增 Shortcut:`+interview-task-list`(面试任务列表)、`+evaluation-task-list`(评估任务列表)
163
+ - 配套新增 `skills/people-hire/SKILL.md` 与 references:`skills/people-hire/references/interview-task-list.md` / `skills/people-hire/references/evaluation-task-list.md`
164
+ - 新增 `skill-template/domains/hire.md`,统一招聘域 skill 模板入口
165
+ - **Attendance 加班查询文档化**:抽离 `references/people-attendance-overtime.md`,把参数规则、scope、分段查询等细节从 `SKILL.md` 里剥离到 reference,主文档更精简
166
+ - **CoreHR 员工检索业务化重构**:`shortcuts/corehr/employee/employee_list.go` 大幅增强(+128 行),对接 `offboarding` / `job_change` / `employee-filter` 等业务场景;references 同步刷新:
167
+ - `skills/people-corehr/references/people-corehr-employee-filter.md`:扩展筛选字段与说明(+111)
168
+ - `skills/people-corehr/references/people-corehr-offboarding-search.md` / `skills/people-corehr/references/people-corehr-job-change-search.md`:大幅重写,参数说明和约束更清晰
169
+
170
+ ### Security
171
+
172
+ - **`env --header_key` 屏蔽敏感 HTTP Header**:新增 `blockedHeaderKeys` 黑名单,禁止用户通过 `--header_key` 覆盖 `Authorization`、`Cookie`、`Set-Cookie`、`Host`、`Proxy-Authorization`、`WWW-Authenticate`、`X-Lark-Mcp-Uat`、`X-Lark-Mcp-Tat` 等安全敏感头,阻断凭据注入 / 请求劫持风险;命令 help 文案同步提示
173
+ - **Debug Transport 安全增强**:`internal/cmdutil/debug_transport.go` 重写(+74/-x),新增单测 `debug_transport_test.go`(+66)与 `factory_default_test.go`(+64),修复 debug/header 相关安全风险
174
+
175
+ ### Changed
176
+
177
+ - **README 重新定位**:`README.md` / `README.zh.md` 全面刷新,聚焦 People 业务域(CoreHR / Attendance / Hire)定位与能力描述
178
+ - **shortcuts 目录结构扁平化**:删除中间层 `shortcuts/corehr/employee/shortcuts.go`、`shortcuts/corehr/pre_hire/shortcuts.go`,由 `shortcuts/corehr/shortcuts.go` 与 `shortcuts/register.go` 统一注册;`query_id_by_name.go` references 同步微调
179
+
180
+ ### Chore
181
+
182
+ - **仓库清理**:删除历史备份与无用产物,合计约 **58,460 行删除**
183
+ - `people-cli.backup.20260405_185850` 本地二进制备份
184
+ - `skills/people-corehr.zip` 冗余压缩包(改由 `.gitignore` 忽略)
185
+ - `.backup/shortcuts_removed/` 下 base / task / vc / whiteboard / skill-template 等历史模块的遗留文件
186
+ - `go.mod` 依赖微调
187
+
188
+ ### Technical
189
+
190
+ - 新增测试:`internal/cmdutil/factory_default_test.go`、`internal/cmdutil/debug_transport_test.go`
191
+ - `internal/core/config.go` / `internal/core/types.go` 扩展以配合 env header 的安全校验
192
+
193
+ ## [v1.0.7] - 2026-04-24
194
+
195
+ ### Features
196
+
197
+ - **CoreHR 假期能力**:新增两个 Shortcut,打通"查余额 → 看记录"的完整链路
198
+ - `+leave-balances`:按员工查询假期余额,支持 `as_of_date`(截止日期,用于"月底还剩多少"场景)、`include_offboard`(离职折算)、`leave_duration_unit`(天 / 小时)、分页参数等,返回周期授予、已休、历史结转、审批中等多维度额度
199
+ - `+leave-request-history`:按员工查询请假记录,支持按状态(`leave_request_status`)、提交时间区间(`leave_submit_date_min/max`)、假期类型(`leave_type_id`)等维度过滤
200
+ - 新增对应 references 文档:`skills/people-corehr/references/people-corehr-leave-balances.md` / `skills/people-corehr/references/people-corehr-leave-request-history.md`
201
+ - **Attendance 加班审批查询**:`people-attendance` Skill 明确支持"加班审批记录"场景,补充 `check_date_from` / `check_date_to` / `status` 参数说明与跨 30 天分段查询规则;所需 scope 更新为 `attendance:over_time:read`
202
+ - **Pre-Hire 命令顶层化**:将 `shortcuts/corehr/pre_hire/*` 提升为独立的顶层 `shortcuts/pre_hire/*`,在 `shortcuts/register.go` 单独注册,结构更清晰
203
+ - **Skill 说明补强**:`people-corehr` SKILL 新增"假期类型 / 假期余额 / 请假记录"三类核心概念,并补齐场景示例与查询要点
204
+
205
+ ### Changed
206
+
207
+ - **Name → ID Shortcut 精简重构**:`shortcuts/corehr/query_id_by_name.go` 由 318 行精简至更小规模(净 -123 行),参数与输出形态调整,references 同步更新
208
+ - **Pre-Hire Search 文档更新**:`references/search-pre_hire.md` 内容随命令路径迁移同步调整
209
+ - **Extract 工具增强**:`shortcuts/common/extract.go` 扩展字段提取逻辑,服务于新增的假期相关 Shortcut
210
+
211
+ ### Technical
212
+
213
+ - 新增单测覆盖:`shortcuts/pre_hire/pre_hire_search_test.go`
214
+ - `shortcuts/register.go` 注册新的 `pre_hire` 顶层 shortcuts 分组
215
+
216
+ ## [v1.0.6] - 2026-04-23
217
+
218
+ ### Features
219
+
220
+ - **Pre Host 环境支持**:新增 `people-cli pre-host` 命令与配置项,支持在预发环境与生产环境之间切换(OAuth 设备流、UAT Client、MCP Client 统一适配)
221
+ - **CoreHR Name → ID 快捷命令**:新增 `shortcuts/corehr/query_id_by_name.go`,支持通过名称查询部门、员工、职级、职务等实体 ID,覆盖更完整的场景与参数
222
+ - **Employee / Pre-Hire 快捷命令族**:
223
+ - 员工:`employee_list`、`employee_search`、`employee_basic_user_info`、`employee_job_data`、`employee_custom_column_settings`、`employee_perm_check`
224
+ - 待入职:`pre_hire_search` 及配套测试
225
+ - **Workforce Plan 明细汇总**:新增 `workforce_plan_detail_summary` 快捷命令与完整测试集
226
+ - **自定义请求 Header**:`env` 命令支持 `--header-key`,并在 Transport 层透传业务自定义头(含新增测试覆盖)
227
+ - **Skill 文档增强**:补齐 `people-corehr` / `people-attendance` 技能说明与多份 references(基础信息、自定义列、员工列表、待入职搜索、Name→ID 查询、Workforce Plan 等)
228
+
229
+ ### Changed
230
+
231
+ - **移除 `meta_data_url` 配置**:清理 `cmd/root.go`、`internal/registry` 中不再使用的元数据 URL 逻辑,收敛配置复杂度
232
+ - Name→ID shortcut 重构,入参、输出格式与文档说明全面更新
233
+
234
+ ### Technical
235
+
236
+ - 扩展 `internal/core/config.go`、`internal/core/types.go` 以承载 Pre Host 与 Header 配置
237
+ - 新增 `env_header_transport_test.go` / `env_test.go` 等测试,保证 header 透传链路可回归
238
+
239
+ ## [v1.0.5] - 2026-04-16
240
+
241
+ ### Changed
242
+
243
+ - **npm 包名调整**:发布包名从 `@larksuite/cli` 正式切换为 `@people/people-cli`,配套 `publishConfig.registry` 指向 `https://bnpm.byted.org`
244
+ - **自动更新能力**:
245
+ - 新增 `disable_auto_update` 配置开关,允许在企业环境关闭自动更新
246
+ - 新增 `force update`、`env check` 相关能力,强化升级链路与环境诊断
247
+ - **调试增强**:补充 debug 日志开关,便于排查 npm 安装与升级问题
248
+
249
+ ### Technical
250
+
251
+ - 调整版本检查位置,避免重复触发
252
+ - `.gitignore` 忽略 `package-lock.json`,统一发布产物
253
+
254
+ ## [v1.0.4] - 2026-04-14
255
+
256
+ ### Features
257
+
258
+ - **上传能力**:新增 `upload shortcuts` 相关脚本,支撑发布流水线上传产物
259
+
260
+ ### Technical
261
+
262
+ - npm 发布流程联调:多次 `feat: add test npm` 版本验证发布链路(1.0.3 / 1.0.4)
263
+
264
+ ## [v1.0.3] - 2026-04-14
265
+
266
+ ### Technical
267
+
268
+ - npm 发布测试版本,验证 `push_beta.sh` 等脚本
269
+
270
+ ## [v1.0.2] - 2026-04-14
271
+
272
+ ### Features
273
+
274
+ - **发布脚本**:新增 `publish.sh`,支持一键发布至内部 npm 镜像
275
+
276
+ ## [v1.0.1] - 2026-04-14
277
+
278
+ ### Features
279
+
280
+ - **身份体系完善**:`cmdutil.factory` 支持更丰富的身份装配路径,便于 CI/机器人场景接入
281
+ - **品牌切换**:项目命名与二进制从 `lark-cli` 切换为 `people-cli`,CLI 子命令、帮助文案、配置路径、keychain 命名全部同步更新
282
+ - **People Metadata 支持**:`scripts/fetch_meta.py` 改造为拉取 People 平台元数据
283
+ - **Skills 体系引入**:新增 `skill-template/`、`skills/people-corehr/`、`skills/people-shared/`、`skills/people-skill-maker/` 目录与模板,统一技能制作流程
284
+ - **Mesh 支持**:元数据抓取脚本适配 Mesh 环境
285
+
286
+ ### Technical
287
+
288
+ - `Makefile` 与 `build.sh` 适配新的构建/发布路径
289
+ - `internal/core/config.go` 扩展配置字段以支撑新身份类型
290
+ - `scripts/install.js` 精简安装流程
291
+ - 大量重命名:`lark-cli` → `people-cli`(命令名、帮助文本、CI、skill 模板、e2e 测试等)
292
+
293
+ ## [v1.0.0] - 2026-04-05
294
+
295
+ ### Initial Release
296
+
297
+ People CoreHR CLI — 飞书人事管理命令行工具
298
+
299
+ ### Features
300
+
301
+ - **部门管理**:搜索、批量获取、列表查询、更新、树形结构查看
302
+ - **CoreHR v2 API**:完整支持飞书人事部门和组织架构接口
303
+ - **认证授权**:OAuth 2.0 设备流认证,支持用户和机器人身份
304
+ - **配置管理**:应用配置、默认身份设置、多租户支持
305
+ - **健康检查**:配置验证、令牌状态、API 连通性检查
306
+ - **多种输出格式**:JSON、表格、CSV、NDJSON 等
307
+ - **分页支持**:自动分页、分页大小控制、延迟控制
308
+
309
+ ### Removed
310
+
311
+ - 移除非 CoreHR 业务模块(calendar, drive, im, mail, task, vc 等)
312
+ - 专注于人事管理和组织架构查询
313
+
314
+ ### Documentation
315
+
316
+ - 完整的命令行帮助文档
317
+ - API 参数和类型查询(`schema` 命令)
318
+ - 通用 API 调用接口(`api` 命令)
319
+
320
+ ### Technical
321
+
322
+ - 基于 people-cli v1.0.4 进行精简和定制
323
+ - 只保留 CoreHR 相关功能和基础能力
324
+ - 编译后二进制大小约 10MB
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Lark Technologies Pte. Ltd.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,232 @@
1
+ # people-cli
2
+
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
+ [![Go Version](https://img.shields.io/badge/go-%3E%3D1.23-blue.svg)](https://go.dev/)
5
+
6
+ [中文](./README.zh.md) | [English](./README.md)
7
+
8
+ The official CLI for Feishu People domain workflows. `people-cli` currently covers CoreHR, Attendance, and Hire APIs, and also provides a small set of workflow helper shortcuts such as Drive upload/download.
9
+
10
+ [Install](#installation--quick-start) · [Auth](#authentication) · [Commands](#command-system) · [Advanced](#advanced-usage) · [Contributing](#contributing)
11
+
12
+ ## Why people-cli?
13
+
14
+ - **Built for People domains** — one CLI for CoreHR, Attendance, Hire, and adjacent workflow helpers
15
+ - **Shortcut-first, API-complete** — use high-level shortcuts for common tasks, or drop down to generated service commands and raw APIs when needed
16
+ - **AI-friendly output** — structured output and stable command shapes work well for agents and automation
17
+ - **Quick to adopt** — guided config, domain-based auth, and schema introspection shorten time to first successful call
18
+ - **Secure by default** — injected input protection, filtered terminal output, and system keychain credential storage
19
+ - **Open source** — MIT licensed and ready for local development or automation use
20
+
21
+ ## Features
22
+
23
+ | Category | Capabilities |
24
+ | --- | --- |
25
+ | `corehr` | Department lookup, employee search, basic info, job data, pre-hire search, leave balances/history, workforce planning, name-to-ID shortcuts |
26
+ | `attendance` | Attendance approval and overtime approval queries |
27
+ | `hire` | Hiring data access for jobs, applications, interviews, evaluations, and talent resources |
28
+ | Helpers | Drive file upload/download shortcuts for surrounding workflows |
29
+
30
+ ## Installation & Quick Start
31
+
32
+ ### Requirements
33
+
34
+ Before you start, make sure you have:
35
+
36
+ - Go `v1.23`+ and Python 3(required for building from source)
37
+
38
+ ### Quick Start
39
+
40
+ #### Install
41
+
42
+ Build from source:
43
+
44
+ ```bash
45
+ # Clone repository
46
+ git clone https://code.byted.org/people/cli.git
47
+ cd cli
48
+
49
+ # Build and install
50
+ make install
51
+
52
+ # Verify installation
53
+ people-cli --version
54
+ ```
55
+
56
+ #### Configure & Use
57
+
58
+ ```bash
59
+ # 1. Configure app credentials (one-time, interactive guided setup)
60
+ people-cli config init
61
+
62
+ # 2. Authorize by People domain
63
+ people-cli auth login --domain corehr --recommend
64
+
65
+ # 3. Start using a shortcut
66
+ people-cli corehr +prehire-search --format table
67
+ ```
68
+
69
+ ## Authentication
70
+
71
+ | Command | Description |
72
+ | ------------- | -------------------------------------------------------------- |
73
+ | `auth login` | OAuth login with interactive selection or CLI flags for scopes |
74
+ | `auth logout` | Sign out and remove stored credentials |
75
+ | `auth status` | Show current login status and granted scopes |
76
+ | `auth check` | Verify a specific scope (exit 0 = ok, 1 = missing) |
77
+ | `auth scopes` | List all available scopes for the app |
78
+ | `auth list` | List all authenticated users |
79
+
80
+ ```bash
81
+ # Interactive login
82
+ people-cli auth login
83
+
84
+ # Authorize by People domain
85
+ people-cli auth login --domain corehr --recommend
86
+ people-cli auth login --domain attendance
87
+ people-cli auth login --domain hire
88
+
89
+ # Exact scope
90
+ people-cli auth login --scope "corehr:department:read"
91
+
92
+ # Agent mode: return verification URL immediately, non-blocking
93
+ people-cli auth login --no-wait
94
+ # Resume polling later
95
+ people-cli auth login --device-code <DEVICE_CODE>
96
+
97
+ # Identity switching: execute commands as user or bot
98
+ people-cli attendance user_approval_over_time list --as user --params '{"check_date_from":"20260401","check_date_to":"20260430","status":"2"}'
99
+ ```
100
+
101
+ ## Command System
102
+
103
+ The CLI provides three levels of granularity, covering everything from quick operations to fully custom API calls:
104
+
105
+ ### 1. Shortcuts
106
+
107
+ Prefixed with `+`, designed to be friendly for both humans and AI, with smart defaults, table output, and dry-run previews.
108
+
109
+ ```bash
110
+ # Search pre-hires
111
+ people-cli corehr +prehire-search --format table
112
+
113
+ # Query my leave balances
114
+ people-cli attendance +leave-balances --format pretty
115
+ ```
116
+
117
+ ### 2. API Commands
118
+
119
+ Auto-generated from Feishu OAPI metadata, curated through evaluation and quality gates.
120
+
121
+ ```bash
122
+ # Search departments
123
+ people-cli corehr department list --params '{"page_size":50}'
124
+
125
+ # Query overtime approvals
126
+ people-cli attendance user_approval_over_time list --params '{"check_date_from":"20260401","check_date_to":"20260430","status":"2"}'
127
+
128
+ # Query hiring evaluation tasks
129
+ people-cli hire evaluation_task list --params '{"page_size":10}'
130
+ ```
131
+
132
+ ### 3. Raw API Calls
133
+
134
+ Call any Feishu Open Platform endpoint directly.
135
+
136
+ ```bash
137
+ people-cli api POST /open-apis/corehr/v2/common/query_id_by_name --data '{"business_scene":"team","target_object_api_name":"department","query_name":"RD"}'
138
+ ```
139
+
140
+ ## Advanced Usage
141
+
142
+ ### Output Formats
143
+
144
+ ```bash
145
+ --format json # Full JSON response (default)
146
+ --format pretty # Human-friendly formatted output (supported by selected commands such as shortcuts/schema)
147
+ --format table # Readable table
148
+ --format ndjson # Newline-delimited JSON (for piping)
149
+ --format csv # Comma-separated values
150
+ ```
151
+
152
+ ### Pagination
153
+
154
+ ```bash
155
+ --page-all # Auto-paginate through all pages
156
+ --page-limit 5 # Max 5 pages
157
+ --page-delay 500 # 500ms between page requests
158
+ ```
159
+
160
+ ### Dry Run
161
+
162
+ For commands that may have side effects, preview the request with --dry-run first:
163
+
164
+ ```bash
165
+ people-cli api POST /open-apis/corehr/v2/common/query_id_by_name --data '{"business_scene":"team","target_object_api_name":"department","query_name":"RD"}' --dry-run
166
+ ```
167
+
168
+ ### Schema Introspection
169
+
170
+ Use schema to inspect any API method's parameters, request body, response structure, supported identities, and scopes:
171
+
172
+ ```bash
173
+ people-cli schema
174
+ people-cli schema corehr.job_change.search --format pretty
175
+ people-cli schema attendance.user_approval_over_time.list
176
+ people-cli schema hire.evaluation_task.list
177
+ ```
178
+
179
+ ### Configuration Management
180
+
181
+ ```bash
182
+ # Initialize configuration
183
+ people-cli config init
184
+
185
+ # View current configuration
186
+ people-cli config show
187
+
188
+ # Set default identity
189
+ people-cli config default-as user
190
+
191
+ # Remove configuration
192
+ people-cli config remove
193
+ ```
194
+
195
+ ### Health Check
196
+
197
+ ```bash
198
+ # Check configuration, auth, and connectivity
199
+ people-cli doctor
200
+
201
+ # Offline check (skip network)
202
+ people-cli doctor --offline
203
+ ```
204
+
205
+ ## Security & Risk Warnings
206
+
207
+ This tool can be invoked by AI Agents to automate operations on the Feishu Open Platform, and carries inherent risks such as model hallucinations, unpredictable execution, and prompt injection. After you authorize Feishu permissions, the AI Agent will act under your user identity within the authorized scope, which may lead to high-risk consequences such as leakage of sensitive data or unauthorized operations. Please use with caution.
208
+
209
+ To reduce these risks, the tool enables default security protections at multiple layers. However, these risks still exist. We strongly recommend that you do not proactively modify any default security settings; once relevant restrictions are relaxed, the risks will increase significantly, and you will bear the consequences.
210
+
211
+ We recommend using the Feishu bot integrated with this tool as a private conversational assistant. Do not add it to group chats or allow other users to interact with it, to avoid abuse of permissions or data leakage.
212
+
213
+ Please fully understand all usage risks. By using this tool, you are deemed to voluntarily assume all related responsibilities.
214
+
215
+ ## Contributing
216
+
217
+ Community contributions are welcome! If you find a bug or have feature suggestions, please submit an [Issue](https://code.byted.org/people/cli/issues) or [Merge Request](https://code.byted.org/people/cli/merge_requests).
218
+
219
+ For major changes, we recommend discussing with us first via an Issue.
220
+
221
+ ## Related Projects
222
+
223
+ - [people-cli-registry](https://code.byted.org/people/people-cli-registry) — API registry generator that provides People domain metadata and generation config for `people-cli`
224
+
225
+ ## License
226
+
227
+ This project is licensed under the **MIT License**.
228
+ When running, it calls Feishu Open Platform APIs. To use these APIs, you must comply with the following agreements and privacy policies:
229
+
230
+ - [飞书用户协议](https://www.feishu.cn/terms)
231
+ - [飞书隐私政策](https://www.feishu.cn/privacy)
232
+ - [飞书开放平台应用服务商安全管理办法](https://open.feishu.cn/document/uAjLw4CM/uMzNwEjLzcDMx4yM3ATM/management-practice/app-service-provider-security-management-specifications)