Skip to content

Building plugins

OpenL2 supports third-party plugins for exporting compiled courses to new apps, connecting AI clients over MCP, and exchanging learner memory state via openl2-study.

(Looking to use the built-in Anki, Book, or Jetway plugins? See Export & publish a course.)

List all registered exporter plugins in your environment:

Terminal window
openl2 plugins list

External Python packages can advertise themselves to openl2 plugins list and openl2.plugins.registry.list_plugins() by declaring an entry point in the openl2.plugins group:

[project.entry-points."openl2.plugins"]
my_target = "my_package.openl2_plugin"

In my_package/openl2_plugin.py:

from openl2.plugins.registry import OpenL2Plugin, register_plugin
register_plugin(
OpenL2Plugin(
name="my-target",
package="my_package",
description="Export OpenL2 courses to My Target",
commands=("my-target-export",),
)
)

Note: OpenL2Plugin registers discovery metadata only—it does not automatically mount a subcommand onto openl2. Ship your own CLI entry point (for example, my-target-export) that calls compile_level_export(...), and list its command names in commands for discoverability.

See Integrating OpenL2 for the compile_level_export(...) Python API, and src/openl2/plugins/anki/, src/openl2/plugins/book/, and src/openl2/plugins/jetway/ for reference implementations.

plugins/openl2-course-design/ is a reference plugin wrapping openl2-course-design-mcp for AI clients (Codex, Claude Desktop, Cursor). You can follow the same layout (.mcp.json + plugin manifest) to bundle custom MCP tools or authoring workflows.

Apps, browser extensions, and SRS add-ons can integrate with OpenL2 without depending on the Python compiler by reading and writing .openl2-study.json files. Each record embeds a self-contained Concept object alongside portable spaced-repetition state and optional review history.

See the Study Interchange Format specification for the schema.