canvaslms-cli 1.4.2 → 1.4.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.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 Canvas CLI Tool
3
+ Copyright (c) 2025 Dang Duy Toan
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,182 +1,106 @@
1
1
  # Canvas CLI Tool
2
2
 
3
- A powerful command-line interface for interacting with Canvas LMS API. This tool allows you to manage courses, assignments, submissions, and more directly from your terminal.
3
+ A modern, user-friendly command-line interface for Canvas LMS. Manage courses, assignments, submissions, grades, and more directly from your terminal.
4
+
5
+ ---
4
6
 
5
7
  ## Features
6
8
 
7
- - 📚 **Course Management**: List starred and enrolled courses
8
- - 📝 **Assignment Operations**: View assignments, grades, and submission status
9
- - 🚀 **File Submission**: Interactive file upload for assignments (single or multiple files)
10
- - 📢 **Announcements**: View course announcements
11
- - 👤 **Profile Management**: View user profile information
12
- - 🔧 **Raw API Access**: Direct access to Canvas API endpoints
9
+ - List and filter enrolled/starred courses
10
+ - View assignments, grades, and submission status
11
+ - Interactive file upload for assignments
12
+ - View course announcements
13
+ - Display user profile information
14
+ - Direct access to Canvas API endpoints
15
+
16
+ ---
13
17
 
14
18
  ## Installation
15
19
 
16
- ### Global Installation (Recommended)
20
+ ### Global (Recommended)
17
21
 
18
22
  ```bash
19
23
  npm install -g canvas-cli-tool
20
24
  ```
21
25
 
22
- ### Local Installation
26
+ ### Local (Project)
23
27
 
24
28
  ```bash
25
29
  npm install canvas-cli-tool
26
30
  ```
27
31
 
32
+ ---
33
+
28
34
  ## Setup
29
35
 
30
- 1. **Get your Canvas API token**:
31
- - Log into your Canvas instance
36
+ 1. **Get your Canvas API Token**
37
+ - Log in to Canvas
32
38
  - Go to Account → Settings
33
- - Scroll down to "Approved Integrations"
34
- - Click "+ New Access Token"
39
+ - Under Approved Integrations, click + New Access Token
35
40
  - Copy the generated token
36
41
 
37
- 2. **Configure the CLI**:
42
+ 2. **Configure the CLI**
43
+
38
44
  ```bash
39
45
  canvas config
40
46
  ```
41
47
 
42
- 3. **Create a `.env` file** in your project root:
48
+ 3. **Environment Variables**
49
+
50
+ Create a `.env` file in your project root:
51
+
43
52
  ```env
44
53
  CANVAS_DOMAIN=your-canvas-domain.instructure.com
45
54
  CANVAS_API_TOKEN=your-api-token
46
55
  ```
47
56
 
48
- ## Usage
49
-
50
- ### Basic Commands
51
-
52
- ```bash
53
- # Show configuration help
54
- canvas config
55
-
56
- # List starred courses (default)
57
- canvas list
58
-
59
- # List all enrolled courses
60
- canvas list -a
61
-
62
- # List courses with detailed information
63
- canvas list -v
64
-
65
- # Show user profile
66
- canvas profile
67
-
68
- # Show detailed profile information
69
- canvas profile -v
70
- ```
71
-
72
- ### Assignment Operations
73
-
74
- ```bash
75
- # List assignments for a course
76
- canvas assignments 12345
77
-
78
- # Show detailed assignment information
79
- canvas assignments 12345 -v
57
+ ---
80
58
 
81
- # Show only submitted assignments
82
- canvas assignments 12345 -s
83
-
84
- # Show only pending assignments
85
- canvas assignments 12345 -p
86
- ```
87
-
88
- ### File Submission
89
-
90
- ```bash
91
- # Interactive assignment submission
92
- canvas submit
93
-
94
- # Submit with specific course ID
95
- canvas submit -c 12345
96
-
97
- # Submit with specific assignment ID
98
- canvas submit -a 67890
99
-
100
- # Submit specific file
101
- canvas submit -f myfile.pdf
102
- ```
59
+ ## Usage
103
60
 
104
- ### Grades and Announcements
61
+ ### Common Commands
105
62
 
106
63
  ```bash
107
- # Show grades for all courses
108
- canvas grades
109
-
110
- # Show grades for specific course
111
- canvas grades 12345
112
-
113
- # Show recent announcements
114
- canvas announcements
115
-
116
- # Show announcements for specific course
117
- canvas announcements 12345
64
+ canvas config # Configure domain and API token
65
+ canvas list # List starred courses
66
+ canvas list -a # List all enrolled courses
67
+ canvas assignments <course> # List assignments for a course
68
+ canvas grades # Show grades for all courses
69
+ canvas announcements # Show recent announcements
70
+ canvas profile # Show user profile
71
+ canvas submit # Interactive assignment submission
118
72
  ```
119
73
 
120
- ### Raw API Access
74
+ ### Assignment Submission
121
75
 
122
76
  ```bash
123
- # GET request
124
- canvas get users/self
125
-
126
- # GET with query parameters
127
- canvas get courses -q enrollment_state=active
128
-
129
- # POST request with data
130
- canvas post courses/123/assignments -d '{"assignment": {"name": "Test"}}'
131
-
132
- # POST with data from file
133
- canvas post courses/123/assignments -d @assignment.json
77
+ canvas submit # Interactive mode
78
+ canvas submit -c <courseId> # Specify course
79
+ canvas submit -a <assignmentId> # Specify assignment
80
+ canvas submit -f <file> # Submit specific file
134
81
  ```
135
82
 
136
83
  ## Command Reference
137
84
 
138
- | Command | Alias | Description |
139
- |---------|-------|-------------|
140
- | `list` | `l` | List courses |
141
- | `assignments` | `assign` | List assignments |
142
- | `submit` | `sub` | Submit assignment files |
143
- | `grades` | `grade` | Show grades |
144
- | `announcements` | `announce` | Show announcements |
145
- | `profile` | `me` | Show user profile |
146
- | `config` | - | Show configuration |
147
- | `get` | `g` | GET API request |
148
- | `post` | `p` | POST API request |
149
- | `put` | - | PUT API request |
150
- | `delete` | `d` | DELETE API request |
151
-
152
- ## File Structure
85
+ | Command | Alias | Description |
86
+ |-----------------|-----------|-----------------------------------|
87
+ | `list` | `l` | List courses |
88
+ | `assignments` | `assign` | List assignments |
89
+ | `submit` | `sub` | Submit assignment files |
90
+ | `grades` | `grade` | Show grades |
91
+ | `announcements` | `announce`| Show announcements |
92
+ | `profile` | `me` | Show user profile |
93
+ | `config` | - | Show configuration |
153
94
 
154
- ```
155
- canvas-cli-tool/
156
- ├── src/
157
- │ └── index.js # Main CLI entry point
158
- ├── lib/
159
- │ ├── api-client.js # Canvas API client
160
- │ ├── config.js # Configuration management
161
- │ ├── file-upload.js # File upload utilities
162
- │ └── interactive.js # Interactive prompt utilities
163
- ├── commands/
164
- │ ├── list.js # List courses command
165
- │ ├── assignments.js # Assignments command
166
- │ ├── submit.js # Submit command
167
- │ ├── grades.js # Grades command
168
- │ ├── announcements.js # Announcements command
169
- │ ├── profile.js # Profile command
170
- │ ├── config.js # Config command
171
- │ └── api.js # Raw API commands
172
- └── package.json
173
- ```
95
+ ---
174
96
 
175
97
  ## Requirements
176
98
 
177
- - Node.js >= 14.0.0
178
- - npm >= 6.0.0
179
- - Valid Canvas LMS access with API token
99
+ - Node.js >= 14.x
100
+ - npm >= 6.x
101
+ - Valid Canvas LMS API token
102
+
103
+ ---
180
104
 
181
105
  ## Contributing
182
106
 
@@ -184,10 +108,12 @@ canvas-cli-tool/
184
108
  2. Create a feature branch: `git checkout -b feature-name`
185
109
  3. Make your changes
186
110
  4. Run tests: `npm test`
187
- 5. Commit your changes: `git commit -am 'Add feature'`
188
- 6. Push to the branch: `git push origin feature-name`
111
+ 5. Commit: `git commit -am 'Add feature'`
112
+ 6. Push: `git push origin feature-name`
189
113
  7. Submit a pull request
190
114
 
115
+ ---
116
+
191
117
  ## License
192
118
 
193
- MIT License - see [LICENSE](LICENSE) file for details.
119
+ MIT License - see [LICENSE](LICENSE) for details.