@mo7yw4ng/openape 1.0.2 → 1.0.4

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.
Files changed (81) hide show
  1. package/README.md +37 -9
  2. package/esm/deno.js +1 -1
  3. package/esm/src/commands/announcements.d.ts.map +1 -1
  4. package/esm/src/commands/announcements.js +13 -14
  5. package/esm/src/commands/assignments.d.ts +3 -0
  6. package/esm/src/commands/assignments.d.ts.map +1 -0
  7. package/esm/src/commands/assignments.js +230 -0
  8. package/esm/src/commands/auth.d.ts +1 -1
  9. package/esm/src/commands/auth.d.ts.map +1 -1
  10. package/esm/src/commands/auth.js +24 -8
  11. package/esm/src/commands/calendar.d.ts.map +1 -1
  12. package/esm/src/commands/calendar.js +17 -18
  13. package/esm/src/commands/courses.js +3 -3
  14. package/esm/src/commands/forums.d.ts.map +1 -1
  15. package/esm/src/commands/forums.js +132 -45
  16. package/esm/src/commands/materials.d.ts.map +1 -1
  17. package/esm/src/commands/materials.js +176 -48
  18. package/esm/src/commands/quizzes.d.ts.map +1 -1
  19. package/esm/src/commands/quizzes.js +165 -65
  20. package/esm/src/commands/skills.d.ts.map +1 -1
  21. package/esm/src/commands/skills.js +4 -8
  22. package/esm/src/commands/upload.d.ts +3 -0
  23. package/esm/src/commands/upload.d.ts.map +1 -0
  24. package/esm/src/commands/upload.js +58 -0
  25. package/esm/src/commands/videos.d.ts.map +1 -1
  26. package/esm/src/commands/videos.js +113 -79
  27. package/esm/src/index.d.ts.map +1 -1
  28. package/esm/src/index.js +14 -3
  29. package/esm/src/lib/auth.d.ts +23 -1
  30. package/esm/src/lib/auth.d.ts.map +1 -1
  31. package/esm/src/lib/auth.js +36 -3
  32. package/esm/src/lib/moodle.d.ts +226 -2
  33. package/esm/src/lib/moodle.d.ts.map +1 -1
  34. package/esm/src/lib/moodle.js +648 -37
  35. package/esm/src/lib/types.d.ts +82 -164
  36. package/esm/src/lib/types.d.ts.map +1 -1
  37. package/esm/src/lib/types.js +1 -0
  38. package/esm/src/lib/utils.d.ts +40 -0
  39. package/esm/src/lib/utils.d.ts.map +1 -1
  40. package/esm/src/lib/utils.js +82 -4
  41. package/package.json +1 -2
  42. package/script/deno.js +1 -1
  43. package/script/src/commands/announcements.d.ts.map +1 -1
  44. package/script/src/commands/announcements.js +12 -13
  45. package/script/src/commands/assignments.d.ts +3 -0
  46. package/script/src/commands/assignments.d.ts.map +1 -0
  47. package/script/src/commands/assignments.js +269 -0
  48. package/script/src/commands/auth.d.ts +1 -1
  49. package/script/src/commands/auth.d.ts.map +1 -1
  50. package/script/src/commands/auth.js +24 -8
  51. package/script/src/commands/calendar.d.ts.map +1 -1
  52. package/script/src/commands/calendar.js +16 -17
  53. package/script/src/commands/courses.js +2 -2
  54. package/script/src/commands/forums.d.ts.map +1 -1
  55. package/script/src/commands/forums.js +132 -45
  56. package/script/src/commands/materials.d.ts.map +1 -1
  57. package/script/src/commands/materials.js +177 -49
  58. package/script/src/commands/quizzes.d.ts.map +1 -1
  59. package/script/src/commands/quizzes.js +163 -63
  60. package/script/src/commands/skills.d.ts.map +1 -1
  61. package/script/src/commands/skills.js +4 -8
  62. package/script/src/commands/upload.d.ts +3 -0
  63. package/script/src/commands/upload.d.ts.map +1 -0
  64. package/script/src/commands/upload.js +64 -0
  65. package/script/src/commands/videos.d.ts.map +1 -1
  66. package/script/src/commands/videos.js +114 -80
  67. package/script/src/index.d.ts.map +1 -1
  68. package/script/src/index.js +13 -2
  69. package/script/src/lib/auth.d.ts +23 -1
  70. package/script/src/lib/auth.d.ts.map +1 -1
  71. package/script/src/lib/auth.js +70 -3
  72. package/script/src/lib/moodle.d.ts +226 -2
  73. package/script/src/lib/moodle.d.ts.map +1 -1
  74. package/script/src/lib/moodle.js +663 -37
  75. package/script/src/lib/types.d.ts +82 -164
  76. package/script/src/lib/types.d.ts.map +1 -1
  77. package/script/src/lib/types.js +1 -0
  78. package/script/src/lib/utils.d.ts +40 -0
  79. package/script/src/lib/utils.d.ts.map +1 -1
  80. package/script/src/lib/utils.js +89 -3
  81. package/skills/openape/SKILL.md +73 -291
@@ -1,331 +1,113 @@
1
1
  ---
2
2
  name: openape
3
- description: How to use OpenApe CLI — automate CYCU iLearning (Moodle) tasks including course management, video progress tracking, quizzes, materials, grades, forums, announcements, and calendar
3
+ description: "CYCU iLearning (Moodle): Manage courses, videos, quizzes, materials, grades, forums, announcements, and calendar."
4
+ metadata:
5
+ openclaw:
6
+ category: "education"
7
+ requires:
8
+ bins:
9
+ - openape
10
+ cliHelp: "openape --help"
4
11
  ---
5
12
 
6
- # OpenApe CLI
13
+ # openape
7
14
 
8
- Use the `openape` command to access CYCU iLearning (Moodle) platform. OpenApe provides automation for course management, video progress completion, quiz tracking, material downloads, grade viewing, forum discussions, announcements, and calendar events.
9
-
10
- ## Setup
11
-
12
- Install via npm:
13
- ```bash
14
- npm install -g @mo7yw4ng/openape
15
- ```
16
-
17
- Or run without installing:
18
- ```bash
19
- npx @mo7yw4ng/openape --help
20
- ```
21
-
22
- Or install via Deno/JSR:
23
- ```bash
24
- deno install -A -g -n openape jsr:@openape/openape
25
- ```
26
-
27
- If not authenticated, run:
28
- ```bash
29
- openape login
30
- ```
31
- A browser will open for Microsoft OAuth SSO. Complete MFA login manually — no username/password input needed in the terminal.
32
-
33
- Session is saved to `.auth/storage-state.json` and persists between runs. If session expires, run `openape login` again.
34
-
35
- ## Discovering Commands
36
-
37
- Every command supports `--help` for full option details:
38
- ```bash
39
- openape --help
40
- openape courses --help
41
- openape videos complete --help
42
- ```
43
-
44
- Add `--output json` to any command for machine-readable output. Use `--output csv` for spreadsheet format, `--output table` for human-readable tables, or `--output silent` to suppress output.
45
-
46
- ## Course Commands
47
-
48
- ### Listing courses
49
-
50
- ```bash
51
- # List in-progress courses (default)
52
- openape courses list
53
-
54
- # List all courses including past and future
55
- openape courses list --level all
56
-
57
- # List only past courses
58
- openape courses list --level past
59
-
60
- # List only future courses
61
- openape courses list --level future
62
- ```
63
-
64
- Course levels: `in_progress` (default), `past`, `future`, `all`.
65
-
66
- ### Course information
67
-
68
- ```bash
69
- # Get detailed course information
70
- openape courses info <course-id>
71
-
72
- # Get course progress percentage
73
- openape courses progress <course-id>
74
-
75
- # Get course syllabus from CMAP (18-week schedule)
76
- openape courses syllabus <course-id>
77
- ```
78
-
79
- ## Video Commands
80
-
81
- ### Listing videos
15
+ > **PREREQUISITE:** Install and login first:
16
+ >
17
+ > ```bash
18
+ > npm install -g @mo7yw4ng/openape
19
+ > openape login
20
+ > ```
82
21
 
83
22
  ```bash
84
- # List all videos in a course
85
- openape videos list <course-id>
86
-
87
- # List only incomplete videos (browser mode only)
88
- openape videos list <course-id> --incomplete-only
89
- ```
90
-
91
- ### Completing videos
92
-
93
- ```bash
94
- # Complete all incomplete videos in a course
95
- openape videos complete <course-id>
96
-
97
- # Dry-run: discover videos without completing
98
- openape videos complete <course-id> --dry-run
99
-
100
- # Complete all incomplete videos across all courses
101
- openape videos complete-all
102
-
103
- # Dry-run all courses
104
- openape videos complete-all --dry-run
23
+ openape <command> [subcommand] [args] [flags]
105
24
  ```
106
25
 
107
- **Note:** Video completion forges SuperVideo progress AJAX calls to simulate watching the entire video. The server accepts the progress but completion status may take time to update in the course state.
26
+ ## Commands
108
27
 
109
- ### Downloading videos
28
+ ### courses — Course operations
110
29
 
111
- ```bash
112
- # Download all videos from a course
113
- openape videos download <course-id>
30
+ - `list` — List enrolled courses. Flags: `--level in_progress|past|future|all`
31
+ - `info <course-id>` Show detailed course information
32
+ - `progress <course-id>` — Show course completion progress
33
+ - `syllabus <course-id>` — Show course syllabus (from CMAP)
114
34
 
115
- # Download only incomplete videos
116
- openape videos download <course-id> --incomplete-only
35
+ ### videos Video progress operations
117
36
 
118
- # Specify output directory (default: ./downloads/videos)
119
- openape videos download <course-id> --output-dir ./my-videos
120
- ```
37
+ - `list <course-id>` List videos in a course. Flags: `--incomplete-only`
38
+ - `complete <course-id>` Complete all videos in a course
39
+ - `complete-all` — Complete all incomplete videos across all courses. Flags: `--dry-run`
40
+ - `download <course-id>` — Download videos from a course. Flags: `--output-dir <path>`
121
41
 
122
- ## Quiz Commands
42
+ ### quizzes — Quiz operations
123
43
 
124
- ### Listing quizzes
44
+ - `list <course-id>` — List incomplete quizzes in a course
45
+ - `list-all` — List all incomplete quizzes across courses. Flags: `--level in_progress|all`
46
+ - `start <quiz-id>` — Start a new quiz attempt
47
+ - `info <attempt-id>` — Get quiz attempt data and questions. Flags: `--page <number>`
48
+ - `save <attempt-id> '<answers-json>'` — Save answers for a quiz attempt. JSON format: `[{"slot":1,"answer":"0"}]`. Multichoice: number, multichoices: `"0,2"`, shortanswer: text
125
49
 
126
- ```bash
127
- # List quizzes in a specific course
128
- openape quizzes list <course-id>
50
+ ### materials — Material/resource operations
129
51
 
130
- # List all quizzes across all courses
131
- openape quizzes list-all
52
+ - `list-all` — List all materials across courses. Flags: `--level in_progress|all`
53
+ - `download <course-id>` — Download all materials from a course
54
+ - `download-all` — Download all materials from all courses. Flags: `--output-dir <path>`
55
+ - `complete <course-id>` — Mark all incomplete resources (non-video) as complete
56
+ - `complete-all` — Mark all incomplete resources across all in-progress courses
132
57
 
133
- # List only in-progress course quizzes
134
- openape quizzes list-all --level in_progress
135
- ```
58
+ ### assignments Assignment operations
136
59
 
137
- ### Opening quizzes
60
+ - `list <course-id>` — List assignments in a course
61
+ - `list-all` — List all assignments across courses. Flags: `--level in_progress|all`
62
+ - `status <assignment-id>` — Check assignment submission status
63
+ - `submit <assignment-id>` — Submit an assignment. Flags: `--text <content>`, `--file-id <id>`
138
64
 
139
- ```bash
140
- # Open a quiz URL in browser (manual mode)
141
- openape quizzes open <quiz-url>
142
- ```
65
+ ### grades — Grade operations
143
66
 
144
- ## Material Commands
67
+ - `summary` — Show grade summary across all courses
68
+ - `course <course-id>` — Show detailed grades for a course
145
69
 
146
- ### Listing materials
70
+ ### forums — Forum operations
147
71
 
148
- ```bash
149
- # List all materials/resources across all courses
150
- openape materials list-all
72
+ - `list` — List forums from in-progress courses. Flags: `--level in_progress|all`
73
+ - `list-all` — List all forums across all courses
74
+ - `discussions <forum-id>` — List discussions in a forum
75
+ - `posts <discussion-id>` — Show posts in a discussion
76
+ - `post <forum-id> <subject> <message>` — Post a new discussion. Flags: `--subscribe`, `--pin`
77
+ - `reply <post-id> <subject> <message>` — Reply to a discussion post. Flags: `--parent-id <id>`
78
+ - `delete <post-id>` — Delete a forum post or discussion
151
79
 
152
- # List materials from in-progress courses only
153
- openape materials list-all --level in_progress
154
- ```
155
-
156
- Materials include resources (PDFs, documents) and URLs (external links).
80
+ ### announcements Announcement operations
157
81
 
158
- ### Downloading materials
82
+ - `list-all` — List all announcements across courses. Flags: `--unread-only`
83
+ - `read <announcement-id>` — Read a specific announcement (full content)
159
84
 
160
- ```bash
161
- # Download all materials from a specific course
162
- openape materials download <course-id>
85
+ ### calendar — Calendar operations
163
86
 
164
- # Download all materials from all in-progress courses
165
- openape materials download-all
87
+ - `events` List calendar events. Flags: `--course-id <id>`, `--events-after <date>`, `--events-before <date>`
88
+ - `export` — Export calendar events to file. Flags: `--format json|ics`, `--output <file>`
166
89
 
167
- # Download from all courses (including past)
168
- openape materials download-all --level all
90
+ ### upload File upload
169
91
 
170
- # Specify output directory (default: ./downloads)
171
- openape materials download-all --output-dir ./my-materials
172
- ```
92
+ - `file <file-path>` Upload a file to Moodle draft area
173
93
 
174
- ## Grade Commands
94
+ ### skills — Skill management
175
95
 
176
- ### Viewing grades
177
-
178
- ```bash
179
- # Show grade summary across all courses
180
- openape grades summary
181
-
182
- # Show detailed grades for a specific course
183
- openape grades course <course-id>
184
- ```
185
-
186
- ## Forum Commands
187
-
188
- ### Listing forums
189
-
190
- ```bash
191
- # List forums from in-progress courses
192
- openape forums list
193
-
194
- # List all forums across all courses
195
- openape forums list-all
196
-
197
- # List forums from a specific course level
198
- openape forums list-all --level past
199
- ```
200
-
201
- ### Reading discussions
202
-
203
- ```bash
204
- # List discussions in a forum (use cmid or instance ID)
205
- openape forums discussions <forum-id>
206
-
207
- # Show posts in a discussion
208
- openape forums posts <discussion-id>
209
- ```
210
-
211
- ## Announcement Commands
212
-
213
- ### Listing announcements
214
-
215
- ```bash
216
- # List all announcements across all courses
217
- openape announcements list-all
218
-
219
- # List only unread announcements
220
- openape announcements list-all --unread-only
221
- ```
222
-
223
- ### Reading announcements
224
-
225
- ```bash
226
- # Read a specific announcement (shows full content)
227
- openape announcements read <announcement-id>
228
- ```
229
-
230
- ## Calendar Commands
231
-
232
- ### Listing events
233
-
234
- ```bash
235
- # List all calendar events
236
- openape calendar events
237
-
238
- # List events after a specific date
239
- openape calendar events --events-after 2026-03-01
240
-
241
- # List events before a specific date
242
- openape calendar events --events-before 2026-06-30
243
-
244
- # List events in a specific course
245
- openape calendar events --course-id <course-id>
246
- ```
247
-
248
- ### Exporting calendar
249
-
250
- ```bash
251
- # Export calendar events to file
252
- openape calendar export
253
-
254
- # Specify output file (default: calendar_events.json)
255
- openape calendar export --output my-calendar.json
256
-
257
- # Export as ICS format for calendar apps
258
- openape calendar export --format ics --output my-calendar.ics
259
- ```
96
+ - `install [platform]` — Install OpenApe skill to an agent platform (claude, codex, opencode)
97
+ - `show` — Print the raw SKILL.md content
260
98
 
261
99
  ## Output Formats
262
100
 
263
- All commands support `--output` option:
264
- - `json` (default) - Machine-readable JSON
265
- - `csv` - Comma-separated values for spreadsheets
266
- - `table` - Human-readable table format
267
- - `silent` - Suppress output (useful for automation)
268
-
269
- Global options:
270
- - `--verbose` - Enable debug logging
271
- - `--silent` - Suppress all log output (JSON only)
272
- - `--headed` - Run browser in visible mode (for debugging)
101
+ All commands support `--output`: `json` (default), `csv`, `table`, `silent`
273
102
 
274
- ## Example Workflows
275
-
276
- **Check daily progress:** See what's due and what's incomplete.
277
- ```bash
278
- openape courses list --level in_progress
279
- openape videos list <course-id>
280
- openape quizzes list-all
281
- openape announcements list-all --unread-only
282
- ```
283
-
284
- **Auto-complete videos:** Complete all incomplete videos across courses.
285
- ```bash
286
- # First, dry-run to see what will be completed
287
- openape videos complete-all --dry-run
288
-
289
- # Then actually complete them
290
- openape videos complete-all
291
- ```
103
+ Global flags: `--verbose`, `--headed`, `--session <path>`
292
104
 
293
- **Download all materials:** Get all course materials for offline study.
294
- ```bash
295
- openape materials download-all --output-dir ./semester-materials
296
- ```
297
-
298
- **Check grades and progress:** See how you're doing in all courses.
299
- ```bash
300
- openape grades summary
301
- openape courses progress <course-id>
302
- openape courses syllabus <course-id>
303
- ```
304
-
305
- **Review discussions:** Catch up on forum activity.
306
- ```bash
307
- openape forums list --level in_progress
308
- openape forums discussions <forum-id>
309
- openape forums posts <discussion-id>
310
- ```
105
+ ## Discovering Commands
311
106
 
312
- **Plan your week:** Check upcoming events and deadlines.
313
107
  ```bash
314
- openape calendar events --events-after 2026-03-21 --events-before 2026-03-28
315
- openape calendar export --format ics --output week.ics
316
- ```
108
+ # Browse all commands
109
+ openape --help
317
110
 
318
- **Bulk operations:** Complete videos and download materials across all courses.
319
- ```bash
320
- openape videos complete-all
321
- openape materials download-all --level in_progress
111
+ # Inspect a command's subcommands and options
112
+ openape <command> --help
322
113
  ```
323
-
324
- ## Tips
325
-
326
- - Use `--dry-run` with `videos complete` to preview what will be completed
327
- - Use `--level in_progress` (default) to focus on active courses
328
- - Use `--output json` for scripting and automation
329
- - Use `--output table` for human-readable output
330
- - Session persists after login, no need to re-authenticate
331
- - WS API mode is used by default for faster performance; browser mode is fallback