.klyx bundle (a gzipped tarball).
The Klyx Gradle plugin
Apply the plugin in yourapp/build.gradle.kts:
io.github.klyx-dev.compiler.plugin) does several things:
- Applies the Kotlin compiler plugin that processes
@PluginManifest - Auto-detects
icon.png,readme.md, andchangelog.mdfrom the project root - Applies the Android Application or Library plugin automatically
- Enables Jetpack Compose if the
composeoption is set (enabled by default) - Adds
klyx-apias acompileOnlydependency automatically - Sets
minSdkto 28, Java 21 compatibility, andbuildFeatures.compose = true
com.android.application, kotlin.compose, or kotlin.serialization yourself — the klyx plugin handles all of that.
Configuration options
All options are available on theklyx { } extension block:
Auto-detected files
The plugin automatically detects and includes these files from the project root if you do not specify them explicitly:Build tasks
The plugin adds several Gradle tasks:
The push tasks run automatically after bundling when
autoPushToDevice is true:
output/MyExtension.klyx.
Bundle format
The task produces a.klyx file — a gzipped tarball containing:
Android Studio IDE support
For the best plugin development experience, enable the klyx compiler plugin in Android Studio so you get IDE features like code completion and navigation for Klyx APIs. Go to Menu > Help > Edit Custom Properties… and add this line to theidea.properties file:
R8 / ProGuard
If you enable minification, keep your entry class:@PluginManifest annotation ensures the entry class name is generated into plugin.json. However, if R8 renames or removes the class, Klyx will not be able to load it reflectively. Make sure to add a keep rule.
AndroidManifest
Keep it minimal:@PluginManifest annotation, not the manifest.
Version compatibility
TheminAppVersion in your @PluginManifest annotation should match the version of klyx-api you are compiling against. For example, if your build.gradle.kts uses a version catalog:
minAppVersion = "4.2.0" in the @PluginManifest.
Publishing to the registry
Klyx hosts a community plugin registry at github.com/klyx-dev/plugins. Publishing is done through a pull request — CI validates your bundle and publishes it automatically on merge.Prerequisites
- Your
@PluginManifestannotation is valid (see manifest reference for validation rules) - You have built a
.klyxbundle with./gradlew klyxBundle
Publish via pull request
- Fork the registry repo
- Add your
.klyxfile to theincoming/directory - Create a pull request to
main - Wait for CI — the workflow validates your bundle and posts results as a PR comment
- Merge once validation passes — your plugin is published automatically
What CI validates
The registry CI pipeline checks:plugin.jsonexists and is valid JSON- All required fields are present and non-empty:
id,version,name,minAppVersion,entryClass idmatches the format: reverse-DNS (e.g.com.example.myplugin)versionfollows semver (e.g.1.0.0)minAppVersionandmaxAppVersionfollow semverentryClassis a valid fully-qualified class nameauthor.nameis present ifauthoris an objectplugin.apkexists in the bundle
After publishing
Thepublish workflow:
- Creates a directory under
plugins/{plugin-id}/with all versioned bundles and extracted metadata - Updates
plugins/index.json— the auto-generated registry index - Purges the jsDelivr CDN cache so users see the latest version
- Clears the
incoming/directory
Ownership
When you first publish a plugin, you become its owner. The registry tracks ownership through a Cloudflare Worker atplugins.klyx.workers.dev. Only the registered owner can publish updates to that plugin ID. This prevents namespace squatting and unauthorized updates.
Manual distribution
You can also share.klyx files directly with users. They can open the file with Klyx to install the extension.