canvas CLI is the local interface to Canvas LMS. It reads your Canvas session directly from Chrome cookies — no API token setup required — and prints all output as JSON. You can install it permanently with uv tool install . or run it ad-hoc with uv run canvas.
Installation
Install the canvas command
canvas command is available globally. To pick up local code changes, reinstall:On macOS, Chrome’s Keychain will prompt for access on the first run. Click Allow or Always Allow to proceed.
Subcommands
courses
List enrolled courses and fuzzy-match a course by name.
course
Course-level subcommands:
overview, context, syllabus, pages, page, tabs, tab, people, modules, grades, submissions.assignments
List assignments, show assignment details, and list assignment groups.
discussion
List discussion topics and fetch a full thread with replies.
files
List files, download a file to local temp storage, and list folders.
settings
Manage saved Chrome profile selection and inspect current auth state.
tool
Low-level escape hatch: list every underlying MCP tool or call one directly.
auth-status
Run a live Canvas auth probe and return a JSON diagnostic.
| Command | Description |
|---|---|
canvas courses | List enrolled courses (favorites by default). |
canvas resolve <query> | Fuzzy-match a course by name or code. |
canvas course <sub> | Course-scoped subcommands (overview, context, …). |
canvas assignments <sub> | Assignment subcommands (list, show, groups). |
canvas discussion <sub> | Discussion subcommands (list, show). |
canvas files <sub> | File subcommands (list, download, folders). |
canvas announcements | List announcements across one or more courses. |
canvas calendar | List calendar events. |
canvas url <url> | Parse a Canvas URL and optionally fetch details. |
canvas today | Print today’s date in ISO format. |
canvas tool list | List all underlying MCP tool names. |
canvas tool run <name> | Call any MCP tool by name with a JSON args object. |
canvas settings <sub> | Chrome profile selection and auth state. |
canvas auth-status | Live Canvas auth probe returning JSON. |
Global auth behavior
Before executing any command, the CLI callsensure_canvas_auth_configured, which checks that:
- A Canvas base URL is available (from
CANVAS_BASE_URLor auto-detected from Chrome cookies). - A Canvas session cookie exists in Chrome for that domain.
canvas today— returns the current date without touching Canvas.canvas auth-status— runs its own live probe and always returns JSON, even on failure.
Additional top-level commands
canvas announcements
List announcements across one or more courses.
Canvas course ID. Repeat the flag to include multiple courses.
ISO datetime lower bound for announcements.
ISO datetime upper bound for announcements.
--active (default) returns only active announcements. --all includes inactive ones.Maximum number of announcements to return.
canvas calendar
List calendar events, optionally filtered by course and date range.
Canvas course ID. Repeat for multiple courses. Omit to query across all courses.
Event type filter:
event, assignment, or omit for both.ISO datetime lower bound.
ISO datetime upper bound.
Request all matching events instead of the default filtered view.
Maximum number of events to return.
canvas resolve
Fuzzy-match a course by name or course code.
Course name or code to search for.
Search all active enrollments instead of favorites only.
Maximum number of matches to return.
canvas url
Parse a Canvas URL and optionally fetch the linked object’s details.
The Canvas URL to resolve.
Fetch linked object details. Use
--no-details to parse the URL only.canvas today
Print today’s date in ISO format. Does not require auth.
Tool escape hatch
canvas tool provides direct access to every underlying MCP tool. Use it when you need functionality not yet exposed through a dedicated subcommand.
canvas tool list
Print the names of all available MCP tools as JSON.
canvas tool run
Call any MCP tool by name, passing arguments as a JSON object.
The MCP tool name, exactly as shown by
canvas tool list.JSON object of tool arguments. Must be a valid JSON object (not an array or scalar).
name is not in the list of known tools, the command exits with code 2 and prints the available tool names.
Auth status
canvas auth-status runs a live network probe against Canvas and returns a JSON object. Unlike other commands, it always returns JSON — even when auth fails — making it useful for scripting and diagnostics.
