Skip to content

Libraries

Pear

Desktop application runtime and distribution tooling.

Verified 19 October 2026

Use the Pear Desktop scaffold when you want an app window backed by a separate worker.

Status in Unstoppable Stack

The CLI's pear-desktop target is the preview entry point; individual examples may use Electron for their shell.

How it works

The scaffold creates an Electron desktop shell with pear-runtime and a Bare worker. The shell displays the app; the worker owns networking, persistent data and native inference.

A narrow IPC bridge carries application messages between UI and worker. A renderer component should request a note, not open Corestore or load a native model.

Local development and OTA distribution are separate steps. A running scaffold does not establish signed, packaged or cross-platform release acceptance.

Run an example

Use Node 22.17+ and npm in a terminal on your desktop. Run this in a parent directory where a new workspace can be created; no existing app is overwritten.

bash
npm install -g @unstoppable-stack/cli@0.4.0-beta.1
us init pear-demo-workspace --assistant none --no-install
cd pear-demo-workspace
us scaffold app -p pear-desktop -n pear-demo
cd pear-demo
npm install
npm run dev

Expected result

A desktop window opens using the generated renderer and worker. This base example does not download an AI model. Keep the terminal open for worker errors and close the app when finished.

Example verification

Setup and API instructions were reviewed against the repository and upstream references. This docs update did not rerun the desktop/mobile native build or real-model acceptance flow.

API essentials

  • PearRuntime.ready(): initialize the host runtime before starting worker work.
  • PearRuntime.run(workerPath, args): launch a Bare worker. In that worker, Bare.IPC is the pipe and Bare.argv contains arguments.
  • PearRuntime.close(): release host resources after the worker has closed its own stores and connections.

Troubleshooting and limits

  • Do not copy legacy pear run / global.Pear examples into this scaffold: the current host is Electron plus pear-runtime.
  • If the window opens but storage fails, inspect the worker error in the launch terminal and run us doctor -p pear-desktop.
  • Close the application window to end the example. Reopen with the same storage to test persistence.

Next steps

Need help? Report an issue with your CLI version, platform, command and first relevant error.