/pku-cli:info-commonfrom pku-cli
Provides shared authentication, session management, and credential resolution for PKU CLI tools (treehole, course, etc.). Useful when working on IAAA login, OTP, keyring integration, or adding new CLI tools needing PKU 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.
The shared library crate providing authentication, session management, and utilities for all IAAA-based CLI tools.
crates/info-common/~/.config/info/<name>/ for each consumer crateiaaa.rs — IAAA Unified AuthenticationIaaaConfig with app_id and redirect_url:
app_id="PKU Helper", redirect to /chapi/cas_iaaa_loginapp_id="blackboard", redirect to Blackboard SSOapp_id="portal2017", redirect to portal → berserker-authapp_id="elective", redirect to elective SSOotp.rs — TOTP Code Generationsession.rs — Session & Cookie PersistenceStore::new(APP_NAME) creates storage at ~/.config/info/<name>/session.json — token, expires_at, uid, created_at, extra (serde_json::Value)cookies.json — reqwest CookieStore serialized as JSONcredential.rs — Unified Credential Resolutionkeyring crate with platform-specific backends:
PKU_USERNAME, PKU_PASSWORD, PKU_SMS_CODEresolve_sms_code() — env var PKU_SMS_CODE → interactiveconfirm_send_sms() — auto-confirms when PKU_SMS_CODE is setkeyring_store(), keyring_clear(), keyring_has_credential()check_session(app_name) — returns Valid / Expired / NotFoundqr.rs — Terminal QR Code Displayviuer crateAll IAAA-based CLI tools use credential::resolve_credential() for login. The resolution order:
info-pku service) — set by info-auth storePKU_USERNAME + PKU_PASSWORD)AI Agents should:
info-auth check to verify session status before operations<tool> login -p to trigger auto-login from keyringPKU_SMS_CODE env var if SMS verification is neededTo add a new IAAA-based CLI tool:
crates/info-common in Cargo.tomlIaaaConfig with the service's app_id and redirect_urlcredential::resolve_credential() instead of manual stdin inputcomplete_*_login() to exchange the IAAA token with the target servicesession.expires_at when saving sessionsStore::new("tool-name") for session persistenceclient.rs pattern: build() for auth requests, build_simple() for IAAA loginanyhow::Result with .context("中文描述")#[allow(dead_code)]What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
pku-auth, iaaa, cli-tools, authentication, session-management, keyring
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