First app

crust init my-app --react
cd my-app
bun install
crust dev

Scaffold, install, dev. crust init writes into an empty directory and refuses anything else, naming the entries it found, so nothing of yours is overwritten.

Pick a scaffold

you haveflagwhat it makes
HTML and CSS, no bundlernoneseven files; the bridge serves public/ itself
React, or a Vite frontend--reactVite on :5173, dev.url, build.assets: "dist/web"
Svelte, or a Vite frontend--svelteVite on :5173, dev.url, build.assets: "dist/web"
Vue, or a Vite frontend--vueVite on :5173, dev.url, build.assets: "dist/web"
Solid, or a Vite frontend--solidVite on :5173 with Solid 2, dev.url, build.assets: "dist/web"
Next.js, app router--nextnext dev on :3000, static export to out/

The flag is the whole difference. Plain is the default, and passing any two flags is refused before anything is written.

What you see

The plain scaffold, measured from an empty directory:

crust dev — /…/my-app/crust.config.ts
  frontend  served by the bridge (public/index.html, no dev server)

  bridge    http://127.0.0.1:49283
  window    open
  greet     hello crust (page call answered)

Every Vite scaffold, and --next, prints the dev-server URL instead of "served by the bridge", and crust dev starts that server through beforeDevCommand, then waits until it accepts a connection before creating the window.

--solid bundles Vite with Solid 2 rather than SolidStart: Solid 2 retired SolidStart, and dev.url wants one SPA on one origin.

What the window is

One NSWindow holding a WKWebView, created from the windows array in crust.config.ts. The page inside it is a normal web page; window.crust is the bridge's client, and a call reaches a handler in main.ts.

import { app } from "crust";

app.command("greet", ({ name }) => `hello ${name}`);

await app.run();
const text = await window.crust.invoke("greet", { name: "crust" });

Two arguments is an app command. A plugin command takes three: invoke("fs", "readTextFile", { path }).

How the pieces run

Where to go next