Plugin Compass Desktop (Electron)
This folder contains the desktop app build for Plugin Compass. The desktop app reuses the existing web UI and wraps it with a native Electron shell that can run OpenCode locally, save output on the user's machine, and sync finished plugins to the backend.
Features
- Reuses the existing web UI with minimal divergence.
- Self-updating via electron-updater (no manual downloads required).
- Run OpenCode locally with API keys pulled securely from the backend.
- Persist work on the user's device and sync results back to the backend.
- Build via GitHub Actions.
Self-Update System
The app includes an automatic update system using electron-updater:
- Automatic Check: On startup, the app checks for updates from GitHub Releases.
- Background Download: Updates download in the background without interrupting the user.
- User Notification: When an update is ready, the user is notified via the UI.
- One-Click Install: User can restart the app to apply the update.
How Updates Work
- Updates are published to GitHub Releases by the CI workflow.
electron-updaterdownloads the new version from GitHub.- The update is verified before installation.
- Users can choose when to restart and apply the update.
Developer Notes
- Updates require code-signing for production (not needed for testing).
- The update server is GitHub Releases (configured in package.json).
- Update events are exposed via
window.windowsAppBridge:checkForUpdates()- Manually check for updatesdownloadUpdate()- Download available updateinstallUpdate()- Restart and installonUpdateAvailable(callback)- Listen for update availableonUpdateDownloaded(callback)- Listen for update readyonDownloadProgress(callback)- Track download progress
Setup
- Install prerequisites (Node 18+).
- From this folder:
npm install. - Pull UI assets:
npm run prepare-ui.
Development
npm run devstarts Electron using the copied UI inui-dist.- Commands are exposed via
window.windowsAppBridge.
CI build
- GitHub Actions workflow:
.github/workflows/build-electron-app.yml. - The action runs on
windows-latest, builds the app, and publishes to GitHub Releases.
Security notes
- No command exposes the stored API key to the web layer.
- OpenCode is only invoked from the main process with the key set via environment variables.
- File system access is restricted to the app data directory.