Hermione VSCode Extension
Reports which file a student has active to the Hermione backend, so a teacher
can see live what each student is working on (for timely intervention) and so
time-on-task per file and per exercise can be analyzed offline.
It is passive and transparent: it never changes the student's editor. It
sends a small JSON event when the active file changes, a periodic heartbeat
while a file stays focused (paused when the window is unfocused), an edit
event summarizing each burst of typing, and a close event when a file is
closed.
Edits are reported as a count of changes, never their content — enough to
tell a student who is writing code from one who is stuck on the same screen,
without shipping their work off the machine.
What it sends
POST {serverUrl}/api/file-events with a batch of:
{
"student": "alice",
"workspace": "course",
"path": "/home/alice/course/ex1/main.py",
"relativePath": "ex1/main.py",
"language": "python",
"exercise": "ex1", // resolved from .hermione.json, if any
"kind": "focus", // "focus" | "heartbeat" | "edit" | "close"
"edits": 12, // "edit" only: changes coalesced into this event
"line": 42, // 1-based cursor line, when the file is on screen
"atUnixMs": 1718200000000
}
Events are queued and retried, so a brief backend outage neither loses data nor
disrupts the editor.
It also opens a WebSocket (/ws) to receive teacher broadcasts for the
course in real time, shown as notifications. On (re)connect it replays anything
missed via a since cursor, so messages aren't lost across disconnects.
Settings
| Setting |
Default |
Description |
hermione.serverUrl |
http://localhost:8080 |
Backend URL (overridden by backend in .hermione.json / $HERMIONE_*) |
hermione.student |
"" |
Manual identity override (identity is otherwise derived — see below) |
hermione.token |
"" |
Course enrollment token (overridden by token in .hermione.json / $HERMIONE_TOKEN) |
hermione.heartbeatSeconds |
15 |
How often to confirm the current file is active |
hermione.enabled |
true |
Start reporting automatically |
Commands: Hermione: Start / Stop Reporting, Hermione: Set Student Identifier.
Course config & identity (.hermione.json)
The committed .hermione.json is the single course config — it carries the
backend, enrollment token, identity source, and the file→exercise mapping. The
student identity is derived from the container environment (no login); the
identity field picks the source (github / git-email / env / os, or
auto). See examples/course-template for the
trust model.
{
"backend": "https://hermione.example.edu:50051",
"token": "<course enrollment token>",
"identity": "github",
"exercises": [
{ "name": "ex1", "match": "ex1/**" },
{ "name": "ex2", "match": ["ex2/**", "solutions/ex2/*"] }
]
}
Files that match no rule simply have no exercise.
Develop
npm install
npm run compile # type-check (tsc --noEmit)
npm run bundle # build out/extension.js (esbuild, inlines `ws`)
npm run package # produce hermione-vscode.vsix
Then press F5 in VSCode to launch an Extension Development Host. Make sure the
backend is running (cargo run -p hermione-server) and open
http://localhost:8080 to watch activity appear on the board.