Extend

Plugin system

Drop a plugin in, the loader picks it up. Versioned manifest contract, LifecycleInterface, and easy discovery.

How it works

phlix ~ plugin-loader

$ ls plugins/

my-metadata-plugin/

anime-database/

custom-thumbnails/

$ phlix plugin --scan

3 plugins discovered.

my-metadata-plugin: loaded (v1.2.0)

anime-database: loaded (v2.0.1)

custom-thumbnails: loaded (v1.0.0)

[M]

Manifest contract

Every plugin ships a versioned manifest.json that declares its name, version, dependencies, and lifecycle hooks.

[L]

LifecycleInterface

Plugins implement onInstall, onEnable, onDisable, and onUninstall hooks. The loader calls them at the right time.

Plugin manifest example

{
  "name": "my-metadata-plugin",
  "version": "1.2.0",
  "manifest_version": 1,
  "author": "Your Name",
  "description": "Fetches metadata from MyAnimeList",
  "hooks": ["metadata.fetch"],
  "dependencies": {
    "phlix-shared": "^1.0"
  }
}

phlix-plugin-example

View on GitHub

Available hooks

Hook When it fires
onInstall Before the plugin files are copied to the plugins directory
onEnable When the plugin is enabled in settings
onDisable When the plugin is disabled in settings
onUninstall Before the plugin files are removed
metadata.fetch When metadata is being fetched for an item
transcode.start Before a transcode job begins
transcode.complete After a transcode job finishes