Skip to content

Desktop app internals

This page explains what the desktop app runs on your computer, where it keeps your data and how it updates.

The desktop app can run Niko locally or connect to your own server. Local mode starts the server and web app, with installation, credential storage, and a native window. You don't need Node.js, Docker Desktop, or PostgreSQL.

Follow the desktop connection steps to connect on first launch or switch servers after setup. You can also open connection setup from the startup recovery screen.

The connection screen compares running Niko on this computer with running it on a server. It asks for the server's address and NIKO_AUTH_TOKEN, says that your local assistant and its data stay on this computer, and links to Host your own server and Run Niko on a cloud VM.

Niko checks the connection before saving it. If the check fails, the message shows the network error code, such as ENOTFOUND for an address that can't be found or CERT_HAS_EXPIRED for an expired certificate, or says the server didn't answer in 10 seconds. If the address answers with an HTTP error instead of Niko, the message shows the status. A 401 or 403 response reports a rejected token. The operating system's secure storage protects the token. The app restarts into the remote assistant without starting its local runtime. Loopback HTTP addresses work for an SSH tunnel.

For a private certificate authority (CA), first trust its certificate in your operating system's certificate store. Restart Niko after you change that store. Both the desktop app and its local engine add system CAs to Node's default certificates at startup while keeping bundled certificates. They skip system certificates that have already expired, so an old copy in the Windows store can't replace the valid chain a website sends. The local engine does not inherit NODE_EXTRA_CA_CERTS from your shell. If you installed Niko as a Flatpak on Linux, the sandbox supplies the store; see the next paragraph.

In the Linux Flatpak, the system certificate store comes from the Flatpak runtime, so a CA you trust on the host is not read. Save the CA certificate as a PEM file in your home folder, then build one bundle from the runtime store plus that file and point the app at it:

Terminal
flatpak run --command=sh com.neoskyai.Niko -c \
'cat /etc/ssl/certs/ca-certificates.crt "$HOME/private-ca.crt" > "$HOME/.var/app/com.neoskyai.Niko/ca-bundle.crt"'
flatpak override --user --env="SSL_CERT_FILE=$HOME/.var/app/com.neoskyai.Niko/ca-bundle.crt" com.neoskyai.Niko

Choose Turn Off Niko in the tray or the Niko menu, open Niko again, then retry the connection. The setting reaches the requests the desktop app makes itself, such as the server check before a connection is saved. The local engine runs in its own process with a fixed environment, so it does not receive SSL_CERT_FILE and keeps using the store the runtime provides. To remove the setting, run flatpak override --user --unset-env=SSL_CERT_FILE com.neoskyai.Niko and restart Niko.

This applies to Node HTTPS requests in the desktop app and local engine. It includes server checks, Composio proxy calls, later API calls, and analytics. Certificate and hostname checks stay enabled. These Node requests use Node's certificate verification rules, which can differ from the app window's Chromium rules. An operating system distrust setting does not remove a certificate that Node trusts from another source.

Update checks and the update and private computer downloads use the app window's network stack instead, so they follow your system proxy and certificate settings.

Your conversations, files, memories, model connections, and connected accounts stay on the server. The server also owns the encrypted Composio installation identity: connecting another desktop app or browser uses those same accounts, as do Telegram and WhatsApp. The desktop client does not create a separate integration identity or need a local Vault key to connect.

App sign-in opens in your system browser. The completion page names the connected app; close it and return to Niko. The connected account stays on the server.

The client keeps its server address and encrypted access token, device preferences, and browser caches on your computer. Closing the desktop app does not stop the server. Your local assistant remains separate; choose Replay onboarding… → Change server → Use this computer to return to it. Change server also lets you reconnect with a new address or token. If the server cannot be reached or its saved token cannot be opened, use Connect to a server on the startup recovery screen.

Opening or leaving setup does not reset either assistant. Back to Niko returns to the current assistant; Continue setup replays its onboarding with existing connections and data intact.

See Host your own server for setup. The runtime sections below describe local mode.

The server owns account onboarding. Electron owns device preferences and local setup progress. The desktop settings store does not keep a second account-completion flag.

State Owner
Account onboarding and model connections The connected server
Theme, notifications, sound and launch at login The desktop app
Device setup progress and local runtime preparation The local desktop profile

The web app selects a browser, remote desktop or local desktop adapter from the preload contract. Contract version 1 names the desktop mode. Only local mode exposes runtime preparation, device setup and setup reconciliation. Preference changes use a separate command that accepts only theme, notifications, notification sound and launch at login. Native handlers check the owning main frame and mode before a command runs.

flowchart LR
  ui[Finish onboarding]:::accent --> server[Save account setup on the server]
  server --> mode{Local desktop?}
  mode -- Yes --> check[Electron reads server state<br/>and device setup progress]
  mode -- No --> chat[Open chat]
  check --> chat

The last onboarding step saves account completion on the server. A local desktop then asks Electron to check that state and its device setup progress. Startup and an explicit retry use the same check. If the server save succeeds but the check fails, the retry keeps account completion and repeats only the native check. A remote desktop does not run that check or write local setup state.

The adapter also supports the previous preload contract. Its local completion call reaches the same native check on a current desktop app. An unsupported contract version stops completion with an update message.

Desktop settings format 2 stores device setup progress without account completion. Niko reads format 1 without changing the file. It uses the old completion flag to retain completed device setup. The next settings write stores format 2 and keeps the encrypted keys. Earlier desktop versions cannot read format 2.

flowchart LR
  window[Niko window]:::accent -- per-launch token --> server[Niko server<br/>Electron]
  server --> db[(PostgreSQL)]
  server --> provider[Model provider]:::muted
  subgraph computer [Private Linux computer]
    workspace[Workspace<br/>container]
    browser[Browser<br/>container]
  end
  server --> workspace
  server --> browser

Your data lives in PostgreSQL, which runs on your computer next to the Niko server. Chat, connected apps, memory, schedules, Telegram and WhatsApp need only these two. The private Linux computer runs code and web pages in isolation, so only the workspace and browser need it. It starts in the background, and chat doesn't wait for it, except once while Niko moves data that is still inside the private computer.

  • Electron runs the app window and the Niko server.
  • When you turn on computer use, which is experimental, Niko runs agent-desktop by Vercel Labs, bundled in the app, to read app windows through macOS accessibility and act on them in the background where it can, bringing an app forward for some steps. Niko runs one command at a time, keeps its working files in Niko's private profile folder, and needs the Accessibility and, for window pictures, Screen Recording permissions you grant in System Settings.
  • Lima and Apple's Virtualization framework run a private Ubuntu virtual machine. New installations use Ubuntu 26.04 LTS, including the systemd fixes for a first-boot login-session race that could otherwise stall startup for several minutes. Existing installations keep their guest and data. The VM gets half your memory, between 3 and 6 GiB, and a 24 GiB disk that grows as it's used. Its first boot installs the matching firewall packages from the runtime pack, and uses Ubuntu's package servers only if that installation fails.
  • The VM holds separate workspace and browser containers. Docker runs only inside the VM.
  • The VM keeps automatic security updates for other packages. Automatic updates cannot replace its Linux kernel, GRUB, or shim, or restart the VM. Kernel security fixes need a tested, explicit upgrade. A new runtime pack does not upgrade an existing VM's kernel.
  • At each start, Niko loads its container protection before it starts any container. The profile keeps Docker's restrictions and permits signals and process tracing with the exact docker-default//&unconfined stacked peer. This repairs the Ubuntu kernel regression without disabling AppArmor or its namespace restrictions. Existing installations receive the repair and keep their data.

The workspace and browser have separate networks, no access to your home folder, no Docker socket and no model keys. Model requests go to the provider you connect, or to a local model server you run.

The app includes PostgreSQL 17 for Mac, Windows and Linux. The Windows app also includes the Microsoft Visual C++ runtime that PostgreSQL needs, so nothing has to be installed first. Niko creates the database in the profile's database folder on first launch, which takes about a second. It listens only on 127.0.0.1, on a port Niko picks at each launch, and needs a password that stays in the profile folder. Niko starts it before the server and stops it when you turn Niko off. If Niko quit unexpectedly, the next launch stops the old database process first.

If a profile's data is still inside the private computer, Niko moves it once. It starts the private computer, copies every table into the new database in one transaction, and checks that each table has the same number of rows. Only then does Niko use the new database. Before copying, Niko checks for free disk space of about twice the data's size plus 256 MB. If the copy fails, nothing changes; select Try again or open Niko again to retry. The old database stays on the private computer's disk.

When the private computer can't start, Niko keeps running. A tool that needs the workspace or browser waits while the computer starts, or reports why it can't. Niko shows the cause with Try again, or Install WSL on Windows.

On a new desktop profile, choose Get started to start a local assistant or Connect to a server. The database and the private computer start as soon as the welcome screen opens. The database is ready in seconds; the private computer keeps starting in the background. On a new profile with no saved keys, Niko's own service starts then too. When the profile has saved keys, the service, and any request to unlock them, waits until you select Get started. If the service is still starting when you continue, Niko already shows the email step and turns on its Connect buttons when the service is ready. Choosing a server stops the local computer when the app restarts. Niko waits for the database and the server when needed, then continues at the email step. Email is offered before model selection and can be skipped. Onboarding never waits for the workspace or browser, and chat opens as soon as setup finishes. A model is required to finish local desktop setup, and Niko tries to turn on Open at login when setup finishes. Usage data sharing is on by default for a new profile and can be turned off in Settings → Privacy & data. Conversation traces, other apps, Telegram and WhatsApp are optional.

Before the server starts, the native window saves only the usage data setting and whether Welcome was completed. After the ordinary account API accepts that choice, Niko records its acknowledgment. The email step preview stays visible until the main window can show its account choices or an actionable error. That handoff does not wait for the full app catalog, workspace or browser. A restart does not repeat Welcome or overwrite the saved analytics choice; the temporary marker is removed when device setup progress is saved. Sign-ins, keys and connections use the normal server and storage from the beginning; there is no separate setup backend or credential transfer. The first chat opens with a short greeting and idea cards, under the normal chat and memory rules.

When local setup finishes, Niko tries to turn on Open at login and checks it with the operating system. On Linux, Open at login adds com.neoskyai.Niko.desktop to your autostart folder, $XDG_CONFIG_HOME/autostart or ~/.config/autostart. In the Flatpak the entry runs flatpak run com.neoskyai.Niko --background; in the RPM it runs niko --background. On Windows, the login entry passes --background too, and on a Mac Niko asks macOS whether it opened at login. Opened that way, a set-up Niko starts without a window, and a second login launch while Niko is on doesn't open one. An entry from an earlier version is rewritten with --background the next time Niko starts. If startup fails, Niko opens its window to show the error. If the operating system blocks this setting, setup still finishes. A restart does not repeat this attempt. A settings storage error still requires a retry. You can turn it off in Settings → General. The first stored chat introduction offers an explicit choice to enable notifications. Rendering the introduction does not change the saved preference. macOS may ask for permission; your system settings control delivery. Existing notification choices are preserved. Enabling delivery does not authorize app monitoring or scheduled work. If alerts are blocked, allow Niko in the computer’s notification settings. The web app uses the same onboarding. A completed installation keeps its choices and skips onboarding after an update.

If you finish before the server is ready, an animated Niko logo stays visible until it is ready and completion has been saved. Otherwise chat opens directly. After an update from a version that kept the database inside the private computer, the logo stays until the private computer has started and the data has moved. Database and server failures offer an explicit retry without clearing saved connections. The logo uses the same bounce as Welcome while work continues and pauses on an error. While the runtime pack downloads during that move, the logo's dot travels around its ring as the download progresses, and the screen shows the percentage and the time left, estimated from the last 45 seconds. If no data arrives for five seconds, the dot fades and the screen says Niko is waiting for the network. The Dock icon, or the taskbar button on Windows, shows the same progress. On a Mac, the Dock icon bounces once when Niko is ready for you to carry on, if you're using another app. Assistive technology reads the same progress. The screen groups detailed startup events into a few messages, while diagnostics keep the individual stages. If completion reports a missing setup requirement, onboarding returns to the relevant step. If notifications are enabled and Niko is not focused, a single notification announces when setup is ready.

On Mac, Windows and Linux the app download is small, and local setup downloads a matching runtime pack with the container images, the base VM image and the tools that run them.

  • Niko unpacks the archive while it downloads. It uses each file only after that file matches its SHA-256 in the release, and treats the pack as installed only once the archive size and SHA-256 match too. On a Mac and Linux, the private computer starts while the container images are still downloading.
  • On a Mac and Linux, before it installs, Niko checks free space for the files it still needs to install plus 512 MiB.
  • Niko keeps each verified file in place if a later part of the pack fails or you cancel setup. An explicit retry checks and reuses those files. Unverified extracted files stay in a temporary folder, which Niko removes after the attempt ends. The whole archive must still pass its checks before the pack is ready.
  • A slow download keeps going for as long as data arrives. If no data arrives for five minutes, the download stops and you can retry.
  • If the download stops, or you turn off Niko, Niko keeps the downloaded part next to the pack, and the next try asks the server for only the rest. A server that won't send part of the file sends all of it, and Niko skips the bytes it already has. Niko deletes the saved part once the pack is installed, or when the finished pack fails its check, so the next try starts over. On a Mac and Linux, Niko keeps the saved part only when there's room for the rest of the download as well as the extracted files.
  • On a Mac and Linux, Try again can use a complete saved archive after a connection failure or cancellation. Niko checks its size and SHA-256 before it installs, without a network request. Each extracted file must still pass its check. If the size or SHA-256 is wrong, Niko removes the archive and stops that attempt. A storage error or cancellation keeps a verified saved archive for another explicit try.
  • On a Mac and Linux, Niko checks every extracted file. Verified packs live in ~/Library/Application Support/niko/runtime/<release> on a Mac, or $XDG_DATA_HOME/niko/runtime/<release> on Linux (~/.local/share/niko/runtime/<release> by default, ~/.var/app/com.neoskyai.Niko/data/niko/runtime/<release> in the Flatpak). The VM mounts them read-only. After the VM starts, Niko deletes packs that no Niko VM mounts and that are more than a day old, so a downloaded update waits for its restart.
  • After its containers start, Niko removes container images from earlier runtimes. On a Mac and Linux, the freed space returns to your disk.
  • On Windows, Niko imports the pack into its WSL distribution, then deletes the archive.
  • An app update reuses the runtime when it hasn't changed. The first release built each week rebuilds it, which also refreshes its system packages, such as the browser.

The Mac container profile comes from Docker 28.5.1, under the Apache 2.0 license. Niko adds exact docker-default//&unconfined peers for signals and process tracing. The runtime pack includes Docker's license and notices.

If a download isn't available, you can import the matching niko-Runtime-darwin-<arch>-<id>.tar.gz or niko-Runtime-linux-x64-<id>.tar.gz from the release page by hand. On Windows, put niko-Runtime-win32-x64.tar.gz from the same release next to the installer and run it again.

The server listens on a loopback port that needs a token, created again at every launch. Only the app's own windows receive it, so a website in your normal browser can't reach Niko. The app sends the token only after the server it started reports that port, so another program that takes the port first never gets it.

Electron safeStorage encrypts the Vault key. It uses the macOS key store on a Mac, DPAPI on Windows and the desktop's Secret Service, such as GNOME Keyring or KWallet, on Linux. Model connections and saved logins are encrypted with the Vault key. The key and model credentials stay in the server. A saved website login reaches the browser only through the private sign-in flow.

App connections use NeoSky's connection service. The private installation identity is encrypted with the Vault key and retained in your profile. Falcon Builder, Notion, Linear and the other hosted custom apps connect directly to their MCP servers. See Apps.

What Where
App settings and profile ~/Library/Application Support/niko/profiles/local
Database ~/Library/Application Support/niko/profiles/local/database
Private VM and workspace ~/.niko-desktop/<profile>
Runtime packs ~/Library/Application Support/niko/runtime/<release>

Remove all data in Settings → Privacy & data, or in the Niko menu when setup cannot finish, stops Niko and its private computer. It deletes the private computer, the profile and the app's browser storage, then restarts and opens setup. The app stays installed. On a Mac and Linux it keeps the runtime packs and the key store entry. See Remove Niko.

The profile holds the only key to the private computer's database. When Niko starts and finds a private computer but no profile, it deletes that private computer and sets up a new one.

Your installation is the VM disks, database, workspace files, browser profiles, Niko sessions and encrypted settings together. Copying only the database isn't a backup.

Niko keeps one desktop process for its profile. A second launch notifies that process, then exits before Windows prepares another encryption key.

On Linux, a Flatpak installed from a Niko repository updates itself through the Flatpak portal once such a repository is published (none is yet), a bundle install needs the next release bundle, and an RPM install shows a notice to run sudo dnf upgrade niko once a dnf package repository is published (none is yet). See Update Niko. The rest of this section is about Mac and Windows.

Niko checks for updates when it starts, every six hours while open, and after your computer wakes if a check is due. Checks continue while a downloaded update waits for restart. On a Mac, Niko first asks macOS whether the updater is still running. If the previous Niko quit to install a newer version, Niko closes again before it opens a window, so the install can finish. If the updater is running after a plain quit, or Niko can't tell, Niko opens as usual and waits until macOS reports that the installer has finished. If the installer is still active or its state is unknown when Niko starts its automatic update checks, the first automatic check waits 15 minutes. Every check and restart also waits until macOS reports that the installer is idle. The native menu and tray actions stay unavailable while Niko waits for the installer. A new check can delete the downloaded update the installer is copying. Public builds read published releases and download assets from GitHub. Older builds keep their embedded update source until they are replaced. When the installer is idle, Check for Updates… is available in the Niko menu, menu bar, or tray alongside Restart to update.

A failed background check retries after one minute. Further failures double the wait, up to 15 minutes. Wake retries a failed check at once. A successful check restores the six-hour interval. Background failures do not open a dialog.

flowchart TD
  check[Check]:::muted --> ready[Update ready]
  ready --> menu[Restart to update<br/>in the menu]
  ready -- Build supports notice --> notice[In-app update notice]:::accent
  ready -. Background check,<br/>notifications allowed .-> system[System notification]
  system -- Click --> confirm[Restart or Later dialog]:::accent
  confirm -- Later --> menu
  confirm -- Restart --> busy{{Work running?}}
  notice -- Later --> menu
  notice -- Restart --> busy
  menu -- Select --> confirm
  busy -- no --> restart[Restart]:::go
  busy -- yes --> ask[Ask you first]:::accent
  ask -- Restart now --> restart

Restarting stops a running reply, scheduled task or background check, and you can ask Niko to continue afterwards. Queued messages, schedules and app checks resume. Niko reopens with the same window size and place, the same page, such as Chat or Usage, and any unsent text in the message box. If that place is no longer on a connected display, the window opens at its default size instead.

Niko downloads the update ZIP on a Mac or the installer on Windows, plus any changed local runtime pack, before it offers the restart. The Mac DMG is for installation, not in-app updates. While the runtime pack or Windows installer downloads, the update item in the menu shows progress. If the Mac's local computer is running, Niko tries to load the new container images before restart. Windows still runs the installer and applies a changed WSL runtime after restart. Starting the local computer, database and browser also takes time, so a ready notice means the downloads are complete, not that launch will be instant.

Newer builds show an in-app notice when the update is ready, with its version and Restart to update and Later actions. Later dismisses the notice for that version during the current app session; the menu still offers Restart to update. Restart to update in the notice restarts without another Restart or Later dialog. The menu item and a clicked system notification ask first. Older builds may show only the menu action. An automatic check also announces a ready update with a system notification when Niko is in the background, notifications are on and quiet hours allow it. Background checks never open a dialog. On a Mac, an update must be signed by the same developer as the installed app, and Niko refuses one with a lower version number, so an update feed can't roll Niko back to an older build. On Windows, the restart runs the installer in the background and opens Niko again. While Niko shuts down to install the update, its window stays open and shows Updating Niko… until it quits to install. If the window was closed, Niko opens it. On a Mac, the updater then copies and checks the new app before it opens it, which can take a minute or two with nothing on screen. If you open Niko during that time, it closes again at once, keeps the saved window state for the new version and lets the install finish.

When a newer release appears, Niko prepares it before offering restart. It reuses an already downloaded version when a check finds nothing newer. A failed release lookup keeps the downloaded update available. Once replacement staging begins, restart is available only after the new installer or app is verified. Checks and restarts cannot run together.

On Windows, update downloads keep partial files across retries and app launches. Each complete file must match its size and SHA-256 hash before reuse. The installer must also pass the publisher check each time Niko stages it. A stalled transfer stops after five minutes without data and keeps its saved bytes. A corrupt file is removed. Niko removes cached versions after they are installed or replaced by another update download.

Niko installs a ready update by itself once a minute check finds it idle: no Niko window is open, the local assistant has no running turn and no scheduled task is due within 15 minutes. A desktop client connected to a server checks only for open windows. Niko saves that it was in the background, so the new version starts without a window. Choosing Turn Off Niko also installs a ready update after normal shutdown. The app stays closed. On Windows, the update launcher runs the installer without opening Niko again. A quit request from an installer or uninstaller skips this automatic install, so two installers cannot run together. On a Mac, Squirrel stages the update without a relaunch and applies it after exit. Restart to update still installs and opens the app again. Closing a window keeps Niko on.

If Windows cannot start the update launcher during a normal quit, Niko records the failure and closes. The cached update stays available for another attempt after the next launch.

Niko keeps its profile, credentials and container volumes. A runtime update replaces tools and images without resetting the database.

On a Mac, startup stops the private computer before it changes the mounted runtime pack. Niko confirms that the computer stopped before it updates the mount and starts it again. If the stop command fails or Niko cannot confirm that the computer stopped, it keeps the existing mount and offers a retry.

On a Mac, Niko removes temporary file copies before it asks the native updater to quit and install. File cleanup does not cancel the updater's quit request.

The Terminal installer stops an old ShipIt update job before it replaces the app. It removes that job's cache only after the new app passes its checks. It keeps the previous app copy if the new app cannot open. For a manual DMG install after an update failure, see update recovery.

On a Mac, Niko keeps a verified copy of the stop program in its private profile before it starts the private computer. Shutdown can use that copy while the runtime pack downloads, or after an interrupted download removes the pack. Niko checks the saved program's hash and the computer's profile before it runs the stop command.

If startup fails and the private computer cannot stop, the technical details keep both failures. The quit prompt offers Try again and Quit anyway. Quit anyway closes Niko even if its private computer has not stopped.

Mac key storage keeps the original niko Safe Storage name even though the app is called Niko. If 0.4.0 saved a key through Niko Safe Storage, Niko reads that entry and encrypts each saved value with the original entry. It saves a value only after it checks that encryption and decryption agree. It does not replace or delete either Keychain entry. A failed read keeps the saved settings unchanged and reports that Niko could not read its saved key.

If a manual update check fails, choose Try again or Not now and keep using Niko. Background check failures stay quiet. If restarting fails before shutdown begins, Retry restart uses the update already downloaded. Once shutdown begins, Niko keeps its separate shutdown recovery prompt.

The Windows app has a few extra needs.

Need Detail
System Windows 11 x64 with hardware virtualization
WSL WSL 2 for the workspace and browser. If missing, the installer offers it, then Niko tries once after setup; approve the admin request and restart. Chat works without it.
Disk At least 20 GB free
Signing Signed by NeoSky AI, Inc. SmartScreen can still warn about a new release.

Inside Niko's distribution, drive mounts and Windows process access are turned off. Closing the window keeps Niko in the tray. Turn Off Niko stops only its own distribution.

  • Release builds cover Mac with Apple silicon or Intel, Windows 11 x64, and Linux x64 as a Flatpak preview. Linux ARM and Windows ARM builds are not published.
  • Local tasks run only while Niko is on and the computer is awake. While a chat reply, task, scheduled run or background check is in progress, Niko stops the computer from going to sleep when it's left idle. With Keep this computer awake when plugged in on, which is the default (turn it off in Settings → General), it also does so while the computer is plugged in and Niko has a scheduled task or a connected Telegram or WhatsApp channel. Niko reads that from its own service once a minute and when the computer wakes. On Windows, Electron's blocker is only an execution request, which doesn't keep a Modern Standby laptop out of standby, so Niko also holds a system-required power request through a hidden PowerShell helper that lives only while Niko runs. powercfg /requests lists it under SYSTEM as "Niko is keeping this computer awake for its work and schedules". If the helper can't start or stops, Niko writes Windows' reason to the startup log and doesn't retry until the next change between holding and releasing. Closing a laptop's lid or choosing Sleep still puts it to sleep. Server tasks run while the server runs.
  • Meta's WhatsApp Cloud API needs a public HTTPS callback. The QR connection works without one. The app doesn't relay webhooks to your computer.
  • Separate local installations start with their own profiles and do not sync or migrate data from a source install. To use the same assistant from several devices, connect them to one server.

These commands are for developers. Use the Node.js version in the root package.json and a local Docker builder.

  1. Install dependencies and prepare the runtime.

    Terminal
    pnpm install --frozen-lockfile
    pnpm --dir desktop install --frozen-lockfile
    pnpm run desktop:prepare
    node desktop/scripts/runtime-pack.mjs --seed-cache
  2. Build, test and package the app.

    Terminal
    pnpm run build
    pnpm run desktop:test
    pnpm run desktop:build

The app, DMG and matching runtime archive land in dist/desktop. --seed-cache installs the runtime on your Mac, and you can skip it.

The packaged engine includes only the packages in dependencies and what they depend on. Keep web-only packages and build tools in devDependencies. A desktop test fails if engine code imports one of them, other than Vite for the local development server.

To Run
Build a DMG with the runtime inside pnpm --dir desktop run build --full
Inspect the packaged engine only pnpm --dir desktop run build --stage-only, then look in dist/desktop-staging/engine
Run the app without packaging pnpm run desktop:dev
Replay onboarding pnpm --dir desktop start --onboarding
Use a fresh, throwaway profile NIKO_DESKTOP_USER_DATA=/tmp/niko-onboarding-review pnpm --dir desktop start --onboarding

The first unpackaged start downloads the PostgreSQL build for your computer into postgres/ at the repository root, checks its SHA-256 and reuses it afterwards. Packaged builds include it. On Windows, an unpackaged start needs the Microsoft Visual C++ Redistributable installed on your computer.

NIKO_DESKTOP_USER_DATA works in development and in the deliberately marked isolated test build. Normal packaged apps always use their own profile.

To test a local connection service, run the unpackaged app with a new, absolute profile path and a proxy origin:

Terminal
NIKO_DESKTOP_USER_DATA=/tmp/niko-proxy-review \
NIKO_COMPOSIO_PROXY_URL=http://127.0.0.1:8787 \
pnpm run desktop:dev

For OAuth callbacks, use your development service's public HTTPS origin instead. The address must have no path, query, fragment or user credentials; HTTP is allowed only for loopback. Packaged desktop apps and desktop launches without an explicit development profile ignore this override. Never use your normal Niko profile for this test.

Build for Windows

Run pnpm run desktop:windows:prepare on a Linux x64 Docker builder. Then, on Windows x64 with Go 1.26.8, NSIS and the C++ tools of Visual Studio or its Build Tools, install the root and desktop dependencies from their lockfiles and run pnpm run build and pnpm run desktop:windows:build.

To build and test on GitHub's Windows runners instead, see Test on Windows runners.