CLI

The @pracht/cli package provides three commands for development, building, and previewing your app.

pracht dev

Starts the Vite dev server with SSR middleware, HMR, and instant feedback.

pracht dev

# Custom port
PORT=4000 pracht dev

Routes are rendered server-side on each request. Changes to routes, shells, loaders, and components are reflected immediately via HMR.

pracht build

Runs a production build: client bundle, server bundle, and SSG/ISG prerendering.

pracht build

Output:

  • dist/client/ โ€” static assets with hashed filenames
  • dist/server/server.js โ€” server entry module
  • SSG routes are pre-rendered as static HTML in dist/client/

pracht preview

Runs the production server entry locally. Useful for smoke-testing the build before deploying.

pracht preview

# Custom port
PORT=4000 pracht preview

Installation

The CLI is included in scaffolded projects. For existing projects, add it as a dev dependency:

pnpm add -D @pracht/cli

Then add scripts to your package.json:

package.json
{
  "scripts": {
    "dev": "pracht dev",
    "build": "pracht build",
    "preview": "pracht preview"
  }
}