| name | d2l |
| description | Fetch read-only academic data from D2L Brightspace and run course onboarding. Use when the user asks about courses, grades, assignments, due dates, quizzes, syllabi, announcements, course content, downloads, academic status, or first-time academic workflow setup. |
| metadata | {"openclaw":{"emoji":"🎓","requires":{"bins":["d2l"]}}} |
D2L Brightspace Academic Data
You have access to the d2l CLI tool which fetches READ-ONLY data from the user's D2L Brightspace LMS.
Quick Reference
d2l --json doctor
d2l setup --list-schools
d2l setup --school gsu
d2l setup --host https://your-school.view.usg.edu
d2l token
d2l whoami
d2l courses
d2l courses --all
d2l grades "data structures"
d2l grades --final
d2l --json grades "econ"
d2l assignments "calc"
d2l due
d2l due --days 14
d2l overdue
d2l calendar
d2l calendar --course "data structures" --days 30
d2l news "data structures"
d2l news
d2l quizzes "data structures"
d2l discussions "data structures"
d2l discussions "data structures" --forum 12345
d2l discussions "data structures" --posts 12345 67890
d2l content "data structures"
d2l content "data structures" --toc
d2l download "data structures" "A06" -o ./assignment6
d2l download "calc" "review" -o ./calc-review
d2l download-content "calc" "Exam Preparation" -o ./exam-prep
d2l download-content "calc" "Unit 3 Materials" -o ./unit3
d2l download-content "data structures" "Big-O" -o ./bigo
d2l syllabus "data structures"
d2l --md syllabus "calc"
d2l --json syllabus "econ"
d2l updates
d2l --md dump
d2l --md dump --course "data structures"
d2l --md dump --shallow
d2l --md dump --since 24
d2l --md dump --since 48
d2l --json dump
d2l onboard
d2l onboard --yes
First-Time Setup
Run d2l --json doctor before anything else. It reports every setup check
(config, token, API access, courses, onboarding) with a next_step command —
follow it instead of guessing state.
If no school is configured, ask the user which school they attend, then run
d2l setup --school NAME (see d2l setup --list-schools) or
d2l setup --host <their Brightspace URL>. Never edit source files to
configure a school.
Agent Defaults
- Read-only only. Use
d2l only for read-only Brightspace data. Never submit assignments, post discussions, modify grades, change settings, mark items complete/read, or perform actions that mutate D2L state.
- Prefer structured output. Use
--md or --json when processing data. Human/table output is for display only.
- Put global flags before the command. Use
d2l --md grades "calc", not d2l grades --md "calc".
- Auth maintains itself. The CLI silently refreshes expired tokens using the saved browser session before any command fails. If a command still reports a sign-in error, the saved session has fully expired — ask the user whether you may launch
d2l login, then run it so they can log in interactively. Never ask them to copy tokens or open DevTools.
- No browser scraping. Do not use browser automation, page scraping, or in-page JavaScript to retrieve D2L course data. Browser login is only for authentication; course data should come from the CLI/API paths.
- Resolve courses carefully. Course arguments can be fuzzy names, course codes, or numeric org unit IDs. If multiple courses match, ask the user to disambiguate or use the numeric ID.
- Fetch policy sources first. For grading policies, course rules, grading weights, prerequisites, or instructor policies, fetch the syllabus first with
d2l --md syllabus COURSE when available.
- Stop on required-source blockers. If required D2L data cannot be fetched because of auth, permissions, or missing access, stop and report the blocker. Do not answer from stale, partial, or guessed data unless the user explicitly accepts that tradeoff.
Output Formats
- Default: human-readable aligned tables
--json: structured JSON (use for programmatic analysis)
--md: AI-optimized markdown with IDs, full text, ISO dates
Always use --md or --json when you need to process the data. Human format is for display only.
Put the flag before the command: d2l --md grades "calc"
Course Name Resolution
Course arguments accept fuzzy names, codes, or numeric IDs:
"data structures" → matches "Data Structures Section 04..."
"econ" → matches "Contemporary Economic Issues..."
"calc" → matches "Calculus II..."
3824526 → exact org unit ID
When Token Expires
Tokens expire hourly, but you normally never notice: every d2l command
auto-refreshes the token in the background from the saved browser session.
If a command still fails with a sign-in error, the saved session itself has
expired. Ask the user whether you may launch the browser for them; if they
agree, run:
d2l login
The user completes browser/SSO login interactively, and the CLI saves the
refreshed token. (d2l login --headless and D2L_NO_AUTO_LOGIN=1 exist for
manual control, but are rarely needed.)
Important
- This tool is strictly read-only. It cannot submit assignments, post discussions, modify grades, or change D2L state.
- Browser login is allowed only for authentication. Do not inspect or scrape course data through the browser.
- The
d2l dump --md command is the best way to get full context about the user's academic situation.
Syllabus
d2l syllabus COURSE fetches the full syllabus from SimpleSyllabus (separate from D2L, no auth needed). It includes course description, grading breakdown, policies, instructor info, and learning outcomes. Use this when the user asks about course policies, grading weights, prerequisites, or what a course covers.
Responding to the User
When the user asks about their classes:
- Run the appropriate
d2l command to fetch the data.
- Parse the output and present it clearly.
- Offer analysis (grade calculations, upcoming deadline warnings, etc.).
- If they ask "what's going on with my classes" or similar broad questions, use
d2l --md dump --shallow first for a quick overview, then drill into specific courses as needed.
- If they ask about grading policies, what grade they need, or course rules, fetch the syllabus first with
d2l --md syllabus COURSE.
- If required D2L data cannot be fetched, stop and explain the blocker instead of guessing.
Course Onboarding SOP
When the user asks to onboard their courses or set up an academic workflow, use:
d2l onboard
The command creates a course-operations SOP file for the current term and a sentinel state file:
D2L_COURSE_SOP.md
.d2l/onboarding.json
The state file stores a fingerprint of the active course list. On future runs, if .d2l/onboarding.json exists, the SOP file exists, and the course fingerprint still matches, onboarding is already complete. Read the SOP instead of repeating the interview. If the fingerprint changed, ask the user whether to refresh onboarding.
Onboarding flow:
- Check auth with
d2l token. If needed, follow the auth flow above.
- Run
d2l onboard and interview the user — that conversation is the default. Use d2l onboard --yes (starter SOP, no prompts) only if the user declines.
- Interview the user briefly about each course: grading style, professor quirks, where deadlines are authoritative, recurring weekly rhythm, external tools, and what kind of help they want from an agent.
- The generated SOP includes:
- course list and IDs
- source-of-truth hierarchy for each course (D2L due dates, syllabus, weekly modules, external docs, etc.)
- per-course workflow/check cadence
- grading/policy notes
- common commands to run
- known ambiguities or missing info
- explicit rules for when to stop and ask the user
- Keep the SOP factual and user-specific, but avoid hard-coding private credentials or secrets.
- Finish with a hand-off: run
d2l --md due --days 14, mention one concrete thing you found, and offer 2–3 things the user could ask right now, built from their actual courses — not generic examples.
Diagnosing problems
When any command fails or state is unclear, run d2l --json doctor and follow
its next_step. For extra detail, read the reference files in
{baseDir}/references/ only when needed.