www/docs/development/plugins/full-featured-plugin.md
Full-featured plugins run inside dedicated hosts (Python/Node.js) and talk to the Go core over WebSocket. They stay loaded, can keep state, and can use the full API surface (AI, previews, MRU, settings UI, deep links).
~/.wox/plugins/<your-plugin-id>/.plugin.json (see Specification) and your entry file (main.py, index.js, etc.).uv add wox-plugin (Python ≥ 3.8) or pnpm add @wox-launcher/wox-plugin (Node.js ≥ 16).from wox_plugin import Plugin, Query, Result, Context, PluginInitParams
from wox_plugin.models.image import WoxImage
class MyPlugin(Plugin):
async def init(self, ctx: Context, params: PluginInitParams) -> None:
self.api = params.api
self.plugin_dir = params.plugin_directory
async def query(self, ctx: Context, query: Query) -> list[Result]:
return [
Result(
title="Hello Wox",
sub_title="This is a sample result",
icon=WoxImage.new_emoji("👋"),
score=100,
)
]
plugin = MyPlugin()
import { Plugin, Query, Result, Context, PluginInitParams } from "@wox-launcher/wox-plugin"
class MyPlugin implements Plugin {
private api!: any
private pluginDir = ""
async init(ctx: Context, params: PluginInitParams): Promise<void> {
this.api = params.API
this.pluginDir = params.PluginDirectory
}
async query(ctx: Context, query: Query): Promise<Result[]> {
return [
{
Title: "Hello Wox",
SubTitle: "This is a sample result",
Icon: { ImageType: "emoji", ImageData: "👋" },
Score: 100,
},
]
}
}
export const plugin = new MyPlugin()
Runtime = PYTHON or NODEJS and point Entry to your built file (TypeScript users build to JS).Features when you need selection queries, query env, AI, MRU, preview width control, or deep links.Example:
{
"Id": "my-awesome-plugin",
"Name": "My Awesome Plugin",
"Description": "Do awesome things",
"Author": "You",
"Version": "1.0.0",
"MinWoxVersion": "2.0.0",
"Runtime": "NODEJS",
"Entry": "dist/index.js",
"TriggerKeywords": ["awesome", "ap"],
"Features": [{ "Name": "querySelection" }, { "Name": "ai" }],
"SettingDefinitions": [
{
"Type": "textbox",
"Value": { "Key": "api_key", "Label": "API Key", "DefaultValue": "" }
}
]
}
Query.Type can be input or selection. selection is delivered only when querySelection is enabled.Query.Env (active window title/pid/icon, active browser URL) is filled when queryEnv is enabled.TriggerKeyword, Command, and Search.Result with optional Preview (markdown/text/image/url/file/remote), Tails (text or image badges), Group/GroupScore, and Actions.ResultAction supports Hotkey, IsDefault, PreventHideAfterAction, and custom ContextData.UpdateResult using ActionContext ids.resultPreviewWidthRatio feature if you want a wider preview area for your plugin results.SettingDefinitions (textbox/checkbox/select/selectAIModel/table/dynamic/head/label/newline) in plugin.json.GetSetting/SaveSetting (supports platform-specific storage).ai feature; requests go through Wox-configured providers.deepLink feature to metadata.mru feature and implement OnMRURestore to hydrate results from stored MRU data.~/.wox/plugins/ (or symlink your development directory there).plugin.json or rebuilding your entry file.query (keep them async and cache results).