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.)
Discovering installed exporter plugins
Section titled “Discovering installed exporter plugins”List all registered exporter plugins in your environment:
openl2 plugins listRegistering a third-party exporter plugin
Section titled “Registering a third-party exporter plugin”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:
OpenL2Pluginregisters discovery metadata only—it does not automatically mount a subcommand ontoopenl2. Ship your own CLI entry point (for example,my-target-export) that callscompile_level_export(...), and list its command names incommandsfor 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.
Packaging an AI client plugin (MCP)
Section titled “Packaging an AI client plugin (MCP)”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.
Study interchange plugins (openl2-study)
Section titled “Study interchange plugins (openl2-study)”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.