/pku-cli:fanxbfrom pku-cli
CLI for PKU canteen menus, dish ratings, crowd levels, and favorites. Answers what's for breakfast/lunch/dinner, where to find a dish, and whether a canteen is open or crowded.
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 饭小北 (rec.pku.edu.cn), the official PKU canteen app: today's dishes in every canteen, the current meal's picks, live crowd levels, opening hours, ratings, the monthly leaderboard, and the user's favorites.
fav add|rm and rate change the user's own data. Without --yes they only print a preview. Add --yes only after the user asked for that exact change.info-auth store) or PKU_USERNAME / PKU_PASSWORD.crates/fanxb/; protocol in docs/portal-apps-api.md §1portal2017 → portal2017/ssoLogin.do → GET portal2017/util/appSysRedir.do?appId=recpku (no redirect follow) → one-time token in Location → POST /_api/public/iaaa/finish {"token"} → cookie fanxb_auth_token (JWT, 3 days). Shared helper: pkuinfo_common::portal. On HTTP 401 the CLI logs in again once silently (keyring/env only)./_api/fanxb/catalog (menus, recommendations/now, recipes/<key>, canteens, leaderboard/monthly), personal /_api/fanxb/favorites and /_api/fanxb/reactions/<key>. /menus?canteen= takes a canteenKey, so the CLI resolves names via /canteens first. Dates are Beijing time.src/lib.rs — Clap CLI + dispatchsrc/login.rs — portal hand-off login, session (3-day TTL), silent re-loginsrc/api.rs — HTTP with one re-login on 401src/parse.rs — pure parsers (Dish, Menu, Canteen, Leaderboard, favorites) + canteen name resolution, unit tests on fixtures/ (real captures)src/display.rs, src/commands.rs| Command | 用途 |
|---|---|
login -p / status / logout | 登录(keyring → env → 交互)/ 状态 / 退出 |
menu [-q 关键词] [--meal breakfast|lunch|dinner] [-c 食堂] [--honored] [--sort rating|favorites] [-n 20] [--offset N] [--date YYYY-MM-DD] | 今日菜单(全校几千道,务必用筛选缩小范围) |
recommend [--exclude k1,k2] | 当前这一餐的「今日推荐」(--exclude 换一批) |
canteens [名字] [--open] | 食堂人流(空闲/适中/拥挤 + 人数)、是否营业、当前/下一餐时段、各区域开餐时间 |
dish <recipe_key> | 一道菜详情:评分分布、口味、辣度、营养、荣誉 |
top [--month YYYY-MM] | 月度好评榜(至少 20 人评分) |
favorites | 我的收藏 |
fav add <key> [--yes] / fav rm <key> [--yes] | 收藏 / 取消收藏(默认预览) |
rate <key> <1-5> [--yes] | 评分(默认预览) |
Each dish line ends with its recipe_key (dimmed), used by dish, fav, rate.
fanxb recommend # "中午吃什么?"
fanxb menu --meal dinner -q 牛肉 -n 10 # 晚饭哪里有牛肉
fanxb menu -c 学一 --sort rating # 学一今天什么好吃
fanxb menu --honored # 十佳菜肴
fanxb canteens --open # 现在哪些食堂开着、人多不多
fanxb rate <key> 5 # preview → confirm with the user → add --yes
anyhow::Result + .context("中文描述")~/.config/info/fanxb/ (session.json holds only uid + expiry; the JWT lives in cookies.json)/recipes/<key>, favorites and leaderboard shapes were not all captured: parsers accept {item: Dish} / {recipe: Dish} wrappersWhat SKILL.md sets; muted values are Claude Code's defaults
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