A command-line interface for interacting with the Canvas LMS API. This tool simplifies common Canvas tasks for instructors and teaching assistants.
- List courses, assignments, files, students, and assignment groups
- Set and view configuration options
- Create and edit assignments from Markdown files with YAML frontmatter
- Upload files to Canvas
- Create assignment groups
- Download and display gradebook information
pip install git+https://github.com/clemson-cal/canvas-cli.git(Coming soon... for now just check out the repository and use the script)
Required dependencies:
- canvasapi
- typer
- rich
- pyyaml
- markdown
You will need a Canvas API key. Go to Account > Settings > New Access Token. Commands in the set category create or modify a .canvas file in the current directory.
python canvas.py set api_url https://your-institution.instructure.com
python canvas.py set api_key your-canvas-api-key
python canvas.py list courses # find the ID of your course, e.g. 123456
python canvas,pu set course 123456python canvas.py show api_url
python canvas.py show coursepython canvas.py list courses
python canvas.py list assignments
python canvas.py list files
python canvas.py list students
python canvas.py list assignment_groupsCreate a Markdown file with YAML frontmatter like:
---
name: Homework 6
points_possible: 4
assignment_group_id: 12345
due_at: January 15, 2026 09:30
submission_types: on_paper
---
# Assignment Title
Instructions go here...
Inline LaTeX is marked like this: \( \exp(i\phi) = \cos(\phi) + i \sin(\phi) \)
[Links](the_file_id) to uploaded files (with Canvas preview if PDF) will be supported soon...The YAML header contains assignment meta-data. To see allowed keys and values consult the Canvas API docs here.
Then create the assignment:
python canvas.py create assignment hw6.md --publishpython canvas.py create file path/to/file.pdfpython canvas.py create assignment_group "Homework"python canvas.py list assignment_groupsThe tool supports Markdown formatting and preserves LaTeX math expressions (enclosed in \( and \)) when creating assignments.