From pku-cli
CLI tool for PKU portal: queries empty classrooms by building/time, parses academic calendars from Vue bundles, checks/recharges network fees with QR codes, monitors low balances. Activates on portal/classroom/netfee mentions or specific APIs.
npx claudepluginhub pkuinfo/pkucli --plugin pku-cliThis skill uses the workspace's default tool permissions.
A CLI client for PKU's campus info portal — 空闲教室、校历、网费 in one command.
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
A CLI client for PKU's campus info portal — 空闲教室、校历、网费 in one command.
crates/portal/pkuinfo_common::credential(多数学生上网密码与 IAAA 相同)GET /publicQuery/classroomQuery/retrClassRoomFree.do?buildingName=<中文>&time=<中文>,返回 {success, rows:[{room, cap, c1..c12}]}js/ccSchoolCalendar.<hash>.js bundle 里;先抓 HTML 取 bundle 文件名,再正则抽 t._v("...") 文本POST /cas/webLogin → /netportal/itsUtil?operation=info(HTML 表含余额)→ POST /cas/ITSweb cmd=select → GET /myConn.jsp(在线 IP 会话)pkuConfirm → pkuSendOrder → cwsf.pku.edu.cn 收银台 AJAX /PayPreService/pay/cashier/gotToPay 返回 {data:{urlCode}}pkuinfo_common::captcha(manual / utool 免费 / ttshitu / yunma)src/main.rs — tokio::main 调用 pku_portal::run()src/lib.rs — Clap CLI + dispatchsrc/client.rs — reqwest client (simple 和 with cookies 两档)src/freeclassroom.rs — 空闲教室 API + 渲染src/calendar.rs — simso Vue bundle 解析src/netfee.rs — ITS 登录 / 余额 / 会话 / 3 步充值 / 付款码 QR 渲染| Command | 用途 |
|---|---|
free-classroom <building> [-d today|tomorrow|day-after] / fc | 查询空闲教室。building: 一教/二教/三教/四教/理教/文史/哲学/地学/国关/政管 |
calendar [-y 2025-2026] / cal | 显示校历(best-effort 从 simso JS bundle 抽取) |
netfee status | 余额 + 在线会话 |
netfee recharge <amount> [-m wechat|alipay] [--captcha utool] | 充值,终端打印微信/支付宝付款二维码 |
netfee watch --threshold 10 | 低余额监测,余额 < 阈值返回退出码 2 |
info-auth check
portal free-classroom 一教 # 无需登录
portal calendar --year 2025-2026 # 无需登录
portal netfee status # 需要 keyring 凭据
portal netfee recharge 10 -m wechat # 微信扫码付款,二维码直接打终端
portal netfee watch -t 5 || notify "PKU netfee low"
anyhow::Result + .context("...")/paybank/user.PayBankOrderPKU 响应页内嵌的 alert("验证码不能为空!") 是 JS 函数体里的 literal,不是真正的错误。只匹配独立 <script>alert("...");history.back();</script> 才是真错误paytype="" 即可;真正的 payType=02(微信)/01(支付宝)是 step3 收银台 AJAX 的字段cwsf.pku.edu.cn 域,step3 要用那个域的 origin 而不是 its.pku.edu.cnqrcode crate 的 Dense1x2 在终端渲染;兜底打印原始 urlCode 字符串~/.config/info/portal/