Skip to main content

Build your first plugin from scratch

This tutorial walks you through creating a minimal working Qomicex plugin from scratch. Starting from the qomicex CLI scaffold (Scaffold)is recommended (it generates a valid project structure automatically). You can also write everything by hand; see the alternative below.

Prerequisites

  • Qomicex Launcher (Launcher)is installed (for testing)
  • qomicex CLI (Node.js ≥ 20):
Before your first use, run qomicex doctor to check whether Node / pnpm / the plugin project environment are ready (read-only, it modifies no files).
The generated project uses a Vite + React 19 + TS + Tailwind project-based setup (see React + Vite plugin development), with manifest.json already in place:
Key fields:
  • id: The unique plugin ID, which is also the install directory name (plugins/{id}/). Never change it once published
  • layers: Layer declarations. Plugins with script pages should use ["l2", "l3"] (iframe sandbox rendering by default; for inline rendering you must explicitly declare "render": "inline" in the manifest. Activation depends on whether entry.frontend exists; see layers layer definitions)
  • permissions: The permissions your plugin needs (see Complete plugin API reference)
  • entry.frontend: The plugin page entry, a relative path inside the .qplugin package

2. Write the plugin page

Create src/App.tsx (React) or modify it as needed. For plain HTML, write directly in index.html:
  • Style with the .p-* component classes provided by the launcher (such as .p-card and .p-btn); they follow the light and dark themes automatically. See UI component library for the full list.
  • Plugin scripts talk to the launcher through the global window.__PLUGIN_API__ object. Note that the script runs as soon as the plugin is activated (inline or in the L2 sandbox), without visiting the plugin page. See Rendering model.
  • Project-based plugins use the @qomicex/plugin-ui React components plus Tailwind; see React + Vite plugin development.

3. Package the plugin

A .qplugin file is a zip with manifest.json at the root plus dist/**. If entry.theme or contributes.overlay.file reference files under dist/ while the source sits in the root directory, pack copies them in automatically. manifest.json must be in the root directory of the archive. Putting it in a subdirectory makes installation fail.

Manual packaging without the CLI (alternative)

  • Put manifest.json and the asset directory into one folder
  • Compress it with any ZIP tool, making sure manifest.json is at the ZIP root
  • Rename the extension to .qplugin

4. Install and test

  • Open Qomicex Launcher → Settings → Plugins
  • Click Install plugin (Install plugin) and select your .qplugin file
  • After a successful install, the card appears in the plugin list; toggle it on to enable it (a launcher restart is required for it to take effect)
  • After the restart, a “Hello” entry appears in the sidebar; click it to open the plugin page
During development, run qomicex dev to use the debug harness (no Tauri/backend needed, hot reload in the browser). See Debugging and hot reload.

5. FAQ at a glance

Next steps