Getting started / Quick start

Quick start

This page gets a window on your screen with as little ceremony as possible.

1. Create a project

ow create my-app
cd my-app
npm install

You get a working starter: Vite + TypeScript frontend, a Node main process, a custom title bar, and a demo of most native APIs.

2. Run it

npm run dev

ow dev does four things:

  1. starts the Vite dev server on http://localhost:5173;
  2. compiles native/*.cpp (if any) into .owm modules;
  3. compiles app/main.ts to JavaScript with esbuild;
  4. launches the native kernel, pointing it at the dev server and the sidecar.

Close the window (or Ctrl+C) to stop everything.

3. Make it yours

The two files you will edit first:

  • src/renderer.ts — the UI. It runs inside the WebView and calls native code through window.ow.

    const text = await window.ow.invoke<string>('fs', 'readText', '/etc/hostname')
    
  • app/main.ts — the Node main process. It creates windows and can expose Node features to the UI.

    import { app, BrowserWindow } from '@owear/core'
    
    app.whenReady().then(() => {
      const win = new BrowserWindow({ title: 'My App', width: 900, height: 600 })
      win.loadURL(process.env.OW_DEV_SERVER_URL!)
    })
    

4. Build for production

ow build            # frontend + main.js + modules → dist/
ow build app        # a single self-contained binary → release/

See Packaging for .deb, AppImage, and MSI output.

Next steps

Edit this page on GitHub ↗