Debug Plugins Locally
Lyrico provides a desktop plugin devkit that can validate, run, and package plugins on your development machine. This avoids manually importing the plugin into the Android app after every change.
The devkit focuses on manifest basics, entry files, function return values, standard fields keys, and internal size limits.
The devkit lives in the Replica0110/Lyrico-Plugins plugin repository. Tool location:
tools/plugin-devkit/Requirements
- Node.js 20+
- A system
curlcommand available onPATH
Run Directly
From the Replica0110/Lyrico-Plugins repository root:
node tools/plugin-devkit/src/cli.js validate ./my-plugin
node tools/plugin-devkit/src/cli.js inspect ./my-plugin
node tools/plugin-devkit/src/cli.js test ./my-plugin searchSongs --keyword "晴天"
node tools/plugin-devkit/src/cli.js pack ./my-pluginYou can also enter tools/plugin-devkit and register the command with npm link:
npm link
lyrico-plugin validate ./my-pluginValidate A Plugin
lyrico-plugin validate ./my-pluginValidation checks include:
- Whether
manifest.jsonexists and is valid JSON - Whether plugin ID, version, and API version are valid
- Whether
entry,includeDirs, andiconexist and use safe paths - Whether
capabilitiesare supported - Whether
configFieldshas a valid structure - Whether returned
fieldsonly use standard keys - Whether
internalsatisfies count and size limits - Whether the plugin directory exceeds app limits
Inspect A Plugin
lyrico-plugin inspect ./my-pluginThis prints plugin information, declared capabilities, config fields, and script loading order.
Run Plugin Functions
Test song search:
lyrico-plugin test ./my-plugin searchSongs --keyword "晴天" --page-size 5Test cover search:
lyrico-plugin test ./my-plugin searchCovers --keyword "晴天"Test lyrics retrieval:
lyrico-plugin test ./my-plugin getLyrics --song ./song.jsonThe tool prints:
- Function duration
- Plugin logs
- Raw return value
- Result parsed using Lyrico rules
- Structure errors and warnings
Simulate Config Values
If a plugin depends on user configuration, pass a config file:
lyrico-plugin test ./my-plugin searchSongs --keyword "晴天" --config ./config.jsonconfig.json can contain config keys directly:
{
"api_key": "xxx",
"region": "cn"
}It can also wrap them in config:
{
"config": {
"api_key": "xxx",
"region": "cn"
}
}Package A Plugin
lyrico-plugin pack ./my-pluginDefault output:
dist/<plugin-id>-<versionName>.zipYou can choose an output path:
lyrico-plugin pack ./my-plugin --out ./dist/my-plugin.zipNotes
The devkit runs in desktop Node.js and tries to simulate Lyrico's plugin host environment, but it is not identical to Android QuickJS. Network behavior, TLS, system User-Agent, and a few JavaScript runtime details may differ.
Before publishing, still verify the plugin once by importing it into Lyrico.