> ## Documentation Index
> Fetch the complete documentation index at: https://klyx.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Plugin Manifest

> Reference for plugin.json

Every Klyx extension requires a `plugin.json` file at the project root. This file declares who made the extension, what it does, and crucially — which class Klyx should load as the entry point.

## File location

`plugin.json` must live at the root of your project (the same directory as `build.gradle.kts`). The Klyx Gradle plugin detects it automatically.

## Full schema

```json plugin.json lines theme={null}
{
  "id": "com.example.myextension",
  "name": "My Extension",
  "version": "1.0.0",
  "minAppVersion": "4.2.0",
  "maxAppVersion": null,
  "entryClass": "com.example.myextension.MyExtension",
  "description": "Adds custom features to Klyx",
  "icon": "icon.png",
  "author": {
    "name": "Your Name",
    "email": "you@example.com",
    "url": "https://example.com",
    "github": "yourhandle"
  },
  "license": "MIT",
  "links": {
    "source": "https://github.com/you/my-extension",
    "issues": "https://github.com/you/my-extension/issues",
    "website": "https://example.com",
    "donate": "https://ko-fi.com/you"
  },
  "permissions": []
}
```

## Field reference

### `id` (required)

Unique plugin identifier in reverse-domain notation.

```text theme={null}
"com.klyx.sampleplugin"
```

### `name` (optional, defaults to `id`)

Human-readable display name shown in Klyx's plugin manager.

```text theme={null}
"My Extension"
```

### `version` (required)

Semantic version string. Klyx uses this to determine if an update is available.

```text theme={null}
"1.0.0"
```

### `minAppVersion` (required)

The minimum version of Klyx required to run this extension. Version `4.2.0` introduced the plugin system.

```text theme={null}
"4.2.0"
```

### `maxAppVersion` (optional)

If set, the extension won't load on newer versions of Klyx. Use this for forward compatibility breaks.

```text theme={null}
"5.0.0"
```

### `entryClass` (required)

The fully qualified class name of your `KlyxPlugin` implementation. Klyx loads this class reflectively, so it must not be obfuscated or removed during build.

```text theme={null}
"com.klyx.sampleplugin.SamplePlugin"
```

<Warning>
  If you use R8 or ProGuard, you must add a keep rule for your entry class:

  ```text theme={null}
  -keep class com.yourext.MyExtension
  ```

  The [SamplePlugin](https://github.com/klyx-dev/SamplePlugin) ships with a `keepRules/rules.keep` file for reference.
</Warning>

### `description` (optional)

A short description of what your extension does.

```text theme={null}
"A comprehensive reference implementation demonstrating all Klyx extension APIs"
```

### `icon` (optional)

Path to a PNG icon file relative to the project root. Displayed in the plugin manager.

```text theme={null}
"icon.png"
```

### `author` (optional)

Information about the extension author. All fields are optional except `name`.

| Field    | Type    | Description      |
| -------- | ------- | ---------------- |
| `name`   | string  | Author's name    |
| `email`  | string? | Contact email    |
| `url`    | string? | Personal website |
| `github` | string? | GitHub username  |

### `license` (optional)

SPDX license identifier or custom license name.

```text theme={null}
"MIT"
```

### `links` (optional)

Links associated with the extension.

| Field     | Type    | Description            |
| --------- | ------- | ---------------------- |
| `source`  | string? | Source code repository |
| `issues`  | string? | Issue tracker          |
| `website` | string? | Extension homepage     |
| `donate`  | string? | Donation URL           |

### `permissions` (optional)

A list of permission strings your extension requires. Currently reserved for future use.

```text theme={null}
["terminal", "network"]
```

## Validation rules

When publishing to the [community registry](https://github.com/klyx-dev/plugins), CI enforces these rules:

| Rule            | Details                                                                                      |
| --------------- | -------------------------------------------------------------------------------------------- |
| Required fields | `id`, `version`, `name`, `minAppVersion`, `entryClass` must be present and non-empty strings |
| `id` format     | Must start with a letter, contain only letters, digits, and dots. No slashes allowed         |
| `version`       | Must follow semver (`\d+\.\d+\.\d+`)                                                         |
| `minAppVersion` | Must follow semver                                                                           |
| `maxAppVersion` | If set, must follow semver                                                                   |
| `entryClass`    | Must be a valid fully-qualified class name                                                   |
| `author.name`   | Required if `author` is an object                                                            |
| Bundle          | Must contain `plugin.apk`                                                                    |

See [Building & Bundling > Publishing](/extensions/building-and-bundling#publishing-to-the-registry) for the full publishing workflow.

## Example from SamplePlugin

The [SamplePlugin](https://github.com/klyx-dev/SamplePlugin) ships with this manifest:

```json theme={null}
{
  "id": "com.klyx.sampleplugin",
  "name": "Sample Plugin",
  "version": "1.0.0",
  "minAppVersion": "4.2.0",
  "entryClass": "com.klyx.sampleplugin.SamplePlugin",
  "description": "A comprehensive reference implementation demonstrating all Klyx extension APIs",
  "icon": "icon.png",
  "author": { "name": "Klyx" },
  "license": "MIT",
  "links": {
    "source": "https://github.com/klyx-dev/SamplePlugin",
    "issues": "https://github.com/klyx-dev/SamplePlugin/issues"
  },
  "permissions": []
}
```
