opencode-nju-cli 1.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # NJU CLI OpenCode Plugin
2
+
3
+ This package provides an OpenCode plugin for `nju-cli`, plus bundled OpenCode-compatible skill docs for Nanjing University workflows.
4
+
5
+ ## Install
6
+
7
+ Add the npm plugin to `opencode.json`:
8
+
9
+ ```json
10
+ {
11
+ "$schema": "https://opencode.ai/config.json",
12
+ "plugin": ["opencode-nju-cli"]
13
+ }
14
+ ```
15
+
16
+ OpenCode installs npm plugins automatically at startup with Bun.
17
+
18
+ ## Tools
19
+
20
+ The plugin exposes two tools:
21
+
22
+ - `nju_cli`: runs the bundled `nju-cli` binary.
23
+ - `nju_cli_docs`: reads bundled skill guidance before choosing a subcommand.
24
+
25
+ Example prompt:
26
+
27
+ ```text
28
+ 用 nju_cli_docs 看一下 ehall 怎么查培养方案,然后用 nju_cli 查询。
29
+ ```
30
+
31
+ ## Optional Native OpenCode Skill
32
+
33
+ OpenCode discovers native skills from `.opencode/skills/<name>/SKILL.md` or `~/.config/opencode/skills/<name>/SKILL.md`.
34
+
35
+ The npm plugin already exposes `nju_cli_docs`, so this copy step is optional. If you want OpenCode's native `skill` tool to discover `nju-cli`, copy `skills/nju-cli` from this repository or unpacked package to one of the native skill paths:
36
+
37
+ ```bash
38
+ mkdir -p ~/.config/opencode/skills
39
+ cp -R skills/nju-cli ~/.config/opencode/skills/
40
+ ```
41
+
42
+ For project-local use, copy `skills/nju-cli` to `.opencode/skills/nju-cli`.
43
+
44
+ ## Packaged CLI
45
+
46
+ The package includes release binaries under `bin/` and wrappers under `scripts/`.
47
+
48
+ Supported packaged targets:
49
+
50
+ - Linux x86_64
51
+ - Linux aarch64, when release artifacts are synced
52
+ - macOS Apple Silicon
53
+ - Windows x86_64
54
+
55
+ The `nju-cli` binary is built and released from <https://github.com/nju-cli/nju-cli>.
56
+
57
+ ## Development
58
+
59
+ Dry-run the npm package contents:
60
+
61
+ ```bash
62
+ npm pack --dry-run
63
+ ```
Binary file
Binary file
Binary file
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://opencode.ai/config.json",
3
+ "plugin": ["opencode-nju-cli"],
4
+ "permission": {
5
+ "skill": {
6
+ "nju-cli": "allow"
7
+ }
8
+ }
9
+ }
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "opencode-nju-cli",
3
+ "version": "1.3.6",
4
+ "description": "OpenCode plugin and skill docs for Nanjing University workflows powered by nju-cli.",
5
+ "type": "module",
6
+ "main": "./src/index.js",
7
+ "bin": {
8
+ "nju-cli": "scripts/nju-cli.mjs"
9
+ },
10
+ "files": [
11
+ "bin/",
12
+ "scripts/",
13
+ "skills/",
14
+ "src/",
15
+ "LICENSE",
16
+ "README.md",
17
+ "opencode.example.json"
18
+ ],
19
+ "keywords": [
20
+ "opencode",
21
+ "opencode-plugin",
22
+ "nju",
23
+ "nanjing-university",
24
+ "cli",
25
+ "skills"
26
+ ],
27
+ "author": {
28
+ "name": "nju-cli",
29
+ "url": "https://github.com/nju-cli"
30
+ },
31
+ "homepage": "https://github.com/nju-cli/nju-cli",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/nju-cli/opencode-nju-cli.git"
35
+ },
36
+ "license": "GPL-3.0-only",
37
+ "dependencies": {
38
+ "@opencode-ai/plugin": "^1.16.2"
39
+ },
40
+ "engines": {
41
+ "node": ">=18"
42
+ },
43
+ "scripts": {
44
+ "pack:dry-run": "npm pack --dry-run"
45
+ }
46
+ }
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env sh
2
+ set -eu
3
+
4
+ script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
5
+ plugin_dir=$(CDPATH= cd -- "${script_dir}/.." && pwd)
6
+
7
+ os=$(uname -s)
8
+ arch=$(uname -m)
9
+
10
+ case "${os}:${arch}" in
11
+ Linux:x86_64|Linux:amd64)
12
+ bin="${plugin_dir}/bin/linux-x86_64/nju-cli"
13
+ ;;
14
+ Linux:aarch64|Linux:arm64)
15
+ bin="${plugin_dir}/bin/linux-aarch64/nju-cli"
16
+ ;;
17
+ Darwin:arm64|Darwin:aarch64)
18
+ bin="${plugin_dir}/bin/macos-aarch64/nju-cli"
19
+ ;;
20
+ *)
21
+ echo "unsupported platform: ${os}/${arch}" >&2
22
+ exit 1
23
+ ;;
24
+ esac
25
+
26
+ if [ ! -x "${bin}" ]; then
27
+ echo "nju-cli binary is not packaged for ${os}/${arch}; sync package binaries from a release first" >&2
28
+ exit 1
29
+ fi
30
+
31
+ exec "${bin}" "$@"
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env node
2
+ import { spawn } from "node:child_process"
3
+ import { dirname, join } from "node:path"
4
+ import { fileURLToPath } from "node:url"
5
+
6
+ const root = join(dirname(fileURLToPath(import.meta.url)), "..")
7
+
8
+ function binaryPath() {
9
+ if (process.platform === "linux" && process.arch === "x64") return join(root, "bin/linux-x86_64/nju-cli")
10
+ if (process.platform === "linux" && process.arch === "arm64") return join(root, "bin/linux-aarch64/nju-cli")
11
+ if (process.platform === "darwin" && process.arch === "arm64") return join(root, "bin/macos-aarch64/nju-cli")
12
+ if (process.platform === "win32" && process.arch === "x64") return join(root, "bin/windows-x86_64/nju-cli.exe")
13
+
14
+ throw new Error(`nju-cli is not packaged for ${process.platform}/${process.arch}`)
15
+ }
16
+
17
+ const child = spawn(binaryPath(), process.argv.slice(2), {
18
+ stdio: "inherit",
19
+ windowsHide: true,
20
+ })
21
+
22
+ child.on("error", (error) => {
23
+ console.error(error.message)
24
+ process.exit(1)
25
+ })
26
+
27
+ child.on("close", (code, signal) => {
28
+ if (signal) {
29
+ console.error(`nju-cli terminated by ${signal}`)
30
+ process.exit(1)
31
+ }
32
+ process.exit(code ?? 1)
33
+ })
@@ -0,0 +1,11 @@
1
+ $ErrorActionPreference = "Stop"
2
+
3
+ $PluginDir = Resolve-Path (Join-Path $PSScriptRoot "..")
4
+ $Bin = Join-Path $PluginDir "bin/windows-x86_64/nju-cli.exe"
5
+
6
+ if (!(Test-Path $Bin)) {
7
+ Write-Error "nju-cli binary is not packaged for Windows; sync package binaries from a release first"
8
+ }
9
+
10
+ & $Bin @args
11
+ exit $LASTEXITCODE
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: nju-cli
3
+ description: 南京大学相关操作,比如教务通知,交换生,排名,团委等等。
4
+ license: GPL-3.0-only
5
+ compatibility: opencode
6
+ ---
7
+
8
+ # nju-cli
9
+
10
+ 与南京大学网站交互。
11
+
12
+ ## CLI
13
+
14
+ 优先使用 OpenCode plugin 暴露的工具:
15
+
16
+ - `nju_cli`: 运行打包的 `nju-cli` 二进制
17
+ - `nju_cli_docs`: 读取此 skill 及其子命令文档
18
+
19
+ 如果是通过本地 skill 文件使用,也可以直接运行 OpenCode plugin / npm package 内置的 `nju-cli` 二进制:
20
+
21
+ - macOS/Linux: `scripts/nju-cli`
22
+ - Windows: `scripts/nju-cli.ps1`
23
+
24
+ 如果当前安装没有内置二进制,再使用系统 PATH 中的 `nju-cli`。
25
+
26
+ ## Subcommands
27
+
28
+ 这里的文件路径是相对skill目录(也就是此SKILL.md所在目录)来的
29
+
30
+ | 网站 | skill |
31
+ | -------------------------------------------------- | ------------------------------- |
32
+ | 教务网:官方通知、校历,比如毕业要求,四六级考试等 | subcommands/academic-affairs.md |
33
+ | ehall网上办事大厅:包含课表、培养方案、成绩查询等 | subcommands/ehall.md |
34
+ | 交换生管理 | subcommands/exchange-system.md |
35
+ | 南大团委:最新动态、公告通知 | subcommands/youth-league.md |
@@ -0,0 +1,25 @@
1
+ # 教务网
2
+
3
+ ```sh
4
+ # 输出当前全学年教学校历的页面、PDF 和图片链接;不下载、不转文本
5
+ nju-cli academic-affairs calendar
6
+
7
+ # 列出最近 20 条公告,并缓存公告 ID
8
+ nju-cli academic-affairs list
9
+
10
+ # 列出最近 100 条公告
11
+ nju-cli academic-affairs list --page-size 100
12
+
13
+ # 查看公告正文,输出 Markdown;需要先 list
14
+ nju-cli academic-affairs view [公告ID]
15
+ ```
16
+
17
+ 如果想要处理大量通知,或从中搜索,可以先下载:
18
+
19
+ ```sh
20
+ # 下载一条公告;需要先 list
21
+ nju-cli academic-affairs download [公告ID]
22
+
23
+ # 下载多条公告
24
+ nju-cli academic-affairs download [公告ID] [公告ID] [公告ID]
25
+ ```
@@ -0,0 +1,53 @@
1
+ # ehall:全校本科课表
2
+
3
+ 页面进入方式是服务大厅搜索“课表”,选择“本-课表查询”。CLI 对应:
4
+
5
+ ```sh
6
+ # 列出当前学期第 1 页,每页 20 条
7
+ nju-cli ehall all-undergraduate-courses list
8
+
9
+ # 指定页码和页大小
10
+ nju-cli ehall all-undergraduate-courses list --page 2 --page-size 50
11
+
12
+ # 指定学期
13
+ nju-cli ehall all-undergraduate-courses list --term 2025-2026-2
14
+
15
+ # 常用筛选:课程名、教师、校区代码、开课单位代码
16
+ nju-cli ehall all-undergraduate-courses list --course-name 高等数学 --teacher 张三 --campus 3 --department 400290
17
+
18
+ # 任意字段筛选。默认自动推断 builder,也可显式写 FIELD:BUILDER=VALUE
19
+ nju-cli ehall all-undergraduate-courses list --filter KCH=00000041 --filter SKJS=王建华
20
+ nju-cli ehall all-undergraduate-courses list --filter PKDWDM:m_value_equal=400290
21
+
22
+ # 输出完整 JSON
23
+ nju-cli ehall all-undergraduate-courses list --json --page-size 5
24
+ ```
25
+
26
+ 下载会拉取所有匹配课程,默认写 TSV:
27
+
28
+ ```sh
29
+ # 下载当前学期所有课程到 all-undergraduate-courses.tsv
30
+ nju-cli ehall all-undergraduate-courses download
31
+
32
+ # 指定筛选和输出文件
33
+ nju-cli ehall all-undergraduate-courses download --course-name 中国近现代史纲要 -o courses.tsv
34
+
35
+ # 下载 JSON
36
+ nju-cli ehall all-undergraduate-courses download --json -o courses.json
37
+ ```
38
+
39
+ 常用筛选参数:
40
+
41
+ - `--course-id` 课程号 KCH
42
+ - `--course-name` 课程名 KCM
43
+ - `--class-name` 教学班名称 JXBMC
44
+ - `--teacher` 上课教师 SKJS
45
+ - `--campus` 校区代码 XXXQDM
46
+ - `--department` 开课单位代码 PKDWDM
47
+ - `--general-category` 通修课程类别代码 TXKCLB
48
+ - `--weekday` 上课日期 SKXQ
49
+ - `--start-period` 开始节次 KSJC
50
+ - `--end-period` 结束节次 JSJC
51
+ - `--week` 上课周次 SKZC
52
+ - `--building` 教学楼代码 JXLDM
53
+ - `--classroom` 上课教室 SKJAS
@@ -0,0 +1,89 @@
1
+ # ehall:成绩查询
2
+
3
+ 页面进入方式是服务大厅搜索“成绩查询”,选择“成绩查询”。CLI 对应:
4
+
5
+ ## 课程成绩
6
+
7
+ ```sh
8
+ # 列出所有学期
9
+ nju-cli ehall grades terms
10
+
11
+ # 列出默认学期范围内的成绩
12
+ nju-cli ehall grades list
13
+
14
+ # 指定学期,支持多次传入
15
+ nju-cli ehall grades list --term 2025-2026-2
16
+ nju-cli ehall grades list --term 2025-2026-1 --term 2025-2026-2
17
+
18
+ # 按课程名或课程号筛选
19
+ nju-cli ehall grades list --course-name 形势与政策
20
+ nju-cli ehall grades list --course-id 00000080H
21
+
22
+ # 只看及格或未及格课程
23
+ nju-cli ehall grades list --passed
24
+ nju-cli ehall grades list --failed
25
+
26
+ # 和页面里的“显示最高成绩”一致
27
+ nju-cli ehall grades list --show-max-grade
28
+
29
+ # 输出完整 JSON
30
+ nju-cli ehall grades list --json
31
+ ```
32
+
33
+ `list` 的普通输出包含学年学期、课程号、课程名、学分、课程性质、总成绩、是否及格和成绩单标记。
34
+
35
+ ## 四六级成绩
36
+
37
+ ```sh
38
+ # 查询大学英语四级、六级成绩
39
+ nju-cli ehall grades cet
40
+
41
+ # 指定学期
42
+ nju-cli ehall grades cet --term 2023-2024-1
43
+
44
+ # 指定考试项目代码;不传默认 CET4 和 CET6
45
+ nju-cli ehall grades cet --exam-type CET6
46
+
47
+ # 输出完整 JSON
48
+ nju-cli ehall grades cet --json
49
+ ```
50
+
51
+ `cet` 的普通输出包含学年学期、考试项目、成绩、是否通过、考试日期和院系。
52
+
53
+ ## 体测成绩
54
+
55
+ ```sh
56
+ # 查询体测成绩
57
+ nju-cli ehall grades fitness
58
+
59
+ # 指定学期
60
+ nju-cli ehall grades fitness --term 2025-2026-2
61
+
62
+ # 输出完整 JSON
63
+ nju-cli ehall grades fitness --json
64
+ ```
65
+
66
+ `fitness` 的普通输出包含学年学期、考试项目、成绩、是否通过、考试日期和院系。
67
+
68
+ ## 下载
69
+
70
+ 下载会拉取所有匹配成绩,默认写 TSV:
71
+
72
+ ```sh
73
+ # 下载默认学期范围内所有成绩到 grades.tsv
74
+ nju-cli ehall grades download
75
+
76
+ # 指定筛选和输出文件
77
+ nju-cli ehall grades download --term 2025-2026-2 -o grades.tsv
78
+
79
+ # 下载 JSON
80
+ nju-cli ehall grades download --json -o grades.json
81
+
82
+ # 下载四六级成绩
83
+ nju-cli ehall grades download-cet -o cet-grades.tsv
84
+ nju-cli ehall grades download-cet --json -o cet-grades.json
85
+
86
+ # 下载体测成绩
87
+ nju-cli ehall grades download-fitness -o fitness-grades.tsv
88
+ nju-cli ehall grades download-fitness --json -o fitness-grades.json
89
+ ```
@@ -0,0 +1,76 @@
1
+ # ehall:我的课表
2
+
3
+ 页面进入方式是服务大厅搜索“课表”,选择“我的课表”。如果搜索不到入口,先在服务大厅点一次登录;统一认证的 `CASTGC` cookie 不能直接作为 ehall 会话使用。
4
+
5
+ ## 学期和课表
6
+
7
+ ```sh
8
+ # 列出可选学期
9
+ nju-cli ehall my-course-schedule terms
10
+
11
+ # 输出学期接口的完整 JSON
12
+ nju-cli ehall my-course-schedule terms --json
13
+
14
+ # 列出当前学期我的课表
15
+ nju-cli ehall my-course-schedule list
16
+
17
+ # 列出指定学期课表
18
+ nju-cli ehall my-course-schedule list --term 2025-2026-2
19
+
20
+ # 指定页码和页大小
21
+ nju-cli ehall my-course-schedule list --page 1 --page-size 50
22
+
23
+ # 输出课表接口的完整 JSON
24
+ nju-cli ehall my-course-schedule list --term 2025-2026-2 --json
25
+ ```
26
+
27
+ `list` 的普通输出包含课程号、课程名、教师、上课时间地点、开课单位、学分、期末信息和备注等摘要字段。
28
+
29
+ ## 课程详情
30
+
31
+ 课程详情可用课程号 `KCH` 或教学班 `JXBID` 查询,支持一次查询多个课程:
32
+
33
+ ```sh
34
+ # 直接输出课程详情 JSON
35
+ nju-cli ehall my-course-schedule detail 00000080H
36
+
37
+ # 一次查询多个课程
38
+ nju-cli ehall my-course-schedule detail 00000080H 22011720S
39
+
40
+ # 查询指定学期
41
+ nju-cli ehall my-course-schedule detail 00000080H --term 2025-2026-2
42
+
43
+ # 下载详情到目录,每个课程写一个 JSON 文件
44
+ nju-cli ehall my-course-schedule detail 00000080H 22011720S -o course-details
45
+ ```
46
+
47
+ 详情 JSON 会尽量包含接口能拿到的全部课程信息,包括课表行、课程信息、教材信息、选课/教学班信息、期末信息和备注等字段。
48
+
49
+ ## 考试说明
50
+
51
+ 页面底部的考试说明、上课冲突说明等内容来自 `.kssm-container`:
52
+
53
+ ```sh
54
+ nju-cli ehall my-course-schedule exam-notes
55
+ ```
56
+
57
+ ## 免修不免考
58
+
59
+ ```sh
60
+ # 查看所有已申请记录
61
+ nju-cli ehall my-course-schedule exemptions
62
+
63
+ # 只看某个学期的申请记录
64
+ nju-cli ehall my-course-schedule exemptions --term 2025-2026-2
65
+
66
+ # 输出完整 JSON
67
+ nju-cli ehall my-course-schedule exemptions --json
68
+
69
+ # 申请某门课免修不免考,课程参数可以是课程号 KCH 或教学班 JXBID
70
+ nju-cli ehall my-course-schedule apply-exemption 00000080H --reason "已自学相关内容"
71
+
72
+ # 指定学期申请
73
+ nju-cli ehall my-course-schedule apply-exemption 00000080H --term 2025-2026-2 --reason "已自学相关内容"
74
+ ```
75
+
76
+ `apply-exemption` 会先按页面 JS 的流程检查课程是否可申请、选择对应流程和初始状态,再提交申请。这个命令会实际发起申请,运行前确认课程和理由无误。
@@ -0,0 +1,94 @@
1
+ # ehall:本科人才培养方案查询
2
+
3
+ 页面进入方式是服务大厅搜索“培养方案”,选择“本-培养方案查询”。CLI 对应:
4
+
5
+ ```sh
6
+ # 列出所有专业培养方案
7
+ nju-cli ehall training-program list
8
+
9
+ # 按培养方案名称模糊搜索
10
+ nju-cli ehall training-program list --name 计算机
11
+
12
+ # 按年级、院系代码、修读类型代码筛选
13
+ nju-cli ehall training-program list --grade 2026 --department 400290 --study-type 01
14
+
15
+ # 设置每次请求页大小;命令会自动拉取全部匹配结果
16
+ nju-cli ehall training-program list --page-size 200
17
+
18
+ # 输出完整 JSON
19
+ nju-cli ehall training-program list --name 计算机 --json
20
+ ```
21
+
22
+ `list` 的普通输出为 TSV 摘要,包含培养方案代码 `PYFADM`、培养方案名称、年级、院系和专业。后续 `detail`、`nodes` 等命令都需要使用 `PYFADM`。
23
+
24
+ 常用筛选参数:
25
+
26
+ - `--name` 培养方案名称 `PYFAMC`,模糊搜索。
27
+ - `--grade` 年级代码 `NJDM`,如 `2026`。
28
+ - `--department` 院系代码 `DWDM`。
29
+ - `--study-type` 修读类型代码 `XDLXDM`,如 `01`。
30
+
31
+ ## 方案详情
32
+
33
+ ```sh
34
+ # 查看某个培养方案详情
35
+ nju-cli ehall training-program detail PYFADM
36
+
37
+ # 输出完整 JSON
38
+ nju-cli ehall training-program detail PYFADM --json
39
+ ```
40
+
41
+ 普通输出包含培养方案代码、名称、年级、院系、专业、修读类型,以及接口返回的培养目标、修读要求、准出要求等文本。
42
+
43
+ ## 课程结构节点
44
+
45
+ 培养方案里的课程要求以节点树组织,每个节点有节点代码 `KZH`:
46
+
47
+ ```sh
48
+ # 列出某个培养方案的节点树
49
+ nju-cli ehall training-program nodes PYFADM
50
+
51
+ # 输出完整 JSON
52
+ nju-cli ehall training-program nodes PYFADM --json
53
+ ```
54
+
55
+ 普通输出会显示节点树,并提示:
56
+
57
+ ```text
58
+ 课程查询: nju-cli ehall training-program courses PYFADM <KZH>
59
+ 节点详情: nju-cli ehall training-program node-detail PYFADM <KZH>
60
+ ```
61
+
62
+ 节点摘要包含 `KZH`、节点类型、课程类别、课程数、要求学分等信息;如果节点有修读要求或备注,会显示 `[node-detail有额外信息]`。
63
+
64
+ ## 节点详情
65
+
66
+ ```sh
67
+ # 查看某个节点详情
68
+ nju-cli ehall training-program node-detail PYFADM KZH
69
+
70
+ # 输出完整 JSON
71
+ nju-cli ehall training-program node-detail PYFADM KZH --json
72
+ ```
73
+
74
+ 节点详情普通输出包含父节点、节点类型、课程类别、课程数、总学分、至少修读学分、修读要求和备注等字段。
75
+
76
+ ## 节点课程
77
+
78
+ ```sh
79
+ # 查看某个节点下的所有课程
80
+ nju-cli ehall training-program courses PYFADM KZH
81
+
82
+ # 输出完整 JSON
83
+ nju-cli ehall training-program courses PYFADM KZH --json
84
+ ```
85
+
86
+ `courses` 会自动拉取该节点下全部课程。普通输出为 TSV 摘要,包含课程号、课程名、学分、建议修读学期和开课院系。
87
+
88
+ ## 会话说明
89
+
90
+ 该功能默认使用“本科学生组”角色。命令执行前会自动打开应用入口、进入带 `_roleId` 的应用页并切换角色;如果接口返回 302、403 或提示会话异常,通常需要重新执行:
91
+
92
+ ```sh
93
+ nju-cli login --username USERNAME --password PASSWORD
94
+ ```
@@ -0,0 +1,22 @@
1
+ # ehall
2
+
3
+ ehall 命令用于访问南京大学网上办事大厅相关服务。
4
+
5
+ ## 登录
6
+
7
+ 使用 ehall 命令前需要先登录,但本机很可能已经登陆过了:
8
+
9
+ ```sh
10
+ nju-cli login --username USERNAME --password PASSWORD
11
+ ```
12
+
13
+ ## 功能文档
14
+
15
+ 这里的文件路径是相对 skill 目录(也就是 `nju-cli-skills/SKILL.md` 所在目录)来的。
16
+
17
+ | 功能 | CLI 子命令 | 文档 |
18
+ | ------------------------------ | ----------------------------------------- | ------------------------------------------------ |
19
+ | 本科人才培养方案 | `nju-cli ehall training-program` | `subcommands/ehall/training-program.md` |
20
+ | 全校本科课表 | `nju-cli ehall all-undergraduate-courses` | `subcommands/ehall/all-undergraduate-courses.md` |
21
+ | 我的课表 | `nju-cli ehall my-course-schedule` | `subcommands/ehall/my-course-schedule.md` |
22
+ | 成绩查询(课程,四六级,体测) | `nju-cli ehall grades` | `subcommands/ehall/grades.md` |
@@ -0,0 +1,27 @@
1
+ # 交换生系统
2
+
3
+ ## 查看项目
4
+
5
+ ```bash
6
+ nju-cli exchange-system project list --page-size 10
7
+ # 输出: [id] [name]
8
+
9
+ nju-cli exchange-system project view [id]
10
+
11
+ # 如果要处理大量项目描述,可先下载
12
+ nju-cli exchange-system project download [id1] [id2] ...
13
+ ```
14
+
15
+ ## 查看通知
16
+
17
+ 通知一般是公示某个项目通过了哪些人。
18
+
19
+ ```bash
20
+ nju-cli exchange-system notice list --page-size 10
21
+ # 输出: [id] [name]
22
+
23
+ nju-cli exchange-system notice view [id]
24
+
25
+ # 如果要处理大量项目通知,可先下载
26
+ nju-cli exchange-system notice download [id1] [id2] ...
27
+ ```
@@ -0,0 +1,33 @@
1
+ # 南大团委
2
+
3
+ 支持“最新动态”和“公告通知”两个栏目:
4
+
5
+ - `latest-dynamics` 最新动态
6
+ - `announcements` 公告通知
7
+
8
+ ```sh
9
+ # 列出最新动态第 1 页,并缓存文章 ID
10
+ nju-cli youth-league list latest-dynamics
11
+
12
+ # 列出公告通知第 1 页,并缓存文章 ID
13
+ nju-cli youth-league list announcements
14
+
15
+ # 指定页码;团委站点固定每页 14 条
16
+ nju-cli youth-league list announcements --page 2
17
+
18
+ # 查看文章正文,输出 Markdown;需要先 list
19
+ nju-cli youth-league view announcements [文章ID]
20
+ nju-cli youth-league view latest-dynamics [文章ID]
21
+ ```
22
+
23
+ 如果想要处理大量文章,或从中搜索,可以先下载:
24
+
25
+ ```sh
26
+ # 下载一篇文章;需要先 list
27
+ nju-cli youth-league download announcements [文章ID]
28
+
29
+ # 下载多篇文章
30
+ nju-cli youth-league download latest-dynamics [文章ID] [文章ID] [文章ID]
31
+ ```
32
+
33
+ 公告中嵌入的 PDF player 会在 Markdown 末尾保留 PDF 文件的绝对 URL。