From pku-cli
Provides IAAA SSO authentication, TOTP OTP generation, session and cookie persistence, keyring credential resolution, and terminal QR rendering for PKU Rust CLI tools.
npx claudepluginhub pkuinfo/pkucli --plugin pku-cliThis skill uses the workspace's default tool permissions.
The shared library crate providing authentication, session management, and utilities for all IAAA-based CLI tools.
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.
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)]