Extensions let you add features to Klyx by bundling Kotlin/Compose code into plugins that Klyx loads at runtime. The extension system is built around a few core concepts.
How it works
- You write a Kotlin class implementing
KlyxPlugin
- You declare metadata in
plugin.json
- The Klyx Gradle plugin packages everything into a
.klyx bundle
- Klyx loads the bundle, reads the manifest, and instantiates your plugin
- Your plugin registers screens, toolbar actions, file openers, etc.
- Klyx manages your plugin’s lifecycle automatically
A .klyx file is a GZIP Tar archive containing:
Plugin lifecycle
Klyx calls four lifecycle methods on your KlyxPlugin implementation:
Service injection
Klyx provides services through property delegates. Use by plugin() for app-wide services and by runtime() for per-plugin scoped services.
What plugins can do
- Screens: Register custom Compose screens navigable from within Klyx
- Toolbar: Add toolbar actions with icons in custom categories
- File Openers: Handle custom file types (e.g.,
.mp3, .svg)
- Terminal: Create and manage terminal sessions
- Processes: Run shell commands and programs
- Events: Subscribe to app events (file opens, terminal events)
- Settings: Read and update app settings
- Language Servers: Register LSP providers for custom languages
- Theme: Use Klyx’s color system, typography, and fonts
Reference implementation
The SamplePlugin on GitHub is a complete reference implementation that demonstrates every API. Use it as a starting point and companion to these docs. Last modified on July 11, 2026