campuscard

PKU 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.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "campuscard" with this command: npx skills add wjsoj/pku-campuscard

Campuscard - 北大校园卡 CLI

A CLI client for PKU's campus card system (Synjones platform at bdcard.pku.edu.cn).

Architecture

  • Crate location: crates/campuscard/
  • Auth flow: IAAA SSO (app_id="portal2017") → portal → berserker-auth → JWT
  • API: JSON REST with synjones-auth header
  • Constraints: Requires mobile UA (PKUANDROID) and http1_only() (server rejects HTTP/2)

Key Source Files

  • src/main.rs — Clap CLI with subcommands
  • src/commands.rs — Command implementations
  • src/api.rs — API client with synjones-auth header injection
  • src/display.rs — Terminal output, QR code rendering
  • src/client.rs — reqwest client with mobile UA and HTTP/1.1 enforcement

CLI Commands

CommandAliasFunction
login / logout / statusIAAA → portal → berserker → JWT
infoCard balance and details
payDisplay payment QR code in terminal
rechargeTop up card balance
billslsTransaction history (pagination, monthly filter)
statsMonthly spending statistics
otpTOTP 2FA management

Auto-Login for AI Agents

# Check session status
info-auth check

# Auto-login (reads credentials from OS keyring, no password needed)
campuscard login -p

Development Notes

  • The auth chain is the most complex: IAAA → portal → berserker-auth → JWT token
  • Must use mobile User-Agent (PKUANDROID) or requests will be rejected
  • Must use http1_only() — the Synjones server does not support HTTP/2
  • QR code for payment displayed via info_common::qr (viuer or system viewer)
  • All user-facing strings in Chinese
  • Error handling: anyhow::Result with .context("中文描述")
  • Session persisted to ~/.config/info/campuscard/
  • Credentials resolved via info_common::credential (keyring → env → interactive)

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

PKU CWFW

北京大学财务综合信息门户 (cwfw.pku.edu.cn / WF_CWBS) CLI 工具。当用户提及 cwfw、财务门户、财务综合信息门户、个人酬金、工资查询、报销查询 时使用此 skill。Also use when dealing with cwfw IAAA 登录 (app_id=IIPF)、home...

Registry SourceRecently Updated
610Profile unavailable
Coding

Treehole

PKU Treehole (北大树洞) anonymous forum CLI tool built in Rust. Use this skill when working on the treehole crate, debugging treehole commands, adding features t...

Registry SourceRecently Updated
1450Profile unavailable
Coding

PKU BDKJ

北京大学空间 (bdkj.pku.edu.cn) 学术研讨教室预约 CLI 工具。当用户提及 bdkj、北大空间、学术研讨教室、教室预约、研讨间、借教室 或想要查询/预约/取消 二教/四教/地学 教学楼里的空闲学术研讨教室时使用此 skill。支持保存固定参与人分组(如课题组),重复发起预约时只需 `--grou...

Registry SourceRecently Updated
580Profile unavailable
Coding

PKU Claspider

北京大学课程信息爬取 CLI (dean.pku.edu.cn 教务部 + elective.pku.edu.cn 选课网 + onlineroomse.pku.edu.cn 智云课堂)。当用户提及 claspider、课程爬虫、课程信息爬取、课程目录、全校开课、按院系/教师/关键词查课、合并课程数据 时使用此...

Registry SourceRecently Updated
570Profile unavailable