/pku-cli:hospitalfrom pku-cli
CLI for campus hospital systems: dental appointment booking (i看牙) and health/lab/exam report retrieval. Only works on campus network. Requires --yes to confirm bookings/cancellations; reports need two-factor auth.
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.
Client for the campus hospital's two systems on 222.29.72.252: i看牙 (dental booking, port 80) and the health / lab / exam reports (port 8080, /hospital). Both are plain HTTP on the campus network only.
client.rs (guard): only http://222.29.72.252 (80) and http://222.29.72.252:8080; anything else is refused, including every redirect hop. No proxy, no VPN. Off campus the CLI says it cannot reach the hospital.book and cancel change a real appointment. Without --yes they only print a preview. Name the project, doctor, date and time to the user and add --yes only after a clear yes. The time is the start of the visit; cancelling needs 4+ hours of notice and a no-show suspends online booking for a month. One first-visit number per week.reports prints dates and titles only; report writes the PDF to the file the user names (--out, mode 600, refuses to overwrite without --force) and never prints the content. Do not read the PDF back unless the user asked you to.info-auth store) or PKU_USERNAME / PKU_PASSWORD. A 6-digit code the user reads out is passed with --code (or PKU_SMS_CODE) and is never stored.crates/hospital/; protocol in docs/portal-services-api.md §4portal2017 → portal → appSysRedir.do?appId=dentistAppointment → http://222.29.72.252/login/iaaaback.html?token=T → POST /api/api/accounts/validate?sessionKey=T → { user: { token, userid, username, phone, children1..3 } } kept in session.json. Every call is POST /api/Appt/<op>?sessionKey=&uid=… (query only, no cookie): GetNeeds, GetDoctor?need=, GetYyrq?need=&doctor=, GetApptList, Upload?id=&name=&yyxh=&phone= (book), UpdateAppt?yyxh= (cancel). Reads re-login once on a lost session; writes are never replayed.appSysRedir.do?appId=healthRecord → http://222.29.72.252:8080/hospital/portalSSOLogin.do?moduleID=…&token= → JSESSIONID, signed in on demand (separately from i看牙 so one 手机令牌 code is not used twice in a window).GET getCheckCodePass.do → { checkCodePass, otpBind, mobileMask }. If not passed: otpBind → POST validOTPCode.do?otpCode= with the bound TOTP (found by common::otp::fresh_otp) or a code from the user; else POST sendSMSCode.do then validSMSCode.do?smsCode=. Reports: POST health/listAllDirs.do, health/listAllFiles.do?year=, laboratoryScience/listAllFiles.do?type=Lis|Ris&startDate=&endDate= (from 2022-09-01), GET …/downloadFile.do?…&key=&_rand= (PDF).src/lib.rs — Clap CLI + dispatchsrc/client.rs — HTTP client and the address allow-list (guard), unit-testedsrc/login.rs — i看牙 and report sign-inssrc/api.rs — i看牙 calls, the second-factor gate, report callssrc/parse.rs — pure parsers and query builders (needs, doctors, slots, appointments, gate, report numbering) with unit tests on fixtures/src/commands.rs| Command | 用途 |
|---|---|
login -p / status / logout | 登录 i看牙(需要校园网)/ 状态 / 退出 |
departments | 口腔科项目(19 洗牙 … 29 儿童口腔)有没有号、患者资料、儿童资料 |
doctors --need N [--all] | 项目的医生、余号、医事服务费 |
slots --need N --doctor D | 医生可约的时间(每个有「号源」) |
mine | 我的牙科预约(预约序号、状态、能否取消) |
book --need N --doctor D --slot S [--child 1-3] [--yes] | 预约(重读时段后预览;儿童口腔要 --child) |
cancel <预约序号> [--yes] | 取消(只取消自己记录里还能取消的,默认预览) |
reports [--kind health|lab|exam] [--year Y] [--from D] [--to D] [--code N] [--sms] | 报告列表(体检默认最新一年,检验/检查默认近半年) |
report --kind K --date YYYYMMDD [--n 1] [--year Y] --out FILE [--force] [--code N] [--sms] | 下载 PDF 到 FILE |
hospital departments # 哪个项目有号
hospital doctors --need 26 # 拔牙的医生
hospital slots --need 26 --doctor 57
hospital book --need 26 --doctor 57 --slot 2164931 # 预览 → 给用户确认
hospital book --need 26 --doctor 57 --slot 2164931 --yes
hospital reports --kind lab # 第一次会要二次验证
hospital report --kind lab --date 20261101 --out ~/lab-20261101.pdf
SMS is never sent automatically. A bound 手机令牌 is filled in silently (sends nothing). Otherwise, in a terminal the CLI asks "是否发送到你的手机?[y/N]" first; non-interactive it stops and tells you to ask the user, then re-run with --sms (sends one text) and, once the user reads out the code, with --code <验证码> (sends nothing). If the session drops after a code was used, ask the user again; never add --sms on your own.
anyhow::Result + .context("中文描述")~/.config/info/hospital/Upload, UpdateAppt, validOTPCode.do, validSMSCode.do, the report listings and downloads are read from the site's JS, not exercised live (the gate stopped the research); the report key format is inferred from the pages' date logiczhdz.w.pku.edu.cn) answered 500 on 2026-11-28 and is not supportedWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
hospital-cli, dental-booking, health-reports, campus-network
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