Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/dvlkit/nuxe/llms.txt

Use this file to discover all available pages before exploring further.

The nuxe CLI is the main interface for developing and deploying Nuxe applications. It ships as the nuxe binary inside the @dvlkit/nuxe package and exposes three sub-commands — dev, build, and start — each mapped directly to an underlying runtime function. create-nuxe is a separate scaffolding tool that bootstraps a new project from scratch without requiring an existing Nuxe installation.

nuxe dev

Starts a Vite-powered development server with SSR and Hot Module Replacement enabled. The server reads your nuxe.config.ts (if present) to determine the port, falling back to 3000. Pages, layouts, components, and composables are all hot-reloaded as you edit them.
nuxe dev
Once the server is ready, open http://localhost:3000 in your browser. The exact URL is printed in the terminal on startup.
The dev server runs in middleware mode — Vite handles the request pipeline directly. NODE_ENV is set to development automatically if it has not already been set. NUXE_DEV is set to true for the lifetime of the process.

nuxe build

Builds your application for production. Nuxe runs a Vite multi-environment build that produces output inside .output/:
DirectoryContents
.output/client/Static assets, client-side JS bundles, and CSS
.output/server/Nitro server entry point (index.mjs)
.output/server/ssr/SSR build artifacts copied from the Nitro Vite SSR stage
.output/public/Pre-rendered static HTML pages (only present when routes opt in)
nuxe build
If any of your pages declare routeRules: { prerender: true }, the build pipeline will pre-render those routes to static HTML files in .output/public/ automatically.
The .output/ directory is overwritten on every build. Do not place custom files inside it — they will be deleted.

nuxe start

Serves the production build produced by nuxe build. It loads the Nitro server bundle at .output/server/index.mjs, sets NODE_ENV to production, and begins listening on the configured port.
nuxe start
If the server bundle does not exist, nuxe start exits immediately with an actionable error:
Nitro server bundle not found at .output/server/index.mjs
Run `nuxe build` first.
nuxe start must always be preceded by nuxe build in the same environment. The production server reads the compiled output — it does not recompile on start.

nuxe —version

Prints the version of @dvlkit/nuxe that is currently installed.
nuxe --version

create-nuxe

create-nuxe is a standalone scaffolding tool that generates a ready-to-run Nuxe project. You do not need an existing project or a global Nuxe installation to use it — your package manager downloads and runs it on demand.
npm create nuxe@latest
You can also pass the project name as the first argument to skip the first prompt:
npm create nuxe@latest my-app

Interactive prompts

create-nuxe walks you through four prompts before writing any files:
  1. Project name — the directory to create and the name field in package.json. Only letters, numbers, dashes, and underscores are accepted. Skipped if you pass the name as a CLI argument.
  2. Dev port — the port written into nuxe.config.ts under server.port. Defaults to 3000.
  3. Include demo pages and composable example — when true, the scaffolded project includes example pages, components, and a composable under app/pages/, app/components/, and app/composables/. When false, a minimal app/app.vue with just <RouterView /> is written instead. Defaults to true.
  4. Add Tailwind CSS v4 — when true, @tailwindcss/vite is added as a Vite plugin in nuxe.config.ts, app/assets/css/main.css is created with @import "tailwindcss", and the relevant packages are added to devDependencies. Defaults to true.

What gets scaffolded

After answering the prompts, create-nuxe generates the following inside a new directory named after your project:
  • package.json — with pinned versions of @dvlkit/nuxe, vue, vue-router, and typescript resolved from the npm registry at scaffold time
  • nuxe.config.ts — minimal config with your chosen port (and optional Tailwind plugin)
  • app/app.vue — root component
  • app/pages/, app/components/, app/composables/ — demo content (if selected)
  • app/assets/css/main.css — Tailwind entry point (if selected)

Next steps

Once scaffolding is complete, the CLI prints the commands needed to get started:
cd my-app
pnpm install
pnpm dev

Environment variables

These environment variables are read by the CLI and the runtime server:
VariableDescriptionDefault
PORTThe port Nuxe listens on. Resolved from server.port in nuxe.config.ts; set automatically before the server starts.3000
NODE_ENVNode environment. Set to development by nuxe dev (if not already defined) and always set to production by nuxe start.
NUXE_BASE_URLBase URL used for server-side fetch calls. Automatically set to the listening URL in dev; defaults to http://localhost:<PORT> in production.http://localhost:3000
NUXE_DEVSet to true while the dev server is running; set to false by nuxe start.
NUXE_SILENTSuppress framework log output when set. Reserved — not forwarded to runtime config.
Any NUXE_* environment variable that is not in the reserved set (NUXE_SILENT, NUXE_DEV, NUXE_BASE_URL, NUXE_VITE_NODE_OPTIONS) is automatically available as a runtime config override at startup. For example, setting NUXE_API_KEY=secret injects runtimeConfig.apiKey into your application, and NUXE_PUBLIC_API_URL=https://api.example.com injects runtimeConfig.public.apiUrl. This lets you manage secrets and public configuration purely through environment variables without modifying nuxe.config.ts.

Build docs developers (and LLMs) love