Skip to main content
This guide covers the full process of creating a Klyx extension, from project setup to advanced features like screens, toolbar actions, and file openers.

Project structure

A well-organized extension looks like this:

The entry class

Your extension’s entry point is a class that implements KlyxPlugin. Klyx discovers this class through the entryClass field in plugin.json and loads it reflectively.
MyExtension.kt

Registering resources

Screens

Register screens during onLoad() using ScreenRegistry. Each screen gets a unique ScreenId and a composable lambda.

Toolbar actions

Add actions to Klyx’s toolbar. Each action has an ID, label, icon, category, priority, and click handler. Higher priority values place the action first.

File openers

Register a FileOpener to handle custom file types. The opener returns a WorkspaceTab if it can handle the file, or null to let other openers try.

Responding to events

Use the event bus to react to app events. Subscribe in onLoad() and unsubscribe in onUnload().
See Events for all available event types. Use the Navigator service to navigate users to different destinations:

Best practices

  • Keep onLoad() fast: Defer heavy work to onStart() or launch a coroutine
  • Unregister everything: Always clean up screens, toolbar actions, and subscribers in onUnload()
  • Handle file openers gracefully: Return null from open() if you can’t handle the file
  • Use pluginScope: Launch long-running coroutines on pluginScope so they’re properly cancelled
Last modified on July 11, 2026