All four templates use the same manifest and import process. Choose the closest starting point; one plugin can later combine several contribution types.
Choose a template
Section titled “Choose a template”--template |
What it creates | Where to find it |
|---|---|---|
panel |
A central React view and an opening command; one instance per workspace | Run the command named after the plugin |
sidebar |
A React sidebar and an opening command; one instance per workspace | Run the command; placement and width are retained |
command |
One command without a view | Run the command; the example logs the workspace name to the console, without a dialog or notification |
theme |
A v2 color theme in theme/theme.jsonc, without JavaScript |
Import the package and select it in Settings > Themes |
Executable templates use activation: "lazy". Importing alone does not open a panel. The theme template needs neither activate() nor approval to execute code.
Generator options
Section titled “Generator options”Once the version is available on npm:
pnpm create [email protected] my-sidebar --id example.project-sidebar --name "Project sidebar" --template sidebarFor local packages, follow Tools and diagnostics.
| Argument | Meaning |
|---|---|
<directory> |
Exactly one new or empty destination directory |
--id |
Persistent author.name identifier; at most 100 characters |
--name |
Nonempty display name; at most 160 characters |
--template |
panel, sidebar, command or theme; defaults to panel |
--json |
JSON output with schemaVersion: 1; disables interactive prompts |
--help, -h |
Help |
An interactive terminal prompts for missing answers. In scripts or with --json, supply --id and --name. Invalid arguments exit with 2, generation failures with 1, and success with 0. There is no overwrite flag.
How the files work together
Section titled “How the files work together”plugin.jsondeclares a view, command or fill ID.src/index.tsxexportsactivate(context), registering its implementation under the same ID.lomi-plugin.config.mjsselects the source entry and assets copied to output.pnpm buildcreatespackage/. The manifest’sentrypoints to JavaScript in that output.- Lomi reads the manifest on import and executes code after approval and an activation trigger.
Renaming the project folder does not change plugin identity. Changing manifest id creates a different package from Lomi’s perspective. When changing IDs, update contribution prefixes, registrations, examples and any plugin CSS tokens.
Turn a panel into a sidebar
Section titled “Turn a panel into a sidebar”Change placement from central to sidebar in contributes.views, keeping multiple: false. The component and registerView() code stay the same.
Existing saved central panels do not move automatically. Their descriptors retain the old placement, so they show an incompatibility message. Resolve unsaved work, close the old view and open a new one. See Views and state for compatibility rules.
Add another contribution
Section titled “Add another contribution”A plugin can contain multiple views, commands, fills and themes. A second panel needs a new contributes.views entry and a second registerView(). To open it from Commands, declare and register a command that calls openView().
Set multiple: true for a central view when every call should create a new instance. Sidebar views cannot use this setting.
Dependencies and licensing
Section titled “Dependencies and licensing”Templates pin the SDK, CLI and compatible React and TypeScript versions. Keep exact versions and the lockfile. pnpm-workspace.yaml contains release-age exceptions for specific packages; do not replace them with a global policy bypass.
Before sharing, update the description and name, choose your own ID and review licensing for your code and bundled libraries. private: true in package.json prevents accidental npm publication of the author project; it does not prevent pnpm package from producing a ZIP.