Skip to main content
Klyx extensions are built using the Klyx Gradle plugin, which packages your APK and metadata into a .klyx bundle.

The Klyx Gradle plugin

Apply the io.github.klyx-dev.plugin plugin in your app/build.gradle.kts:
build.gradle.kts

Configuration options

Auto-detected files

The plugin automatically detects and includes these files from the project root:

Build tasks

The plugin adds three Gradle tasks:

Bundle format

The task produces a .klyx file — a gzipped tarball containing:

Dependencies

The klyx-api dependency must be compileOnly:
Klyx provides the API at runtime. Using implementation would bundle the API into your APK and cause conflicts.

R8 / ProGuard

If you enable minification, you must keep your entry class:
The SamplePlugin ships a keepRules/rules.keep file that the klyx {} block picks up automatically. You can also put rules in consumer-rules.pro and reference them in your build file:

AndroidManifest

Keep it minimal:
No activities, services, or providers needed. The plugin entry point is declared in plugin.json.

Version compatibility

The minAppVersion in plugin.json should match the version of klyx-api you’re compiling against:
with corresponding minAppVersion in plugin.json:

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

  1. Your plugin.json is valid (see manifest reference for required fields)
  2. You have built a .klyx bundle with ./gradlew klyxBundle

Publish via pull request

  1. Fork the registry repo
  2. Add your .klyx file to the incoming/ directory
  3. Create a pull request to main
  4. Wait for CI — the workflow validates your bundle and posts results as a PR comment
  5. Merge once validation passes — your plugin is published automatically

What CI validates

The registry’s CI pipeline checks:
  • plugin.json exists and is valid JSON
  • All required fields are present and non-empty: id, version, name, minAppVersion, entryClass
  • id matches the format: starts with a letter, contains only letters, digits, and dots, no slashes
  • version follows semver (e.g., 1.0.0)
  • minAppVersion and maxAppVersion follow semver
  • entryClass is a valid fully-qualified class name
  • author.name is present if author is an object
  • plugin.apk exists in the bundle
  • Ownership: You can only publish updates to a plugin you already own. First-time publishers are welcome for new plugin IDs

After publishing

The publish workflow:
  1. Creates a directory under plugins/{plugin-id}/ with all versioned bundles and extracted metadata
  2. Updates plugins/index.json — the auto-generated registry index
  3. Clears the incoming/ directory

Registry structure

Ownership

When you first publish a plugin, you become its owner. 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.
Last modified on July 11, 2026