/pku-cli:simsofrom pku-cli
CLI for PKU student information services: visitor appointments, campus entry/exit status, and CET-4/6 score lookup. Handles portal authentication and second-factor verification.
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 学生信息服务 (simso.pku.edu.cn), the portal's student-affairs site: 燕园 visitor appointments, campus entry/exit status, and the CET-4/6 score lookup.
visitor add, visitor submit and visitor cancel change real records (a visitor application goes to review and the gate staff see it). Without --yes they only print a preview. Never invent visitor data: ask the user for the visitor's name, phone, ID number, date, time, gate and reason, show the full details, and add --yes only after a clear yes.visitor form (masks it) rather than echoing it back.cet only when the user asks.info-auth store) or PKU_USERNAME / PKU_PASSWORD. Do not print session.json (it holds the session id).crates/simso/; protocol in docs/portal-services-api.md §2portal2017 → portal → appSysRedir.do?appId=simso-biz&p1=sadEpiVisitorAppt (no redirect follow) → one-time token (expires in ~8 min, redeemed at once) → GET /ssapi/simsoLogin?token=&page= → { sid, xh } + SESSION cookie. Every call is /ssapi/<path>?sid=&_sk=<学号> with X-Requested-With: XMLHttpRequest. errorCode 2/3/5 or HTTP 401 → one silent re-login (keyring/env only).sendEcyzCode answers byz (none) / opt (IAAA 手机令牌) / sms / wx. For opt the CLI uses a bound TOTP secret (otp.json in ~/.config/info/<any tool>/, found by common::otp::fresh_otp) when there is one; otherwise it prompts for the code (or reads PKU_SMS_CODE). A code belongs to one application and lives 2 minutes (SMS) or 30 s (OTP).src/lib.rs — Clap CLI + dispatchsrc/login.rs — portal hand-off → simsoLogin, sid/xh in session.jsonsrc/api.rs — HTTP with sid / _sk, one re-login on session losssrc/parse.rs — pure parsers and form rules (visitor form, drafts, states, second factor, entry status, CET) with unit tests on fixtures/src/commands.rs — subcommands, the save → send code → submit flow| Command | 用途 |
|---|---|
login -p / status / logout | 登录(keyring → env → 交互)/ 状态 / 退出 |
visitor form | 可约日期、校门、入校时间(30 分钟一档)、名额规则、最近访客(证件号已打码)、我的联系方式 |
visitor list [-n 20] | 我的访客预约:状态(未提交 / 未审核 / 审核通过 / 审核未通过 + 原因)、是否可取消 |
visitor add --date YYYY-MM-DD --time HH:mm --gate 南门 --reason … --name … --phone … [--id-number …] [--my-phone …] [--code …] [--yes] | 预约访客(默认预览;--yes 保存并提交,需二次验证) |
visitor submit <sqxxid> [--code N] [--yes] | 提交一份已保存的申请 |
visitor cancel <sqxxid> [--yes] | 取消「已提交、未审核」的预约(默认预览) |
entry | 出入校:刷脸可通行的校区、能否申请出入校 / 园区往返、申请记录(申请要填表上传,在网页里做) |
cet | 四六级成绩(总分、听力、阅读、写作翻译、口试等级;仅供参考) |
simso visitor form # 可约日期 / 校门 / 规则
simso visitor add --date 2026-11-29 --time 10:00 --gate 南门 --reason 父母探望 \
--name 张三 --phone 138xxxxxxxx --id-number <证件号> # 预览 → 给用户确认
simso visitor add … --yes # 确认后;非交互环境若需要验证码会报错并给出下一步
simso visitor submit <sqxxid> --code 123456 --yes # 拿到验证码后继续
simso visitor list # 看审核结果
simso cet
When stdin is not a terminal and no code is available, visitor add --yes saves the application, then stops with the exact visitor submit <sqxxid> --code <验证码> --yes command to run once the user reads out the code.
anyhow::Result + .context("中文描述")~/.config/info/simso/ (session.json holds sid + student ID, cookies.json the SESSION cookie)saveSqxx, sendEcyzCode, submitSqxx, cancelSubmit) are read from the site's JS, not exercised live; verify the first real run with the user watchingWhat 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./claspider北京大学课程信息爬取 CLI (dean.pku.edu.cn 教务部 + elective.pku.edu.cn 选课网 + onlineroomse.pku.edu.cn 智云课堂)。当用户提及 claspider、课程爬虫、课程信息爬取、课程目录、全校开课、按院系/教师/关键词查课、合并课程数据 时使用此 skill。适用于要批量导出某学期全部课程(课号/名称/学分/教师/时间地点/简介)做离线查询、语义搜索、选课决策的场景。Also use when dealing with 教务部课表查询 HTML 抓取、选课网分类遍历、智云课堂 JWT token 周课表接口、或三方数据合并。**不是**选课/退课工具——那是 `elective` skill;也不是单人课表——那是 `treehole course` (treehole skill)。/coursePKU Teaching Platform (北大教学网/Blackboard Learn) CLI tool built in Rust. Use this skill when working on the course crate, debugging course commands, adding features to the teaching platform CLI, or when the user mentions 教学网, Blackboard, course downloads, assignment submission, video downloads, or PKU teaching. Also use for teaching-assistant (助教) work via `course ta`: posting files, creating assignments, downloading submissions, grading with feedback (登分/批改/成绩中心), and publishing 课堂实录 recordings. Also use when dealing with HTML scraping via the scraper crate, Blackboard SSO callback, or multipart file uploads. **NOT for course schedule / 课表 / weekly timetable questions — for those use the `treehole` skill (`treehole course`), which is the canonical source and includes 辅修/双学位.** This `course` crate only deals with the Blackboard teaching platform (assignments, files, recordings, announcements). 四六级成绩 (CET) is not here: use `simso cet`./cwfw北京大学财务综合信息门户 (cwfw.pku.edu.cn) CLI 工具,只读。当用户提及 cwfw、财务门户、个人酬金、助教/助研/劳务费、奖学金/助学金按月发放、工资查询、谁给我打了钱、入卡/银行卡到账、报销进度/报销被退回、借款/暂借款、外汇到款/境外汇款、财务部汇率 时使用此 skill。Also use when dealing with cwfw IAAA 登录 (app_id=IIPF)、home2.jsp→findpages_postData.action→home3.jsp 多步 bootstrap、WF_CWBS / YBX 子系统入口、Wingsoft loadDefinition/responseButtonEvent/doQuery 协议或 cwfw 的加密表单字段。学费住宿费、缴费订单不在这里(见 cwpay)。/cwpay北京大学收费平台 / 收费大厅 (cwpay.pku.edu.cn) 只读 CLI 工具。当用户问 学费、住宿费、学宿费 交了没有 / 还欠多少、收费平台待缴费、缴费订单/缴费记录、某笔订单的支付方式或电子票据(发票)链接、在收费平台一共花了多少(浴卡充值/网费/校园卡就诊账户等)、收费平台有哪些缴费项目、学费缴费通道是否暂停、收费平台公告 时使用此 skill。不负责缴费/下单(只读);个人酬金/工资请用 cwfw skill,校园卡余额请用 campuscard skill。Also use when dealing with cwpay IAAA (app_id=CWSF) → /dealcas → X-Token 登录、响应 AES-256-ECB 解密、messageCode -3 续期 token。Other plugins' skills for the same job