CLI

The marko-run CLI develops, builds, and previews Marko Run applications. Run it with npm exec marko-run or from package.json scripts.

All commands (dev, build, and preview) accept an optional [entry] server/runtime entry file and these shared options:

OptionDescription
-c, --configPath to a Vite config file (auto-discovers vite.config.{js,cjs,mjs,ts,mts} by default)
-e, --envPath to a dotenv file

dev

Starts the development server in watch mode (default command when omitted):

npm exec marko-run
npm exec marko-run dev [entry]
OptionDescription
-p, --portPort to listen on (defaults to Vite server.port, PORT env var, or 3000)

build

Creates a production build:

npm exec marko-run build [entry]
OptionDescription
-o, --outputOutput directory (defaults to Vite build.outDir, or dist)

preview

Builds the production output and starts a local preview server:

npm exec marko-run preview [entry]
OptionDescription
-o, --outputOutput directory to build and serve (defaults to Vite build.outDir, or dist)
-p, --portPort to listen on (defaults to Vite preview.port, PORT env var, or 3000)
-f, --fileBuilt entry file to start (defaults to index.mjs or index.js in output dir)

Next Steps


Contributors

Helpful? You can thank these awesome people! You can also edit this doc if you see any issues or want to improve it.