The Nuxi CLI

init, dev, build, generate, preview, module add

The Nuxi CLI

nuxi is the Nuxt CLI — scaffold projects, run the dev server, build for production, and manage modules.

4 min read Level 1/5 #nuxt#nuxi#cli
What you'll learn
  • Use nuxi dev, build, and preview
  • Generate a static site with nuxi generate
  • Install modules with nuxi module add

nuxi is your main interface with a Nuxt project. The starter wires the common commands into package.json scripts, but you can run them directly too.

Dev, Build, Preview

# start the dev server with HMR
npx nuxi dev

# produce a production SSR build in .output/
npx nuxi build

# locally preview the production build
npx nuxi preview

build outputs to .output/ — a self-contained Nitro server ready to deploy to Node, Vercel, Cloudflare, Bun, or Deno.

Static Site Generation

npx nuxi generate

Crawls your routes and pre-renders HTML for each one into .output/public/. Drop that on any static host (Netlify, GitHub Pages, S3) — no server required.

Adding Modules

The fastest way to install and register a Nuxt module is nuxi module add — it installs the npm package and updates nuxt.config.ts automatically.

npx nuxi module add @nuxt/image
npx nuxi module add @pinia/nuxt
npx nuxi module add @vueuse/nuxt

Diagnostics & Types

# typecheck the whole project with vue-tsc
npx nuxi typecheck

# print env info — node version, nuxt version, modules
npx nuxi info

# regenerate the .nuxt/ types (after editing nuxt.config)
npx nuxi prepare

nuxi prepare is the one to remember when CI complains about missing auto-generated types.

Project Structure →