canvaslms-cli 1.6.2 → 1.6.4-fix
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/CHANGELOG.md +64 -31
- package/README.md +131 -129
- package/dist/commands/announcements.d.ts +2 -2
- package/dist/commands/announcements.d.ts.map +1 -1
- package/dist/commands/announcements.js +29 -20
- package/dist/commands/announcements.js.map +1 -1
- package/dist/commands/api.d.ts +1 -1
- package/dist/commands/api.d.ts.map +1 -1
- package/dist/commands/api.js +1 -1
- package/dist/commands/api.js.map +1 -1
- package/dist/commands/assignments.d.ts +2 -2
- package/dist/commands/assignments.d.ts.map +1 -1
- package/dist/commands/assignments.js +24 -19
- package/dist/commands/assignments.js.map +1 -1
- package/dist/commands/calendar.d.ts +7 -0
- package/dist/commands/calendar.d.ts.map +1 -0
- package/dist/commands/calendar.js +150 -0
- package/dist/commands/calendar.js.map +1 -0
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +102 -85
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/grades.d.ts +2 -2
- package/dist/commands/grades.d.ts.map +1 -1
- package/dist/commands/grades.js +296 -176
- package/dist/commands/grades.js.map +1 -1
- package/dist/commands/list.d.ts +1 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +21 -19
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/modules.d.ts +5 -0
- package/dist/commands/modules.d.ts.map +1 -0
- package/dist/commands/modules.js +263 -0
- package/dist/commands/modules.js.map +1 -0
- package/dist/commands/profile.d.ts.map +1 -1
- package/dist/commands/profile.js +57 -32
- package/dist/commands/profile.js.map +1 -1
- package/dist/commands/submit.d.ts +1 -2
- package/dist/commands/submit.d.ts.map +1 -1
- package/dist/commands/submit.js +88 -79
- package/dist/commands/submit.js.map +1 -1
- package/dist/index.d.ts +16 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -14
- package/dist/index.js.map +1 -1
- package/dist/lib/api-client.d.ts +3 -0
- package/dist/lib/api-client.d.ts.map +1 -1
- package/dist/lib/api-client.js +31 -16
- package/dist/lib/api-client.js.map +1 -1
- package/dist/lib/config-validator.d.ts.map +1 -1
- package/dist/lib/config-validator.js +12 -12
- package/dist/lib/config-validator.js.map +1 -1
- package/dist/lib/config.d.ts +1 -1
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +16 -14
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/display.d.ts +10 -4
- package/dist/lib/display.d.ts.map +1 -1
- package/dist/lib/display.js +263 -167
- package/dist/lib/display.js.map +1 -1
- package/dist/lib/file-upload.d.ts.map +1 -1
- package/dist/lib/file-upload.js +17 -17
- package/dist/lib/file-upload.js.map +1 -1
- package/dist/lib/interactive.d.ts +1 -1
- package/dist/lib/interactive.d.ts.map +1 -1
- package/dist/lib/interactive.js +196 -144
- package/dist/lib/interactive.js.map +1 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.js +83 -63
- package/dist/src/index.js.map +1 -1
- package/dist/types/index.d.ts +34 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +10 -3
- package/dist/commands/coursenames.d.ts +0 -15
- package/dist/commands/coursenames.d.ts.map +0 -1
- package/dist/commands/coursenames.js +0 -150
- package/dist/commands/coursenames.js.map +0 -1
- package/dist/lib/course-utils.d.ts +0 -6
- package/dist/lib/course-utils.d.ts.map +0 -1
- package/dist/lib/course-utils.js +0 -17
- package/dist/lib/course-utils.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,10 +5,45 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.6.4-fix] - 2025-12-15
|
|
9
|
+
|
|
10
|
+
### Fix (1.6.4)
|
|
11
|
+
|
|
12
|
+
- **Remove Postinstall Command**: Change to prepare husky
|
|
13
|
+
|
|
14
|
+
## [1.6.4] - 2025-12-15
|
|
15
|
+
|
|
16
|
+
### Added (1.6.4)
|
|
17
|
+
|
|
18
|
+
- **Modules Command**: New `modules` command to view course modules and their items with progress tracking
|
|
19
|
+
- **Calendar Command**: New `calendar` command to view upcoming assignments and events with due dates
|
|
20
|
+
|
|
21
|
+
### Changed (1.6.4)
|
|
22
|
+
|
|
23
|
+
- **Course Arguments**: Replaced course ID arguments with course name arguments across all commands (assignments, grades, announcements) for easier usage
|
|
24
|
+
- **Workflow Name**: Changed CI workflow name from "CI" to "Test & Build" for better clarity
|
|
25
|
+
|
|
26
|
+
## [1.6.3] - 2025-12-14
|
|
27
|
+
|
|
28
|
+
### Added (1.6.3)
|
|
29
|
+
|
|
30
|
+
- **Live table resize**: Tables re-render automatically when terminal is resized
|
|
31
|
+
- **Adaptive truncation**: Text truncation updates dynamically based on terminal width
|
|
32
|
+
|
|
33
|
+
### Fixed (1.6.3)
|
|
34
|
+
|
|
35
|
+
- **Submit table truncation**: Reduced excessive truncation in the submit table by compacting columns and shortening date format
|
|
36
|
+
- **Table overflow**: Fixed tables overflowing terminal width on small screens
|
|
37
|
+
- **Column width calculation**: Corrected border overhead calculation for accurate fitting
|
|
38
|
+
|
|
39
|
+
### Changed (1.6.3)
|
|
40
|
+
|
|
41
|
+
- **Submit table columns**: Optimized and tightened column widths for compact display (Assignment Name max width set to 35, Type fixed at 8, Due fixed at 16 with MM/DD/YYYY formatting, Status fixed at 12)
|
|
42
|
+
|
|
8
43
|
## [1.6.2] - 2025-12-14
|
|
9
44
|
|
|
10
45
|
- **Table display**: All table now have the same rounded corner format, text size adaptive to the terminal size
|
|
11
|
-
|
|
46
|
+
|
|
12
47
|
## [1.6.1] - 2025-12-13
|
|
13
48
|
|
|
14
49
|
- **Dry Run Mode**: Submit command now supports `--dry-run` flag to test submission flow without actually uploading files or submitting assignments
|
|
@@ -16,7 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
16
51
|
|
|
17
52
|
## [1.6.0] - 2025-12-06
|
|
18
53
|
|
|
19
|
-
### Added
|
|
54
|
+
### Added (1.6.0)
|
|
20
55
|
|
|
21
56
|
- **Boxed Table Displays**: All commands now display data in modern boxed tables with rounded corners (╭╮╰╯)
|
|
22
57
|
- **Adaptive Column Widths**: Tables dynamically adjust column widths based on terminal size for optimal display
|
|
@@ -24,7 +59,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
24
59
|
- **Announcements Table**: Course selection and announcements list now displayed in formatted tables
|
|
25
60
|
- **Profile Table**: User profile information displayed in clean field/value table format
|
|
26
61
|
|
|
27
|
-
### Changed
|
|
62
|
+
### Changed (1.6.0)
|
|
28
63
|
|
|
29
64
|
- **Grades Display**: Merged official grades and calculated statistics into a unified table
|
|
30
65
|
- **CLI Descriptions**: Shortened command descriptions for cleaner help output
|
|
@@ -41,31 +76,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
41
76
|
|
|
42
77
|
## [1.4.7] - 2025-11-05
|
|
43
78
|
|
|
44
|
-
### Added
|
|
79
|
+
### Added (1.4.7)
|
|
45
80
|
|
|
46
|
-
- Show allowed file extensions hint in the interactive file browser when an assignment restricts uploads (e.g.
|
|
81
|
+
- Show allowed file extensions hint in the interactive file browser when an assignment restricts uploads (e.g. `*.pdf`, `*.docx`).
|
|
47
82
|
- Add `r` keybinding to the file browser to reload the current directory listing without exiting the browser.
|
|
48
83
|
|
|
49
|
-
### Fixed
|
|
50
|
-
|
|
51
|
-
- Prevent the interactive file browser from permanently removing other stdin listeners: save and restore `process.stdin` 'data' listeners so `readline` and SIGINT (Ctrl+C) continue to work after browser exit.
|
|
52
|
-
- Filter file browser listings by `allowed_extensions` when provided by the assignment so disallowed file types cannot be selected (prevents HTTP 400 "filetype not allowed").
|
|
53
|
-
- Allow pressing Enter at the final "Proceed with submission? (Y/n)" prompt to accept the default (Yes) to match the shown prompt.
|
|
54
|
-
|
|
55
|
-
### Notes
|
|
56
|
-
|
|
57
|
-
- Bumped package version to 1.4.7.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
### Added
|
|
61
|
-
|
|
62
84
|
- **Enhanced File Selection UX**: Implemented continuous file selection until empty input
|
|
63
85
|
- Browse current directory with file size display
|
|
64
86
|
- Add multiple files one by one
|
|
65
87
|
- Remove files from selection
|
|
66
88
|
- Show currently selected files
|
|
67
89
|
- Smart file filtering (excludes hidden files, package files)
|
|
68
|
-
- **Wildcard support**: Use patterns like
|
|
90
|
+
- **Wildcard support**: Use patterns like `*.html`, `*.js`, `*.pdf` to select multiple files
|
|
69
91
|
- File type icons for better visual identification
|
|
70
92
|
|
|
71
93
|
- **Improved Grade Viewing**:
|
|
@@ -75,6 +97,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
75
97
|
- Better grade formatting and status indicators
|
|
76
98
|
- Support for letter grades, excused, and missing assignments
|
|
77
99
|
|
|
100
|
+
### Notes (1.4.7)
|
|
101
|
+
|
|
102
|
+
- Bumped package version to 1.4.7.
|
|
103
|
+
- Assignment-level grade details with color coding
|
|
104
|
+
- Overall course grade summary
|
|
105
|
+
- Better grade formatting and status indicators
|
|
106
|
+
- Support for letter grades, excused, and missing assignments
|
|
107
|
+
|
|
78
108
|
- **Enhanced Display Names**:
|
|
79
109
|
- Show course names instead of IDs in all commands
|
|
80
110
|
- Display assignment names prominently
|
|
@@ -85,7 +115,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
85
115
|
- Confirmation helpers with default values
|
|
86
116
|
- List selection utilities with cancel option
|
|
87
117
|
|
|
88
|
-
### Improved
|
|
118
|
+
### Improved (1.4.7)
|
|
89
119
|
|
|
90
120
|
- **Submit Command**: Complete redesign with better file selection workflow
|
|
91
121
|
- **Grades Command**: Interactive course selection and detailed assignment grades
|
|
@@ -93,13 +123,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
93
123
|
- **Announcements Command**: Show course names instead of IDs
|
|
94
124
|
- **User Experience**: More consistent and intuitive interfaces across all commands
|
|
95
125
|
|
|
96
|
-
### Fixed
|
|
126
|
+
### Fixed (1.4.7)
|
|
97
127
|
|
|
128
|
+
- Prevent the interactive file browser from permanently removing other stdin listeners: save and restore `process.stdin` 'data' listeners so `readline` and SIGINT (Ctrl+C) continue to work after browser exit.
|
|
129
|
+
- Filter file browser listings by `allowed_extensions` when provided by the assignment so disallowed file types cannot be selected (prevents HTTP 400 "filetype not allowed").
|
|
130
|
+
- Allow pressing Enter at the final "Proceed with submission? (Y/n)" prompt to accept the default (Yes) to match the shown prompt.
|
|
98
131
|
- **Assignment Name Display**: Fixed "Unknown Assignment" issue in submission summary
|
|
99
132
|
- **File Selection Flow**: Better error handling and user guidance during file selection
|
|
100
133
|
- **Variable Scope**: Proper assignment variable handling throughout submission process
|
|
101
134
|
|
|
102
|
-
### Technical
|
|
135
|
+
### Technical (1.4.7)
|
|
103
136
|
|
|
104
137
|
- Enhanced interactive utilities in `lib/interactive.js`
|
|
105
138
|
- Better error handling and user guidance
|
|
@@ -107,19 +140,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
107
140
|
|
|
108
141
|
## [1.1.1] - 2025-07-03
|
|
109
142
|
|
|
110
|
-
### Fixed
|
|
143
|
+
### Fixed (1.1.1)
|
|
111
144
|
|
|
112
145
|
- Removed dotenv dependency that was causing module not found errors
|
|
113
146
|
- Fixed configuration file path to use `.canvaslms-cli-config.json`
|
|
114
147
|
- Resolved package publishing and global installation issues
|
|
115
148
|
|
|
116
|
-
### Added
|
|
149
|
+
### Added (1.1.1)
|
|
117
150
|
|
|
118
151
|
- Dual binary support: both `canvaslms-cli` and `canvas` commands work
|
|
119
152
|
|
|
120
153
|
## [1.1.0] - 2025-07-03
|
|
121
154
|
|
|
122
|
-
### Major Changes
|
|
155
|
+
### Major Changes (1.1.0)
|
|
123
156
|
|
|
124
157
|
- Home directory configuration system (~/.canvaslms-cli-config.json)
|
|
125
158
|
- Interactive configuration setup wizard (`canvas config setup`)
|
|
@@ -131,21 +164,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
131
164
|
- Automatic configuration validation for all commands
|
|
132
165
|
- Improved error handling and user guidance
|
|
133
166
|
|
|
134
|
-
### Changed
|
|
167
|
+
### Changed (1.1.0)
|
|
135
168
|
|
|
136
169
|
- **BREAKING**: Removed environment variable support (.env files)
|
|
137
170
|
- Configuration now stored in user's home directory instead of project directory
|
|
138
171
|
- Enhanced configuration validation with better error messages
|
|
139
172
|
- Improved user onboarding with guided setup process
|
|
140
173
|
|
|
141
|
-
### Removed
|
|
174
|
+
### Removed (1.1.0)
|
|
142
175
|
|
|
143
176
|
- dotenv dependency (no longer needed)
|
|
144
177
|
- Environment variable fallback support
|
|
145
178
|
|
|
146
179
|
## [1.0.0] - 2025-07-03
|
|
147
180
|
|
|
148
|
-
### Added
|
|
181
|
+
### Added (1.0.0)
|
|
149
182
|
|
|
150
183
|
- Initial release of Canvas CLI Tool
|
|
151
184
|
- Modular architecture with separate command handlers
|
|
@@ -162,7 +195,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
162
195
|
- File selection from current directory
|
|
163
196
|
- Detailed verbose modes for all commands
|
|
164
197
|
|
|
165
|
-
### Features
|
|
198
|
+
### Features (1.0.0)
|
|
166
199
|
|
|
167
200
|
- 📚 Course listing with favorites support
|
|
168
201
|
- 📝 Assignment management with status indicators
|
|
@@ -174,7 +207,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
174
207
|
- 🎨 Color-coded grade display
|
|
175
208
|
- 📁 Smart file selection interface
|
|
176
209
|
|
|
177
|
-
### Technical
|
|
210
|
+
### Technical (1.0.0)
|
|
178
211
|
|
|
179
212
|
- Modular command structure in separate files
|
|
180
213
|
- Reusable API client library
|
|
@@ -185,7 +218,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
185
218
|
|
|
186
219
|
## [Unreleased]
|
|
187
220
|
|
|
188
|
-
### Planned Features
|
|
221
|
+
### Planned Features (Unreleased)
|
|
189
222
|
|
|
190
223
|
- Assignment creation and editing
|
|
191
224
|
- Bulk operations
|
package/README.md
CHANGED
|
@@ -1,129 +1,131 @@
|
|
|
1
|
-
# Canvas CLI Tool
|
|
2
|
-
|
|
3
|
-
A modern, user-friendly command-line interface for Canvas LMS. Manage courses, assignments, submissions, grades, and more directly from your terminal.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- List and filter enrolled/starred courses
|
|
8
|
-
- View assignments, grades, and submission status
|
|
9
|
-
- Interactive file upload for assignments
|
|
10
|
-
- View course announcements
|
|
11
|
-
- Display user profile information
|
|
12
|
-
- Direct access to Canvas API endpoints
|
|
13
|
-
|
|
14
|
-
## Installation
|
|
15
|
-
|
|
16
|
-
### Global (Recommended)
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
npm install -g canvaslms-cli
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Setup
|
|
23
|
-
|
|
24
|
-
1. **Get your Canvas API Token**
|
|
25
|
-
- Log in to Canvas
|
|
26
|
-
- Go to Account → Settings
|
|
27
|
-
- Under Approved Integrations, click + New Access Token
|
|
28
|
-
- Copy the generated token
|
|
29
|
-
|
|
30
|
-
2. **Configure the CLI**
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
canvas config
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
3. **Environment Variables**
|
|
37
|
-
|
|
38
|
-
Create a `.env` file in your project root:
|
|
39
|
-
|
|
40
|
-
```env
|
|
41
|
-
CANVAS_DOMAIN=your-canvas-domain.instructure.com
|
|
42
|
-
CANVAS_API_TOKEN=your-api-token
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Usage
|
|
46
|
-
|
|
47
|
-
### Common Commands
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
canvas config # Configure domain and API token
|
|
51
|
-
canvas list # List starred courses
|
|
52
|
-
canvas list -a # List all enrolled courses
|
|
53
|
-
canvas assignments <course> # List assignments for a course
|
|
54
|
-
canvas grades # Interactive course selection + detailed grades
|
|
55
|
-
canvas grades <course-id> # Show detailed grades for specific course
|
|
56
|
-
canvas announcements # Show recent announcements
|
|
57
|
-
canvas profile # Show user profile
|
|
58
|
-
canvas submit # Interactive assignment submission
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### Assignment Submission
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
canvas submit # Interactive mode
|
|
65
|
-
canvas submit -c <courseId> # Specify course
|
|
66
|
-
canvas submit -a <assignmentId> # Specify assignment
|
|
67
|
-
canvas submit -f <file> # Submit specific file
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### Viewing Grades
|
|
71
|
-
|
|
72
|
-
The grades command provides an enhanced, interactive experience:
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
canvas grades # Interactive course selection (active courses)
|
|
76
|
-
canvas grades --all # Include inactive/completed courses
|
|
77
|
-
canvas grades <course-id> # Direct course grade view
|
|
78
|
-
canvas grades --verbose # Include enrollment details
|
|
79
|
-
canvas grades -a -v # All courses with verbose details
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
**Features:**
|
|
83
|
-
|
|
84
|
-
-
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
|
104
|
-
|
|
|
105
|
-
| `
|
|
106
|
-
| `
|
|
107
|
-
| `
|
|
108
|
-
| `
|
|
109
|
-
| `
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
1
|
+
# Canvas CLI Tool
|
|
2
|
+
|
|
3
|
+
A modern, user-friendly command-line interface for Canvas LMS. Manage courses, assignments, submissions, grades, and more directly from your terminal.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- List and filter enrolled/starred courses
|
|
8
|
+
- View assignments, grades, and submission status
|
|
9
|
+
- Interactive file upload for assignments
|
|
10
|
+
- View course announcements
|
|
11
|
+
- Display user profile information
|
|
12
|
+
- Direct access to Canvas API endpoints
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
### Global (Recommended)
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install -g canvaslms-cli
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Setup
|
|
23
|
+
|
|
24
|
+
1. **Get your Canvas API Token**
|
|
25
|
+
- Log in to Canvas
|
|
26
|
+
- Go to Account → Settings
|
|
27
|
+
- Under Approved Integrations, click + New Access Token
|
|
28
|
+
- Copy the generated token
|
|
29
|
+
|
|
30
|
+
2. **Configure the CLI**
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
canvas config
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
3. **Environment Variables**
|
|
37
|
+
|
|
38
|
+
Create a `.env` file in your project root:
|
|
39
|
+
|
|
40
|
+
```env
|
|
41
|
+
CANVAS_DOMAIN=your-canvas-domain.instructure.com
|
|
42
|
+
CANVAS_API_TOKEN=your-api-token
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Usage
|
|
46
|
+
|
|
47
|
+
### Common Commands
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
canvas config # Configure domain and API token
|
|
51
|
+
canvas list # List starred courses
|
|
52
|
+
canvas list -a # List all enrolled courses
|
|
53
|
+
canvas assignments <course> # List assignments for a course
|
|
54
|
+
canvas grades # Interactive course selection + detailed grades
|
|
55
|
+
canvas grades <course-id> # Show detailed grades for specific course
|
|
56
|
+
canvas announcements # Show recent announcements
|
|
57
|
+
canvas profile # Show user profile
|
|
58
|
+
canvas submit # Interactive assignment submission
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Assignment Submission
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
canvas submit # Interactive mode
|
|
65
|
+
canvas submit -c <courseId> # Specify course
|
|
66
|
+
canvas submit -a <assignmentId> # Specify assignment
|
|
67
|
+
canvas submit -f <file> # Submit specific file
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Viewing Grades
|
|
71
|
+
|
|
72
|
+
The grades command provides an enhanced, interactive experience:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
canvas grades # Interactive course selection (active courses)
|
|
76
|
+
canvas grades --all # Include inactive/completed courses
|
|
77
|
+
canvas grades <course-id> # Direct course grade view
|
|
78
|
+
canvas grades --verbose # Include enrollment details
|
|
79
|
+
canvas grades -a -v # All courses with verbose details
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Features:**
|
|
83
|
+
|
|
84
|
+
- 📊 Interactive course selection with grade summary table
|
|
85
|
+
- 📝 Detailed assignment breakdown with scores
|
|
86
|
+
- ✓ Color-coded status indicators (graded, pending, not done)
|
|
87
|
+
- 📈 Calculated totals based on graded assignments
|
|
88
|
+
- 📋 Table-formatted overall grades
|
|
89
|
+
- 🔍 Option to view all courses including inactive ones
|
|
90
|
+
- 🎯 Visual progress tracking with emojis
|
|
91
|
+
|
|
92
|
+
**What you'll see:**
|
|
93
|
+
|
|
94
|
+
1. List of all courses with current/final scores
|
|
95
|
+
2. Select a course to view detailed breakdown
|
|
96
|
+
3. Overall grades (Canvas official + calculated average)
|
|
97
|
+
4. Complete assignment list with individual scores
|
|
98
|
+
5. Points earned vs points possible
|
|
99
|
+
6. Assignment submission status
|
|
100
|
+
|
|
101
|
+
## Command Reference
|
|
102
|
+
|
|
103
|
+
| Command | Alias | Description |
|
|
104
|
+
| --------------- | ---------- | ----------------------- |
|
|
105
|
+
| `list` | `l` | List courses |
|
|
106
|
+
| `assignments` | `assign` | List assignments |
|
|
107
|
+
| `submit` | `sub` | Submit assignment files |
|
|
108
|
+
| `grades` | `grade` | Show grades |
|
|
109
|
+
| `announcements` | `announce` | Show announcements |
|
|
110
|
+
| `profile` | `me` | Show user profile |
|
|
111
|
+
| `config` | - | Show configuration |
|
|
112
|
+
|
|
113
|
+
## Requirements
|
|
114
|
+
|
|
115
|
+
- Node.js >= 14.x
|
|
116
|
+
- npm >= 6.x
|
|
117
|
+
- Valid Canvas LMS API token
|
|
118
|
+
|
|
119
|
+
## Contributing
|
|
120
|
+
|
|
121
|
+
1. Fork the repository
|
|
122
|
+
2. Create a feature branch: `git checkout -b feature-name`
|
|
123
|
+
3. Make your changes
|
|
124
|
+
4. Run tests: `npm test`
|
|
125
|
+
5. Commit: `git commit -am 'Add feature'`
|
|
126
|
+
6. Push: `git push origin feature-name`
|
|
127
|
+
7. Submit a pull request
|
|
128
|
+
|
|
129
|
+
## License
|
|
130
|
+
|
|
131
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ShowAnnouncementsOptions } from
|
|
2
|
-
export declare function showAnnouncements(
|
|
1
|
+
import type { ShowAnnouncementsOptions } from "../types/index.js";
|
|
2
|
+
export declare function showAnnouncements(courseName?: string, options?: ShowAnnouncementsOptions): Promise<void>;
|
|
3
3
|
//# sourceMappingURL=announcements.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"announcements.d.ts","sourceRoot":"","sources":["../../commands/announcements.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"announcements.d.ts","sourceRoot":"","sources":["../../commands/announcements.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAEV,wBAAwB,EACzB,MAAM,mBAAmB,CAAC;AAE3B,wBAAsB,iBAAiB,CACrC,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,IAAI,CAAC,CAiFf"}
|
|
@@ -1,55 +1,64 @@
|
|
|
1
|
-
import { makeCanvasRequest } from
|
|
2
|
-
import { createReadlineInterface, askQuestion } from
|
|
3
|
-
import { pickCourse, displayAnnouncements, displayAnnouncementDetail, printInfo, printError, printSuccess, printWarning } from
|
|
4
|
-
import chalk from
|
|
5
|
-
export async function showAnnouncements(
|
|
1
|
+
import { makeCanvasRequest, getCanvasCourse } from "../lib/api-client.js";
|
|
2
|
+
import { createReadlineInterface, askQuestion } from "../lib/interactive.js";
|
|
3
|
+
import { pickCourse, displayAnnouncements, displayAnnouncementDetail, printInfo, printError, printSuccess, printWarning, } from "../lib/display.js";
|
|
4
|
+
import chalk from "chalk";
|
|
5
|
+
export async function showAnnouncements(courseName, options = {}) {
|
|
6
6
|
let rl = null;
|
|
7
7
|
try {
|
|
8
|
-
let selectedCourseId
|
|
9
|
-
if (!
|
|
10
|
-
const result = await pickCourse({
|
|
8
|
+
let selectedCourseId;
|
|
9
|
+
if (!courseName) {
|
|
10
|
+
const result = await pickCourse({
|
|
11
|
+
title: "\nLoading your courses, please wait...",
|
|
12
|
+
});
|
|
11
13
|
if (!result)
|
|
12
14
|
return;
|
|
13
15
|
selectedCourseId = result.course.id.toString();
|
|
14
16
|
rl = result.rl;
|
|
15
17
|
}
|
|
16
18
|
else {
|
|
19
|
+
const course = await getCanvasCourse(courseName);
|
|
20
|
+
if (!course) {
|
|
21
|
+
printError(`Course "${courseName}" not found.`);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
selectedCourseId = course.id.toString();
|
|
25
|
+
printSuccess(`✓ Using course: ${course.name}`);
|
|
17
26
|
rl = createReadlineInterface();
|
|
18
27
|
}
|
|
19
|
-
const limit = parseInt(options.limit ||
|
|
20
|
-
printInfo(
|
|
21
|
-
const announcements = await makeCanvasRequest(
|
|
28
|
+
const limit = parseInt(options.limit || "5") || 5;
|
|
29
|
+
printInfo("Loading announcements...");
|
|
30
|
+
const announcements = await makeCanvasRequest("get", `courses/${selectedCourseId}/discussion_topics`, [`only_announcements=true`, `per_page=${limit}`]);
|
|
22
31
|
if (!announcements || announcements.length === 0) {
|
|
23
|
-
printWarning(
|
|
32
|
+
printWarning("No announcements found for this course.");
|
|
24
33
|
rl?.close();
|
|
25
34
|
return;
|
|
26
35
|
}
|
|
27
36
|
printSuccess(`Found ${announcements.length} announcement(s).`);
|
|
28
37
|
const announcementTable = displayAnnouncements(announcements);
|
|
29
|
-
const annChoice = await askQuestion(rl, chalk.bold.cyan(
|
|
38
|
+
const annChoice = await askQuestion(rl, chalk.bold.cyan("\nEnter announcement number to view details (0 to exit): "));
|
|
30
39
|
announcementTable.stopWatching();
|
|
31
|
-
if (!annChoice.trim() || annChoice ===
|
|
32
|
-
printWarning(
|
|
40
|
+
if (!annChoice.trim() || annChoice === "0") {
|
|
41
|
+
printWarning("Exiting announcements viewer.");
|
|
33
42
|
rl?.close();
|
|
34
43
|
return;
|
|
35
44
|
}
|
|
36
45
|
const annIndex = parseInt(annChoice) - 1;
|
|
37
46
|
if (annIndex < 0 || annIndex >= announcements.length) {
|
|
38
|
-
printError(
|
|
47
|
+
printError("Invalid announcement selection.");
|
|
39
48
|
rl?.close();
|
|
40
49
|
return;
|
|
41
50
|
}
|
|
42
51
|
const ann = announcements[annIndex];
|
|
43
52
|
displayAnnouncementDetail({
|
|
44
|
-
title: ann?.title ||
|
|
53
|
+
title: ann?.title || "Untitled",
|
|
45
54
|
postedAt: ann?.posted_at || null,
|
|
46
|
-
author: ann?.author?.display_name ||
|
|
47
|
-
message: ann?.message ||
|
|
55
|
+
author: ann?.author?.display_name || "Unknown",
|
|
56
|
+
message: ann?.message || "No content",
|
|
48
57
|
});
|
|
49
58
|
}
|
|
50
59
|
catch (error) {
|
|
51
60
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
52
|
-
console.error(chalk.red(
|
|
61
|
+
console.error(chalk.red("Error: Failed to fetch announcements: ") + errorMessage);
|
|
53
62
|
}
|
|
54
63
|
finally {
|
|
55
64
|
rl?.close();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"announcements.js","sourceRoot":"","sources":["../../commands/announcements.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"announcements.js","sourceRoot":"","sources":["../../commands/announcements.ts"],"names":[],"mappings":"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"}
|
package/dist/commands/api.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ApiQueryOptions } from
|
|
1
|
+
import type { ApiQueryOptions } from "../types/index.js";
|
|
2
2
|
export declare function createQueryHandler(method: string): (endpoint: string, options: ApiQueryOptions) => Promise<void>;
|
|
3
3
|
//# sourceMappingURL=api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../commands/api.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAKzD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../commands/api.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAKzD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,IAE7C,UAAU,MAAM,EAChB,SAAS,eAAe,KACvB,OAAO,CAAC,IAAI,CAAC,CASjB"}
|
package/dist/commands/api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { makeCanvasRequest } from
|
|
1
|
+
import { makeCanvasRequest } from "../lib/api-client.js";
|
|
2
2
|
export function createQueryHandler(method) {
|
|
3
3
|
return async function (endpoint, options) {
|
|
4
4
|
const data = await makeCanvasRequest(method, endpoint, options.query || [], options.body || null);
|
package/dist/commands/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../commands/api.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAMzD,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../commands/api.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAMzD,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,OAAO,KAAK,WACV,QAAgB,EAChB,OAAwB;QAExB,MAAM,IAAI,GAAG,MAAM,iBAAiB,CAClC,MAAM,EACN,QAAQ,EACR,OAAO,CAAC,KAAK,IAAI,EAAE,EACnB,OAAO,CAAC,IAAI,IAAI,IAAI,CACrB,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ListAssignmentsOptions } from
|
|
2
|
-
export declare function listAssignments(
|
|
1
|
+
import type { ListAssignmentsOptions } from "../types/index.js";
|
|
2
|
+
export declare function listAssignments(courseName?: string, options?: ListAssignmentsOptions): Promise<void>;
|
|
3
3
|
//# sourceMappingURL=assignments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assignments.d.ts","sourceRoot":"","sources":["../../commands/assignments.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"assignments.d.ts","sourceRoot":"","sources":["../../commands/assignments.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAGV,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;AAE3B,wBAAsB,eAAe,CACnC,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,IAAI,CAAC,CAmEf"}
|