Docs

dae CLI

Entry point: src/cli/index.ts, published as the dae binary (bin.dae in package.json./dist/cli/index.js).

dae — Electron support for Vite + TypeScript apps

Usage:
  npx dae init             Scaffold electron/main.ts, electron/preload.ts, electron.config.ts
  npx dae run               Start the dev workflow (Vite dev server + Electron, hot-restart)
  npx dae build [platform]  Build the renderer, bundle electron sources, package with electron-builder
                             platform: mac | win | linux (defaults to the current OS)
  npx dae kill              Terminate Electron/Node processes tied to this project
  npx dae sync              Regenerate electron/plugins/generated/* from installed plugins
                             (packages with a "dae": { "plugin": true } marker). Run manually
                             after installing or removing a plugin.

dae add is an alias for dae init.

dae init

Scaffolds electron/main.ts, electron/preload.ts, electron/user/*, electron.config.ts, electron-builder.config.ts, and electron-env.d.ts from the templates in templates/. Never overwrites a file that already exists, so it's safe to re-run after adding new template files in a package update.

dae run

  1. Starts the Vite dev server if it isn't already running (or waits for it, per dev.url).
  2. Bundles electron/main.ts and electron/preload.ts with esbuild.
  3. Launches Electron against the dev server.
  4. Watches electron/main.ts and electron/preload.ts; restarts Electron automatically on change.
  5. Ctrl+C cleans up the dev server and Electron process.

dev.url: 'auto' makes dae run inspect the project's own vite.config for server.strictPort: if true, it waits on that exact port (Vite either binds there or refuses to start); otherwise it starts the dev server itself and reads the real URL back out of Vite's own startup output (Vite auto-increments past a busy default port). The resolved URL is passed to the Electron process via the DAE_DEV_URL environment variable.

dae build [mac|win|linux]

  1. Runs the renderer build (npm run build in the target project).
  2. Bundles electron/main.ts + electron/preload.ts.
  3. Packages an installer with electron-builder, using electron-builder.config.ts plus appId/appName from electron.config.ts (no need to duplicate those in the builder config).

Platform argument defaults to the current OS if omitted.

dae kill

Terminates any Electron/Node processes left over from a previous dae run for this project — useful when a crashed dev session leaves orphaned processes holding the dev port or app lock.

dae sync

Scans the project's declared dependencies for packages carrying a "dae": { "plugin": true } marker in their package.json, and regenerates electron/plugins/generated/{main,preload}.ts from them. Run manually after installing or removing a plugin package — this file is not watched automatically. Never hand-edit electron/plugins/generated/*; hand-registered plugins (or ones without the marker) go in electron/plugins/user/{main,preload}.ts instead, which dae sync never touches. See Plugins.

The playground's package.json wires the CLI into normal npm scripts:

{
  "scripts": {
    "dev": "vite",
    "build": "tsc --noEmit && vite build",
    "electron:run": "dae run",
    "electron:build": "dae build"
  }
}

Last updated on July 16, 2026