Skip to content
docs
GitHub

Templates and project structure

Choose a panel, sidebar, command or theme and understand how the files fit together.

All four templates use the same manifest and import process. Choose the closest starting point; one plugin can later combine several contribution types.

--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.

Once the version is available on npm:

Terminal window
pnpm create [email protected] my-sidebar --id example.project-sidebar --name "Project sidebar" --template sidebar

For 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.

  1. plugin.json declares a view, command or fill ID.
  2. src/index.tsx exports activate(context), registering its implementation under the same ID.
  3. lomi-plugin.config.mjs selects the source entry and assets copied to output.
  4. pnpm build creates package/. The manifest’s entry points to JavaScript in that output.
  5. 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.

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.

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.

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.