CLI
The elur-kit binary is available after installing the package.
# Commands
# elur-kit build
Builds the static site and client bundle.
elur-kit buildOptions:
| Flag | Default | Description |
|---|---|---|
-r, --root <dir> |
cwd |
Project root |
-a, --app <dir> |
src/app |
Pages directory |
-i, --islands <dir> |
src/islands |
Islands directory |
-o, --out <dir> |
dist |
Output directory |
-l, --lang <lang> |
es |
HTML lang attribute |
--hydrate-import <spec> |
@elurjs/kit/island |
Import path for hydrateIslands |
--client-config <path> |
vite.client.config.ts (auto) |
Vite config for client bundle |
# elur-kit dev
Starts the dev server with rebuild-on-change. Any source change restarts the worker process.
elur-kit devThe dev server:
- Watches
src/app/,src/islands/, andsrc/content/for changes - Restarts the worker on source changes (no stale module cache)
- Detects atomic saves (sed/editors) via
renameevents - Exits cleanly on SIGTERM
# elur-kit preview
Serves the static build in production mode. Falls back to on-demand SSR for routes not in dist/.
elur-kit build
elur-kit preview# elur-kit start
Runs the SSR server (renders pages on demand, serves static assets from dist/).
elur-kit build
elur-kit startISR options:
elur-kit start --cache-dir .elur/cache --default-revalidate 60| Flag | Default | Description |
|---|---|---|
-p, --port <number> |
3000 |
Server port |
-h, --host <address> |
127.0.0.1 |
Server host |
--cache-dir <dir> |
— | ISR cache directory |
--default-revalidate <sec> |
60 |
Default ISR TTL |
# elur-kit adapter <name>
Generates deployment configuration for a target platform.
elur-kit adapter vercel # → .vercel/output
elur-kit adapter netlify # → netlify/functions + netlify.toml
elur-kit adapter bun # → .elur/bun-server.ts
elur-kit adapter node # → .elur/node-server.mjsThe adapter command also runs validateCapabilities() at build time, so incompatible host/feature combinations (e.g. ISR on a serverless host with no persistent filesystem) fail fast with a diagnostic message instead of producing a broken deployment. See Adapter Capabilities.
# elur-kit check
Runs typecheck + route/config integrity checks. Exits non-zero on errors.
elur-kit checkCombines tsc --noEmit with route manifest validation (duplicate paths, missing dynamic segment params, invalid file conventions).
# elur-kit routes
Lists all discovered routes from src/app/:
elur-kit routesOutput:
GET / src/app/page.ts
GET /blog/:slug src/app/blog/[slug]/page.ts
GET /api/posts src/app/api/posts/route.ts
* /__elur/actions server actions endpoint# elur-kit doctor
Diagnoses common project issues — missing peer deps, invalid config, stale build artifacts, version mismatches between elur and elur-kit.
elur-kit doctor# Programmatic API
You can use the CLI programmatically:
import { run, type CliOptions } from "@elurjs/kit";
await run({
command: "build",
root: process.cwd(),
appDir: "src/app",
islandsDir: "src/islands",
outDir: "dist",
});# Bun runtime
For Bun-managed projects, the CLI automatically re-executes itself under the Bun runtime. This ensures bun:sqlite and other Bun-specific APIs work correctly with elur-kit build/dev/start/preview.
# Config file (v2.4.0+)
The kit looks for a config file at the project root:
elur.config.ts(preferred)elur.config.jselur.config.mjselur.config.ts(legacy, emits deprecation warning)elur.config.js(legacy)elur.config.mjs(legacy)
// elur.config.ts
import { defineConfig } from "@elurjs/kit";
export default defineConfig({
interpolation: "auto", // "auto" | "legacy" | "off"
images: {
strict: false, // fail build on image errors
},
});The generic elur.config.* name was a design error that could collide with other tools. v2.4.0 renamed it to elur.config.*. Legacy files are still detected for backward compatibility but emit a deprecation warning. elur-kit doctor reports legacy config files as warn status.