Practical Guides Β· knowledge base from X

npx as an app store β€” native desktop apps as npm packages (GPUIX)

Distributing native desktop apps as npm packages with GPUIX (React/Solid β†’ GPUI, without Electron): no per-OS build matrix, updates via @latest, small downloads, native argv/CLI, a Playwright-style automation API for AI agents. Case: disktree (~79 KB app + ~24 MB native).

✍️ Tommy D. Rossi · @__morse
πŸ”— Read the original on X Β· X Article Β· published 27 Sep 2026
πŸ“Š 311 likes Β· 344 bookmarks Β· 25k views
Summary and adaptation in English; content and results belong to the author.

Part of the manual How to build an app that makes money β€” the complete manual

Claimed result

  • Problem: shipping a desktop app = a binary for every OS, signing, notarization, download hosting, auto-update β€” so many tools remain CLIs or websites.
  • Proposed solution: the app is an npm package; npm already handles distribution, versioning and updates.
  • Stack: GPUIX β€” TypeScript/React (or Solid) rendering on the GPU via GPUI (Zed's UI framework). No Electron, no webview. The native part is prebuilt on npm (@gpuix/native).
  • disktree case (GPU treemap of the disk): app package 79 KB unpacked; shared native binary ~24 MB unpacked / <10 MB npm gzip tarball; cached after the first run.
  • Commands: npx … (Node 18+); disktree can run with Bun (bunx disktree).
  • Repo: https://github.com/remorses/gpuix. Native CI platforms: macOS arm64, Linux x64, Windows x64.

Proof: medium. Real open-source tooling and size numbers verifiable on the package; it isn't a revenue case of the author's, it's a distribution/product playbook.

The key idea

Desktop apps became hard because we treat them as another kind of software. If instead they are packages: - publish = npm publish; - update = the @latest tag (release channel = npm versions); - no installer, no .dmg to drag into Applications, no auto-updater to write; - you don't compile for every OS: only @gpuix/native is compiled once per release by the GPUIX CI; npm picks the right binary at install. Your app never touches a compiler.

Unexpected benefit: being a CLI, you get argv, flags, env, cwd for free. You open the app from the folder you're already in, with no folder picker.

Benefit for AI agents: the app is JS in node_modules β€” the agent downloads, runs, configures, patches a file and relaunches without cloning repos or rebuilding. GPUIX exposes an automation API similar to Playwright (testId, child process, screenshots) even with GPUIX_BACKGROUND=1 (a window that doesn't steal focus).

Step-by-step playbook

1. Write the app as a package

  • A few TypeScript files using React/Solid + components/hooks.
  • Paint: Metal / Vulkan / Direct3D via GPUI β†’ lighter than Electron (which ships a whole Chromium).
  • Access to any npm package and Node APIs (node:fs, worker threads) β€” that's how disktree scans the disk.

2. Publish

  1. npm publish the app package (JS only).
  2. Users open it with npx <pkg> (or bunx if the entry runs on Bun).
  3. To update: a new npm version; whoever launches @latest gets the update.

3. CLI arguments (e.g. disktree)

  • The folder as a positional argument from process.argv (one line).
  • Typical use: you're already in the path in the terminal β†’ you launch the app there. In a classic desktop app you'd click through the folder picker every time.

4. Automation for agents

  • Mark elements with testId.
  • Launch the app as a child process.
  • GPUIX_BACKGROUND=1 β†’ clicks and screenshots without focus.
  • If a feature is missing: edit the file in node_modules and restart immediately (debug/agent hot path).

5. Hot reload without cloning

text bun --hot <entry> Every save remounts the React tree on the same window (time ~ switching tabs). No compile step, no clone of the original repo. disktree keeps the scan result on globalThis so a save redraws without rescanning the disk.

6. Tests

The same automation API runs in tests on a GPU-backed renderer: the agent that writes the feature can verify it with real screenshots.

Tools and costs

Item Detail
GPUIX open source (GitHub remorses/gpuix)
Runtime Node 18+ or Bun (for direct TS entries)
Native @gpuix/native prebuilt (macOS arm64, Linux x64, Windows x64)
Typical size JS app tens of KB; native ~24 MB / <10 MB download
Electron (alternative) heavier (Chromium per app)
Distribution npm (free for public packages); custom download hosting not needed
Signing/notarization sidestepped by the "JS + shared prebuilt native" model (npm's trust limits remain)

Limitations

  • Technical target (Node/Bun/npm): it's not a consumer App Store.
  • Dependence on GPUIX's CI/native build and on the npm supply chain.
  • Listed native platforms: it doesn't cover every architecture (e.g. Linux arm may be missing).
  • It's not a monetization playbook: it explains how to ship, not how to get paid.
  • Trust: running npx from the internet carries supply-chain risks (like any npm package).
← More guides in β€œHow to build an app that makes money”