CLI Reference

The Furin CLI builds production artifacts, previews static exports and generates route types. Development runs the application entry directly with Bun.

sh
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

sh
furin build [options]
FlagValueDefaultMeaning
--targetbun, vercel, static, package, all, or a configured adapter nameEvery config targets entry, else bunSelect output
--pagesDirPathConfig or auto-detectedBuild one explicit app
--prefixURL prefix""Prefix paired with the explicit pages directory
--configPathAuto-discoveredUse another config file
--compileserver or embedNo executable; inherits bun.compile when configuredProduce a Bun executable
--analyzeBoolean flagfalseWrite client Bun metafiles under .furin/build/analysis

--compile without a value means server; --compile=embed is also accepted.

sh
# 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

TargetStatusMain output
bunImplemented.furin/build/bun
staticImplementedstatic.outDir, default dist
packageImplemented.furin/build/package
vercelImplemented.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:

sh
furin typegen [options]
FlagDefaultMeaning
--pagesDirConfig, furin() calls detected in src/server.ts, then src/pagesPages directory of the root-mounted app
--configAuto-discoveredAlternate 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:

sh
furin preview [options]
FlagDefaultMeaning
--dirstatic.outDir or distDirectory to serve
--basePathstatic.basePath or ""Hosting prefix to simulate
--port3000Local TCP port
--configAuto-discoveredAlternate config file
sh
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

sh
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.

Comments