CLI Reference
The Furin CLI builds production artifacts, previews static exports and generates route types. Development runs the application entry directly with Bun.
furin help
furin build
furin preview
furin typegen
The generated project already exposes these through bun run build, bun run start, and bun run dev.
furin build
furin build [options]
| Flag | Value | Default | Meaning |
|---|---|---|---|
--target | bun, vercel, static, package, all, or a configured adapter name | Every config targets entry, else bun | Select output |
--pagesDir | Path | Config or auto-detected | Build one explicit app |
--prefix | URL prefix | "" | Prefix paired with the explicit pages directory |
--config | Path | Auto-discovered | Use another config file |
--compile | server or embed | No executable; inherits bun.compile when configured | Produce a Bun executable |
--analyze | Boolean flag | false | Write client Bun metafiles under .furin/build/analysis |
--compile without a value means server; --compile=embed is also accepted.
# Bundled Bun server
furin build --target bun
# Executable plus assets on disk
furin build --target bun --compile server
# One self-contained executable
furin build --target bun --compile embed
# Pure static output
furin build --target static
# Publishable Furin/Elysia plugin
furin build --target package --pagesDir ./src/admin --prefix /admin
# Bun, Vercel, and static outputs
furin build --target all
all means the deploy targets bun, vercel, and static; it deliberately excludes package, which is an alternative packaging of one app. A --target name that matches an entry of the config targets builds that entry, with its adapter options.
Target Status
| Target | Status | Main output |
|---|---|---|
bun | Implemented | .furin/build/bun |
static | Implemented | static.outDir, default dist |
package | Implemented | .furin/build/package |
vercel | Implemented | .vercel/output (Bun Function, CDN assets, native SSG/ISR) |
Every successful build writes .furin/build/manifest.json. It records route modes, app prefixes, output paths, build IDs, and target-specific metadata.
Analyze Output
--analyze writes Bun metafiles for client builds. They describe emitted byte sizes and import contributions, but do not measure startup latency, request throughput, memory, or edit-to-paint time.
furin typegen
Write furin-env.d.ts without starting or building the app, for example before tsc in CI:
furin typegen [options]
| Flag | Default | Meaning |
|---|---|---|
--pagesDir | Config, furin() calls detected in src/server.ts, then src/pages | Pages directory of the root-mounted app |
--config | Auto-discovered | Alternate config file |
It writes the same file as the development server and furin build: FileRoutes covers the route files of every mounted app, and RouteMap the patterns of the root-mounted app (prefix "").
furin preview
Serve a completed static export locally:
furin preview [options]
| Flag | Default | Meaning |
|---|---|---|
--dir | static.outDir or dist | Directory to serve |
--basePath | static.basePath or "" | Hosting prefix to simulate |
--port | 3000 | Local TCP port |
--config | Auto-discovered | Alternate config file |
furin build --target static
furin preview --port 4173
Preview handles clean HTML routes and the generated 404.html fallback. It is a validation server, not a production application runtime.
Development
bun --hot src/server.ts
The scaffolder maps that command to bun run dev. Route discovery, generated types, React Fast Refresh, server re-imports, diagnostics, and DevTools are activated by furin() in development; there is no separate furin dev command.