pku-elective
A command-line client for PKU Course Selection (选课网) with auto-enrollment.
Automate PKU's course add/drop period. Define your target courses, configure a CAPTCHA solver backend, and let the tool poll for open slots and enroll you automatically.
Install
Or install the complete PKU toolkit:
Setup
Store your IAAA credentials once (encrypted in your OS keychain):
Then login:
[!IMPORTANT] Dual-degree students must specify
--dual majoror--dual minor. Single-degree students should omit the flag.
Usage
Browse Your Selections
Auto-Enrollment Setup
CAPTCHA Backend
Run the Auto-Enroll Loop
The loop continuously polls for open slots in your target courses and attempts enrollment. It will continue running until all targets are enrolled or you press Ctrl+C.
TOTP (手机令牌)
How It Works
The elective system uses HTML scraping for course data and base64-encoded images for CAPTCHAs. The auto-enroll loop respects the server's pace to avoid rate limiting while maximizing your chance of catching an open slot.
Links
- Repository: github.com/pkuinfo/pkucli
- Full documentation: See the main README
- Claude Code Skill:
pku-electiveon Clawhub