pmtools
Safety
- - Never print or persist access tokens.
- Confirm before deleting a progress record or changing a period status.
Setup
- - Set
FEISHU_ACCESS_TOKEN (either tenant_access_token or user_access_token) for most endpoints. - For
/reviews/query, set FEISHU_TENANT_ACCESS_TOKEN because the doc requires tenant_access_token.
Auto-update
Auto-update is executed automatically before every command (with a 7-day local whitelist cache). To force-run and see the update result, run:
CODEBLOCK0
This checks for updates at most once per 7 days (local whitelist cache). If a newer version is detected, it updates first, then proceeds.
Commands
All commands print JSON to stdout.
Periods
CODEBLOCK1
OKRs
CODEBLOCK2
Progress records
CODEBLOCK3
Images
CODEBLOCK4
Reviews
CODEBLOCK5
pmtools
安全
- - 切勿打印或持久化存储访问令牌。
- 删除进度记录或更改周期状态前需确认。
配置
- - 对大多数接口需设置 FEISHUACCESSTOKEN(tenantaccesstoken 或 useraccesstoken)。
- 对于 /reviews/query 接口,需设置 FEISHUTENANTACCESSTOKEN,因为文档要求使用 tenantaccess_token。
自动更新
自动更新会在每条命令执行前自动运行(带有7天本地白名单缓存)。如需强制运行并查看更新结果,请执行:
bash
python3 scripts/pm_tools.py self-update
该操作每7天最多检查一次更新(基于本地白名单缓存)。若检测到新版本,会先执行更新,再继续后续操作。
命令
所有命令均以JSON格式输出至标准输出。
周期
bash
python3 scripts/pmtools.py periods-create --periodruleid --startmonth
python3 scripts/pmtools.py periods-update-status --periodid --status <1|2|3>
python3 scripts/pmtools.py periods-list [--pagetoken ] [--page_size ]
python3 scripts/pm_tools.py period-rules-list
OKR
bash
python3 scripts/pmtools.py user-okrs-list --userid --offset --limit [--useridtype openid|unionid|userid|peopleadminid] [--lang zhcn|enus] [--periodid ...]
python3 scripts/pmtools.py okrs-batch-get --okrid ... [--useridtype openid|unionid|userid|peopleadminid] [--lang zhcn|en_us]
进度记录
bash
python3 scripts/pmtools.py progress-create --sourcetitle
--sourceurl --targetid --targettype <2|3> (--text | --contentjson | --contentfile ) [--percent ] [--status <-1|0|1|2>] [--sourceurlpc ] [--sourceurl_mobile ]
python3 scripts/pmtools.py progress-update --progressid (--text | --contentjson | --contentfile )
python3 scripts/pmtools.py progress-delete --progressid
python3 scripts/pmtools.py progress-get --progressid
图片
bash
python3 scripts/pmtools.py image-upload --file --targetid --target_type <2|3>
评审
bash
python3 scripts/pmtools.py reviews-query --userid ... --periodid ... [--useridtype openid|unionid|userid|peopleadminid]