CLI commands
The fuzor command is installed with the fuzor package. It chooses a build profile and runs Vite, which reads your vite.config.ts. Run it from the project folder, usually through package scripts.
| Command | Purpose |
|---|---|
fuzor dev | Development server |
fuzor build | Production build |
fuzor preview | Serve a finished build locally |
fuzor routes | List compiled routes, endpoints and server requirements |
fuzor deploy | Build and upload to Cloudflare Workers |
fuzor create | Scaffold a new app |
Commands reject extra positional arguments, which catches flags lost after --. With pnpm, write pnpm build --inline, not pnpm build -- --inline.
fuzor dev
fuzor dev
fuzor dev --target mpa --port 5180
fuzor dev --target spa --server --host 0.0.0.0
| Flag | Meaning |
|---|---|
--target spa|mpa|electron | Navigation/build target |
--platform name | Select the platform blocks used by pages, layouts and the root index.html shell |
--server | Serve pages through the generated server handler, as a server build would |
--host, --port | Address to listen on |
Page, layout, component and island changes reload the browser. Only pages whose inputs changed are compiled again (a page, its layouts, the components it uses); paths modules run on every change because they may read external data. API endpoints and server data modules apply on the next request. Adding the first api/ endpoint or server.ts changes the build profile; restart the dev server.
fuzor build
fuzor build
fuzor build --target mpa
fuzor build --target spa --inline
fuzor build --target mpa --server
| Flag | Meaning |
|---|---|
--target spa|mpa|electron | Navigation/build target |
--platform name | Select the platform blocks used by pages, layouts and the root index.html shell |
--server | Force server delivery. Not needed when the app has api/ or server.ts. |
--inline | Static SPA as a single HTML file |
--adapter node|cloudflare | Server deployment target; cloudflare adds a Worker and wrangler.jsonc (see deployment) |
The build is written to .fuzor-stage-<pid>/ and replaces the previous output only when it succeeds, and .fuzor-build.lock keeps a second build of the same project from starting. The CLI prints the output folder, why server output was selected, and how many assets were kept from the previous build for pages that are still open. See build profiles for every output.
fuzor preview
fuzor build --target mpa && fuzor preview --target mpa
fuzor preview --target spa --server --port 8080
Serves the build that fuzor build with the same flags would produce. Server builds run their generated handler. Static builds are served like a static host: route folders answer with their index.html, SPA deep links fall back to index.html, MPA misses get the nearest 404.html, and _redirects lines become redirects. --host defaults to 127.0.0.1 and --port to 4173. Each request is logged as GET /about/ 200 3ms; --quiet turns logging off. It stops gracefully on Ctrl+C.
fuzor preview uses the same Node adapter as production, so it is also a simple way to run a server build; see deployment.
fuzor routes
fuzor routes
fuzor routes --target mpa --json
Compiles the app and prints every page route with its source file, dynamic pattern and parameters, server data module, revalidate and islands, then not-found and error pages, redirects, API endpoints and whether the build needs a server and why. After a fuzor build of the same profile, each island also lists the JavaScript and CSS files it downloads, which shows what a page costs. --json prints the same report for scripts.
fuzor deploy
fuzor deploy --adapter cloudflare --dry-run
fuzor deploy --target mpa --adapter cloudflare
Builds with --adapter cloudflare (accepting --target), then runs the project's wrangler deploy with the generated wrangler.jsonc. --adapter cloudflare is required, since it is currently the only deployment target. --dry-run passes through to Wrangler, which bundles and validates without uploading. Wrangler's own login and account settings apply; see deployment.
fuzor create
npm create fuzor@latest my-app # without an existing install
fuzor create my-app --yes --install
Runs create-fuzor at the same version as the installed fuzor through npm exec, forwarding the directory, --yes (use defaults without prompts) and --install (install dependencies with pnpm). It reports separately when npm is missing, when the creator fails (for example offline without a cached package) and when it is interrupted.
Environment variables
--target, --platform, --server and --inline are passed to the Vite plugin as FUZOR_TARGET, FUZOR_PLATFORM, FUZOR_SERVER and FUZOR_INLINE. You can set them yourself when running vite directly; see configuration.