Skip to content

Build plugins

Plugins add features to Lore Desktop: new pages and tabs, buttons and panels in existing screens, and actions on files, branches, and revisions. You write them in TypeScript against the @lore-vcs/desktop-plugins-sdk package, and you build and package them with the lore-plugin command-line tool that ships in the same package.

These pages are for people who write plugins. To install, enable, or remove a plugin someone else wrote, see Manage plugins.

Note

@lore-vcs/desktop-plugins-sdk is not published to npm yet. It ships in this repository under packages/plugin-sdk, so for now you write plugins inside a checkout of Lore Desktop. These pages describe that workflow.

Start here

If you have not written a plugin before, read the pages in this order. Each page builds on the one before it.

Page What you learn
Getting started What a plugin is, then scaffold, link, and run one.
The manifest The plugin field in package.json: main, renderer, and access.
Access grants The deny-by-default permission model and its three planes.
Backend definePluginMain, the three-phase lifecycle, defineDomain, and commands.
Renderer: slots and pages Framework-agnostic UI contributions through reg.provide().
Renderer: React React components and SDK hooks for slot and page UIs.
Renderer: plain JavaScript defineJsComponent for non-React and imperative DOM contributions.
Events, data, and commands The three bridge namespaces, communication between plugins, and streaming.
Build and tsconfig The two build routes, the tsconfig.json for each, and externals.
Worked examples The Branch Explorer plugin, walked through end to end.
Build, pack, and install The lore-plugin CLI, the development loop, packing, installing, and troubleshooting.

Reference plugin

Lore Desktop ships with one plugin, Branch Explorer (@lore/branch-explorer). Its source is in the repository under packages/plugins/@lore/branch-explorer/. It shows a full-tab page, reads data from the app, runs mutations, and keeps its state alive between visits.

SDK reference

These pages are the narrative guide. The API surface is documented in the README of the @lore-vcs/desktop-plugins-sdk package, which also lists the four CLI commands: create, build, dev, and pack.