@mo7yw4ng/openape 1.0.3 → 1.0.5

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