Getting started
On a desktop
The same app as a Mac, Windows or Linux app — setup and installer in one command.
bunx omaris desktop That is the whole thing. It sets the app up for Electron and builds the installer for the OS you ran it on:
| On | You get |
|---|---|
| macOS | release/<App>-<version>.dmg |
| Windows | release/<App> Setup <v>.exe |
| Linux | release/<App>-<v>.AppImage |
Run it again and the setup is already there, so it only builds. The components need no changes — Electron renders them in Chromium, the same as the browser.
bunx omaris desktop --app-id com.acme.ledger # the id the OS knows your app bybunx omaris desktop --theme '#0b6bcb' # the icon colourbunx omaris desktop --no-build # set it up, build laterbunx omaris desktop --dry-run # show it, write nothing The first build downloads Electron for your OS, so it needs the network once. Nothing else has to be installed — no Rust, no Xcode, no Visual Studio.
The three scripts
After that, everything is a script in package.json:
| Script | Does |
|---|---|
bun run desktop | open the app in a window, reloading as you edit |
bun run desktop:preview | open what ships — the built app, no dev server |
bun run desktop:build | build the installer into release/ |
desktop starts the dev server and points a window at it, so a save reloads the window the way it reloads the browser. Close the window or press Ctrl-C and the server stops too. Only web code reloads — an edit to electron/main.cjs needs the window reopened.
The window opens where you last closed it, at the size you left it, and a second launch focuses the window that is already open rather than starting another copy.
All three installers at once
Each OS only builds its own: a .dmg needs a Mac, and a Windows installer from anywhere else needs Wine. So the command also writes .github/workflows/desktop.yml, which builds all three on GitHub's machines:
- From the Actions tab — Desktop → Run workflow. The installers are on the run's page when it finishes.
- From a tag — and they are attached to a GitHub release as well:
git tag v1.0.0 && git push origin v1.0.0 It never runs on an ordinary push, so it costs nothing until you ask for it. It installs with whichever package manager the project uses. --no-ci skips writing it.
What it changed
| File | Why |
|---|---|
vite.config.ts | adapter-static, falling back to one index.html |
src/routes/+layout.ts | ssr = false — there is no server inside an app |
electron/main.cjs | the window, and the build served from app:// |
electron-builder.json | the app's id, its name, one installer per OS |
electron/resources/icon.png | a 1024 icon; the .icns and .ico are made from it |
package.json | the three scripts, and a version if it had none |
.gitignore | release/ — a hundred megabytes per installer |
.github/workflows/desktop.yml | all three installers, built on GitHub |
Nothing is ever overwritten: a file that exists is left as it is, so electron/main.cjs and the icon are yours to edit. The adapter and layout are the same change omaris native makes, so a project can have both.
Four details are easy to get wrong by hand, and each one fails as a blank window or a failed build:
- The build is served from `app://`, not `file://`. Over
file://, a reload on/settingsasks the disk for a file calledsettings. The main process answers every path that is not a file withindex.html, the way a static host does, and refuses anything outside the build. - electron-builder's resources are not `build/`. That is its default, and it is exactly where the web app lands — and resources are left out of the package. Unconfigured, the installer holds an app with nothing in it.
- Nothing is published. Without
publish: null, electron-builder guesses an update server from your git remote, and with no remote it fails after the installer is already built. - `node_modules` stays out. Vite already bundled every dependency into the build, so shipping them again would only make the installer bigger.
The window is locked down the way Electron recommends: context isolation and the sandbox on, no Node in the page. Links to other sites open in the browser, not in a second app window.
When it goes wrong
| Says | Do |
|---|---|
Unknown command: desktop | the project has an older omaris — bun add omaris@latest |
Running as root without --no-sandbox, SUID sandbox | Linux's sandbox won't start here — bun run desktop --no-sandbox |
| could not download | the first build fetches Electron — it needs the network once |
| macOS: "can't be opened", Windows: "protected your PC" | the installer is unsigned — see below |
--no-sandbox is for running on your own machine only: Docker as root, and Ubuntu 24.04 and later, stop Chromium's sandbox from starting out of node_modules. An installed app is not affected.
Signing
The installers are unsigned. macOS and Windows both warn on first open until they are signed — fine for your own machine and for testers, not for strangers. Signing needs a certificate from Apple or a Windows code-signing vendor; see electron-builder's code signing docs. In the workflow, the certificate goes in the repository's secrets and CSC_IDENTITY_AUTO_DISCOVERY: false comes out.
Not this
Electron ships its own Chromium, so an installer is about a hundred megabytes. If size matters more than one engine everywhere, Tauri uses the system's webview and is a tenth of that — at the cost of installing Rust, and of Safari's engine on a Mac and Edge's on Windows rendering the app. For something people only use in a browser anyway, bunx omaris pwa is installable from Chrome and Edge with no build at all. See On a phone.