Skip to content

Build and run the app from source

Use this guide to get a development build of Lore Desktop running on your machine, run the project's checks, or build an installer for your platform to test. It starts from a fresh clone of this repository. To open a repository in the app, you need a Lore repository on disk, or you can create one in the app.

To create or sync a Lore repository with the Lore CLI, see Quickstart: Your first Lore repository in the Lore documentation.

Before you start

  • Node.js and pnpm 10 — use the Node.js version pinned in .nvmrc.
  • A supported platform — Windows (x64), macOS (Apple silicon), or Linux (x64 or Arm64).

Steps

  1. Install dependencies.
pnpm install

The postinstall script builds the plugin SDK in packages/plugin-sdk and the branch visualizer in packages/branch-visualizer, then downloads the Electron binary.

  1. Start the app in development mode.
pnpm dev

This builds the plugins under packages/plugins/ once, then runs electron-vite dev. That builds the main and preload code, starts the Vite dev server for the renderer with hot reload, and opens the app window on the Repositories page. In development mode, the app also opens DevTools in separate windows and installs the React and Redux DevTools extensions.

To open a repository directly, pass the path of its root folder (the folder that contains .lore) after --:

pnpm dev -- /path/to/repository

The -- matters: electron-vite passes everything after it to the app. Without --, electron-vite reads the path as its own project root and fails with this error:

An entry point is required in the electron vite main config, which can be specified using "build.lib.entry" or "build.rollupOptions.input".

If the path isn't a Lore repository, the app opens the Repositories page instead.

Plugins aren't rebuilt while the app runs. After you change a plugin, stop the app with Ctrl + C and run pnpm dev again. If the plugin build stops with Run `pnpm build:sdk` first., run pnpm build:sdk, then run pnpm dev again.

  1. Run the checks before you submit a change.
pnpm test
pnpm lint
pnpm typecheck
pnpm format
Command What it does Changes files
pnpm test Builds the plugin SDK, then runs the app, plugin, and script test suites with Vitest. Writes a coverage report to coverage/. Writes build output and coverage/ only
pnpm lint Runs ESLint with --fix. If ESLint passes, checks that every TypeScript, JavaScript, CSS, and HTML source file starts with a copyright line and the MIT SPDX identifier. Run pnpm copyright:generate to add missing headers. Yes — applies fixes
pnpm typecheck Builds the plugin SDK, then runs the TypeScript compiler on the main, renderer, and plugin code without emitting output. Writes build output only
pnpm format Runs Prettier with --write across the repository. Yes — rewrites formatting
  1. Build an installer on the platform you're targeting. Each build script builds for the platform it names, so run it on that platform. The scripts build the plugins and the app, generate the third-party license notice, and write the installers to dist/. <version> is the version field in package.json.
Command Output in dist/
pnpm build:win NSIS installer lore-desktop-<version>.exe
pnpm build:mac Disk image lore-desktop-<version>.dmg and archive lore-desktop-<version>.zip
pnpm build:linux lore-desktop-<version>.AppImage, lore-desktop-<version>.snap, and lore-desktop-<version>.deb
pnpm build:linux:flatpak lore-desktop-<version>.flatpak only. Needs flatpak and flatpak-builder.

On Linux Arm64, building the .snap package also needs snapcraft installed.

None of these scripts run the typecheck script, so run pnpm typecheck yourself before you build. The build configuration has no code signing or notarization, so the installers are unsigned. On macOS, electron-builder signs with a Developer ID certificate it finds in your keychain; set CSC_IDENTITY_AUTO_DISCOVERY=false to build unsigned. Notarization is never run from this repository.

Packaging sets the app's Electron fuses before any signing, through the electronFuses option in electron-builder.config.cjs. The packaged app ignores ELECTRON_RUN_AS_NODE, NODE_OPTIONS, NODE_EXTRA_CA_CERTS, and the --inspect flags, and Electron starts it only from app.asar. On Windows and macOS it also checks app.asar against the hash electron-builder embeds in the executable or Info.plist; Electron has no such check on Linux. Plugins, including the bundled ones in Resources/plugins, load from outside app.asar and are not hash-checked. To see the fuses of a build, run npx @electron/fuses read --app <path>, where <path> is the .app bundle, the .exe, or the Linux executable. On macOS, an unsigned build is signed ad hoc after the fuses change, so it still launches on Apple silicon.

To package with your own electron-builder configuration, run pnpm build:app instead. It does everything the build scripts do before electron-builder, without packaging.

  1. Install the build and launch it. Launched without a path, the app opens the Repositories page. To open a repository directly, pass its path after --.

  2. Windows: Run the installer. It adds a Lore Desktop shortcut to the Start menu and the desktop, and adds the install folder to your user Path. To launch with a path, open a new terminal and run:

    lore-desktop -- "D:\path\to\repository"
    
  3. macOS: Open the .dmg and drag Lore Desktop into Applications. To launch with a path, run:

    open -a "/Applications/Lore Desktop.app" --args -- "/path/to/repository"
    
  4. Linux: Make the AppImage executable, then run it:

    chmod +x lore-desktop-<version>.AppImage
    ./lore-desktop-<version>.AppImage -- /path/to/repository
    

Result

The app window opens on the Repositories page. If you passed a repository path, the app shows Loading..., then the repository's file browser appears.

Preview the documentation

The docs are built with MkDocs and the Material theme. From the repository root, run:

uvx --with mkdocs-material --with mkdocs-awesome-pages-plugin --with markdown-gfm-admonition mkdocs serve

Open the address it prints. To check for broken links the way a release build does, run the same command with build --strict instead of serve.

See also