d2x

July 23, 2026 · View on GitHub

Exercise-driven learning framework — turn any course into a game of edit → save → auto-check → advance

English | 简体中文

C++23 xlings License

d2x owns the learning loop — session progress, file watching, auto-advance — and nothing else. Courses plug in underneath through a small NDJSON Provider protocol; frontends consume a one-way event stream on top. It doesn't know C++, build tools, or how to compile anything.

Quick start

xlings install d2x -y        # install d2x (needs xlings: https://xlings.d2learn.org)
d2x install d2mcpp           # grab a course, environment auto-configured
cd d2mcpp && d2x checker     # start learning — edit, save, it re-checks and advances

Commands

CommandWhat it does
d2x checker [name]interactive practice loop (substring match to jump to an exercise)
d2x statusread-only progress overview, grouped by chapter
d2x install <pkg>fetch a course from the d2x index
d2x bookpreview the course's book locally
d2x new <name>scaffold a new course from the template
d2x configinteractive .d2x.json configuration (language, UI, editor, LLM)
d2x list [query]search available courses

Useful flags: --lang zh|en, --ui tui|print, --emit-events (NDJSON stream for external frontends).

For course authors

A course is a repository with a .d2x.json declaring one command — the Provider — that answers three verbs: describe, exercises, check <id>. Any language works; the reference implementation and conformance suite live in protocol/ and tests/. See the architecture reference.

Courses built with d2x

CourseAbout
d2mcppModern C++ core language features, exercises-as-tests
d2dsHands-on data structures

Forum · Course index · Project template · xlings