/pku-cli:cwpayfrom pku-cli
Read-only CLI for PKU's payment platform (cwpay.pku.edu.cn). Queries tuition, dorm fees, pending payments, order history, payment methods, e-invoice links, spending summaries, project listings, and platform notices. Handles IAAA login, X-Token auth, AES-256-ECB response decryption, and token renewal.
Ships in pku-cli. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A read-only CLI for PKU's payment platform (收费大厅, vendor datalook) at cwpay.pku.edu.cn.
crates/cwpay/GET /api/pay/iaaa/getIAAALoginParam(公开)→ {appId: "CWSF", redirectUrl: "http://cwpay.pku.edu.cn/dealcas"} → IAAA → GET https://cwpay.pku.edu.cn/dealcas?_rand=…&token=<iaaa> → 302 → /#/middle_page?token=<X-Token>&jsonData={idserial,…}(失败 /#/middle_page_error?errorMsg=…)/api/<path> + 请求头 X-Token(HS256 JWT,约 6 小时有效);请求体是明文 JSONrand10 + reverse(key32) + rand10 + base64(AES-256-ECB/PKCS7) + rand10;错误响应是明文 JSON{messageCode, message, data};"0"/"6003" 成功,"-3" 续期(data = 新 token,重放请求),"-1"/"-2"/"-4" 登出schoolCode = "10001",dataSource = "PAY",partnerId = "PT000004"src/lib.rs — Clap CLI + dispatch(全局 --json)src/client.rs — reqwest client(不跟随重定向)src/login.rs — IAAA → dealcas → X-Token,会话存 ~/.config/info/cwpay/session.jsonsrc/crypto.rs — 响应解密、信封状态、dealcas 跳转解析、JWT exp(含单测)src/api.rs — 只读接口调用(处理 -3 续期并写回会话)src/parse.rs — 纯函数解析(含单测,fixtures 在 fixtures/,全部合成数据)src/display.rs — 终端渲染| Command | 用途 | 端点 |
|---|---|---|
login -p / status / logout | 会话管理 | 见上 |
tuition | 学费住宿费按学年 应缴/已缴/未缴 | GET pay/web/tuitionAndDorm/getTuitionAndDormList/<学号>/<projectId>(无欠费时回 messageCode "0001" 无欠费##,按空列表处理) |
pending | 待缴费列表(所有项目) | GET pay/pay/waitingPay/getWaitingPayList/10001/<学号>/undefined(末段字面量 undefined 与站点一致) |
orders [--from --to -p 项目 --page -n] | 缴费订单记录 | POST pay/web/order/pageOrderlist + 状态字典 common/com/dict/getDictDatasByTypes/TRADE_DISPLAY_STATUS/10001/PAY |
order <订单号> | 订单详情:支付方式、支付时间、退款、电子票据链接 | GET pay/pay/orderTrade/getOrderById/<id>;票据 POST pay/pay/invoiced/getEBillPicUrl(HANGXIN)/ getCouldEBillPicUrl(BOSI) |
spending [--from --to -p] | 按项目/月份汇总已支付金额(最多最近 500 笔) | 本地按 pageOrderlist 统计(站点自带「缴费账单」统计接口对所有人回 -1) |
projects [-s 关键词] [-k kind] [--open-only] | 约 160 个缴费项目,是否开放、暂停说明、标准金额 | POST pay/project/getAllProjectNoType |
notice | 平台首页公告 | POST common/com/notice/getStuNotice |
me | 个人中心信息 | POST pay/web/personalCenter/findUserInfoByAccountNum |
订单状态码:101 待支付、102 支付中、103 支付成功、104 支付失败、107 部分退款、108 全额退款、005 已过期、006 已取消。支付渠道:01 支付宝、02 微信、08 建行网银、09 建行大额转账、61 中行外卡、71 数字货币。金额单位均为分,CLI 输出为元。
info-auth check
cwpay login -p # 读 keyring,不需要密码
cwpay tuition
cwpay --json orders --from 2026-01-01
cwpay order <订单号>
会话过期(约 6 小时)后报「会话已过期」,重新 cwpay login -p 即可。
pay/pay/orderTrade/getTrade*(缴费账单统计)、pay/web/queryPayment/*(缴费查询)、pay/web/transfer/* 与 common/com/transfer/*(退费申请)、pay/web/netFee/queryNetBalance:对 IAAA 登录的 X-Token 回 -1 user-token权限验证失败(站点自己的页面也一样),应是另一套账号体系。system/message/pageList(消息中心)、reimburse/*(报销进度):服务端 404。pay/pay/orderTrade/getOrderTradeDetailByIds:回「系统正在维护中」。What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub pkuinfo/pkucli --plugin pku-cli23 skills in this plugin
/bdkj北京大学空间 (bdkj.pku.edu.cn) 学术研讨教室预约 CLI 工具。当用户提及 bdkj、北大空间、学术研讨教室、教室预约、研讨间、借教室 或想要查询/预约/取消 二教/四教/地学 教学楼里的空闲学术研讨教室时使用此 skill。支持保存固定参与人分组(如课题组),重复发起预约时只需 `--group <名字>`。Also use when dealing with bdkj IAAA SSO callback (app_id=bdkj), `/space` / `/space/schedule` / `/space/lockStatus` / `/classRoom/seachStudent` / `/classRoom/handle/submit` 这些端点,或 bdkj groups.json 持久化。/campuscardPKU Campus Card (校园卡) CLI tool built in Rust. Use this skill when working on the campuscard crate, debugging campus card commands, adding features, or when the user mentions 校园卡, campus card, balance, recharge, payment QR, transaction history, monthly spending, or bdcard.pku.edu.cn. Also use when dealing with Synjones platform auth, berserker-auth flow, mobile User-Agent requirements, or HTTP/1.1 constraints./claspiderOther plugins' skills for the same job