AgentSkillsCN

myunsw-cli

对myUNSW(悉尼新南威尔士大学学生门户)API进行了逆向工程,实现了自动化操作。 通过curl结合会话Cookie,支持AI智能体查询课程注册、成绩、课表、学费及个人相关信息。 涵盖5大类共27个已文档化的接口端点。

SKILL.md
--- frontmatter
name: myunsw-cli
description: |
  Reverse-engineered myUNSW (UNSW Sydney student portal) API automation.
  Enables AI agents to check enrollment, grades, timetable, fees, and personal info
  via curl + session cookies. 27 documented endpoints across 5 categories.
license: MIT
compatibility: Claude Code, Codex CLI, Cursor, Gemini CLI, GitHub Copilot, Windsurf
metadata:
  author: Steven Cai
  version: "1.0.0"
  repository: https://github.com/Genius-Cai/myunsw-cli
allowed-tools:
  - Bash
  - Read
  - Write
  - Edit
  - Grep
  - Glob
  - AskUserQuestion

myUNSW CLI — UNSW Student Portal Automation

Automate myUNSW operations (enrollment, grades, timetable, fees, personal info) via AI agent + curl.

Prerequisites

Cookie file at /tmp/myunsw_active.txt with JSESSIONID (path=/active), AWSALB, AWSALBCORS. Session expires ~30 min. Validate: curl -s -b /tmp/myunsw_active.txt 'https://my.unsw.edu.au/active/studentClassEnrol/years.xml' | grep -c 'bsdsSequence' (1=valid).

Core Pattern (BSDS Framework)

Every request follows:

  1. GET page → extract bsdsSequence from hidden input
  2. POST to SAME URL → bsdsSequence + bsdsSubmit-{action} + params
  3. Follow 302 redirect → next state
  4. Extract new bsdsSequence, repeat

Rules: always use freshest sequence. Sequential only. Stale sequence = silently ignored.

bash
COOKIE="/tmp/myunsw_active.txt"
BASE="https://my.unsw.edu.au/active"
extract_seq() { grep -oP 'bsdsSequence" value="\K[0-9]+' "$1"; }

Capabilities

ActionHow
Enrollment statusGET years.xml → POST → courses.xml → ?data=classes returns JSON
TimetableNavigate to ENR2.TTBL → timetable.xml?data=classes returns JSON
GradesPOST to studentResults/results.xml with term=XXXX&bsdsSubmit-reload=Go
Academic statementNavigate studentAcadStatement → statement.pdf
FeesstudentFees/reset.xml → select statement
Class searchstudentClassSearch with subject/catalogNbr/term params
Personal infostudentAddress, studentPhone, studentEmail, emergencyContact (read+write)
WaitlistIn ENR2.CRS, bsdsSubmit-manage-waitlist

Term Codes

5253=T1'25, 5256=T2'25, 5259=T3'25, 5263=T1'26, 5266=T2'26, 5269=T3'26. Pattern: +3 per term, ~+4 across years.

Detailed Documentation

See docs/api-reference.md for complete endpoint documentation, JSON schema, and all 27 endpoints. See docs/bsds-framework.md for BSDS state machine reverse engineering notes.