You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run `d2l --json doctor` before anything else. It reports every setup check
88
+
(config, token, API access, courses, onboarding) with a `next_step` command —
89
+
follow it instead of guessing state.
90
+
91
+
If no school is configured, ask the user which school they attend, then run
92
+
`d2l setup --school NAME` (see `d2l setup --list-schools`) or
93
+
`d2l setup --host <their Brightspace URL>`. Never edit source files to
94
+
configure a school.
95
+
79
96
## Agent Defaults
80
97
81
98
1.**Read-only only.** Use `d2l` only for read-only Brightspace data. Never submit assignments, post discussions, modify grades, change settings, or perform actions that mutate D2L state.
82
99
2.**Prefer structured output.** Use `--md` or `--json` when processing data. Human/table output is for display only.
83
100
3.**Put global flags before the command.** Use `d2l --md grades "calc"`, not `d2l grades --md "calc"`.
84
-
4.**Handle auth failures safely.**If the token is expired or invalid, first try `d2l login --headless`. If that fails, hangs, or cannot capture a token, ask the user to log in to D2L again. Ask whether you may launch the browser for them, then run `d2l login`so they can complete the login interactively.
101
+
4.**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.
85
102
5.**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.
86
103
6.**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.
87
104
7.**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.
0 commit comments