CLI
Methanol ships a small CLI wrapper with dev, build, and preview commands.
Commands
Quick start with npx:
npx methanol dev # start dev server
npx methanol build # build to dist/
npx methanol serve # serve the production build
For a faster CLI startup, install globally:
npm install methanol -g
methanol dev
You can pass input and output as positional args (order matters):
npx methanol build ./pages ./dist
For dev, only input is used:
npx methanol dev ./pages
Common Flags
--input,-i: overridepages/--components: overridecomponents/--assets: overridepublic/--output,-o: overridedist/--config,-c: set a config file path--site-name: override the site name--base: overridesite.basefor this run (ignored in dev)--port: set the dev/preview port (default: 5173)--host: bind the dev/preview server to a host (--hostalone binds to all interfaces)--intermediate-dir: write intermediate HTML output to a directory (build only)--emit-intermediate: write intermediate HTML output tobuild/(build only)--code-highlighting: enable/disable code highlighting (--code-highlightingenables;--code-highlighting falsedisables)-v,--verbose: enable verbose output (shows Vite + Pagefind logs during build)
Highlighting is off by default. Use the flag to enable it for a run.
Running Without npx
node node_modules/methanol/bin/methanol.js dev